Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) TestGroupWidget

 

TestGroupWidget is a tool to test the WtGroupWidget classes.

 

 

 

 

 

TestGroupWidget downloads

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestGroupWidget/ToolTestGroupWidgetWebsite.pro

 

QT       += core
QT       -= gui
LIBS += -lwt -lwthttp -lboost_program_options
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app

INCLUDEPATH += \
    ../../Classes/CppAbout \
    ../../Classes/CppLed \
    ../../Classes/CppRainbow \
    ../../Classes/CppWtAboutDialog \
    ../../Classes/CppWtAutoConfig \
    ../../Classes/CppWtGroupWidget

SOURCES += wtmain.cpp \
    ../../Classes/CppAbout/about.cpp \
    ../../Classes/CppWtAboutDialog/wtaboutdialog.cpp \
    ../../Classes/CppWtGroupWidget/wtgroupwidget.cpp \
    wttestgroupwidgetmenudialog.cpp \
    wttestgroupwidgetmaindialog.cpp \
    ../../Classes/CppWtAutoConfig/wtautoconfig.cpp \
    testgroupwidgetmenudialog.cpp \
    ../../Classes/CppRainbow/rainbow.cpp

HEADERS  += \
    ../../Classes/CppAbout/about.h \
    ../../Classes/CppWtAboutDialog/wtaboutdialog.h \
    ../../Classes/CppWtGroupWidget/wtgroupwidget.h \
    wttestgroupwidgetmenudialog.h \
    wttestgroupwidgetmaindialog.h \
    ../../Classes/CppWtAutoConfig/wtautoconfig.h \
    testgroupwidgetmenudialog.h \
    ../../Classes/CppRainbow/rainbow.h

RESOURCES += \
    ToolTestGroupWidget.qrc

 

 

 

 

 

./ToolTestGroupWidget/ToolTestGroupWidgetConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestGroupWidget

SOURCES += \
    ../../Tools/ToolTestGroupWidget/testgroupwidgetmenudialog.cpp

HEADERS += \
    ../../Tools/ToolTestGroupWidget/testgroupwidgetmenudialog.h

OTHER_FILES += \
    ../../Tools/ToolTestGroupWidget/Licence.txt

RESOURCES += \
    ../../Tools/ToolTestGroupWidget/ToolTestGroupWidget.qrc

 

 

 

 

 

./ToolTestGroupWidget/ToolTestGroupWidgetDesktop.pri

 

include(../../Tools/ToolTestGroupWidget/ToolTestGroupWidgetConsole.pri)

 

 

 

 

 

./ToolTestGroupWidget/ToolTestGroupWidgetWebsite.pri

 

include(../../Tools/ToolTestGroupWidget/ToolTestGroupWidgetConsole.pri)

SOURCES += \
    ../../Tools/ToolTestGroupWidget/wttestgroupwidgetmaindialog.cpp \
    ../../Tools/ToolTestGroupWidget/wttestgroupwidgetmenudialog.cpp
HEADERS += \
    ../../Tools/ToolTestGroupWidget/wttestgroupwidgetmaindialog.h \
    ../../Tools/ToolTestGroupWidget/wttestgroupwidgetmenudialog.h

 

 

 

 

 

./ToolTestGroupWidget/testgroupwidgetmenudialog.h

 

//---------------------------------------------------------------------------
/*
TestGroupWidget, tool to test the GroupWidget class
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm
//---------------------------------------------------------------------------
#ifndef TESTGROUPWIDGETMENUDIALOG_H
#define TESTGROUPWIDGETMENUDIALOG_H

#include "menudialog.h"

namespace ribi {

struct TestGroupWidgetMenuDialog final : public MenuDialog
{
  About GetAbout() const noexcept override;
  Help GetHelp() const noexcept override;
  boost::shared_ptr<const Program> GetProgram() const noexcept override;
  std::string GetVersion() const noexcept override;
  std::vector<std::string> GetVersionHistory() const noexcept override;

  private:
  int ExecuteSpecific(const std::vector<std::string>& argv) noexcept override;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};


} //~namespace ribi

#endif // TESTGROUPWIDGETMENUDIALOG_H

 

 

 

 

 

./ToolTestGroupWidget/testgroupwidgetmenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestGroupWidget, tool to test the GroupWidget class
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm
//---------------------------------------------------------------------------
#include "testgroupwidgetmenudialog.h"

#include <cassert>
#include <iostream>

#include "richelbilderbeekprogram.h"
#include "trace.h"
#include "testtimer.h"

int ribi::TestGroupWidgetMenuDialog::ExecuteSpecific(const std::vector<std::string>& argv) noexcept
{
  #ifndef NDEBUG
  Test();
  #endif
  const int argc = static_cast<int>(argv.size());
  if (argc == 1)
  {
    std::cout << GetHelp() << '\n';
    return 1;
  }
  assert(!"TODO");
  return 1;
}

ribi::About ribi::TestGroupWidgetMenuDialog::GetAbout() const noexcept
{
  About a(
    "Richel Bilderbeek",
    "TestGroupWidget",
    "tool to test the (Wt)GroupWidget class",
    "the 8th of September 2011",
    "2011-2015",
    "http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm",
    GetVersion(),
    GetVersionHistory());
  return a;
}

ribi::Help ribi::TestGroupWidgetMenuDialog::GetHelp() const noexcept
{
  return Help(
    this->GetAbout().GetFileTitle(),
    this->GetAbout().GetFileDescription(),
    {

    },
    {

    }
  );
}

boost::shared_ptr<const ribi::Program> ribi::TestGroupWidgetMenuDialog::GetProgram() const noexcept
{
  const boost::shared_ptr<const Program> p {
    new ProgramTestGroupWidget
  };
  assert(p);
  return p;
}

std::string ribi::TestGroupWidgetMenuDialog::GetVersion() const noexcept
{
  return "1.4";
}

std::vector<std::string> ribi::TestGroupWidgetMenuDialog::GetVersionHistory() const noexcept
{
  return {
    "2011-06-16: Version 1.0: initial version",
    "2011-06-26: Version 1.1: replaced Wt::WTimer by WtSafeTimer",
    "2011-06-30: Version 1.2: replaced WtSafeTimer by Wt::WPushButton",
    "2011-09-08: Version 1.3: added edit in website version",
    "2013-11-05: version 1.4: conformized for ProjectRichelBilderbeekConsole"
  };
}

#ifndef NDEBUG
void ribi::TestGroupWidgetMenuDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
}
#endif

 

 

 

 

 

./ToolTestGroupWidget/wtmain.cpp

 

//---------------------------------------------------------------------------
/*
TestGroupWidget, tool to test the GroupWidget class
Copyright (C) 2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm
//---------------------------------------------------------------------------
#include <Wt/WApplication>
#include <Wt/WContainerWidget>
#include <Wt/WEnvironment>
//---------------------------------------------------------------------------
#include "wttestgroupwidgetmenudialog.h"
#include "wtautoconfig.h"
//---------------------------------------------------------------------------
struct WtApplication : public Wt::WApplication
{
  WtApplication(const Wt::WEnvironment& env)
    : Wt::WApplication(env),
    m_dialog(new WtTestGroupWidgetMenuDialog)
  {
    this->setTitle("TestGroupWidget");
    this->useStyleSheet("wt.css");
    root()->addWidget(m_dialog);
  }
  private:
  WtTestGroupWidgetMenuDialog * const m_dialog;
};
//---------------------------------------------------------------------------
Wt::WApplication *createApplication(
  const Wt::WEnvironment& env)
{
  return new WtApplication(env);
}
//---------------------------------------------------------------------------
int main(int argc, char **argv)
{
  WtAutoConfig::SaveDefaultStylesheet();
  WtAutoConfig a(argc,argv,createApplication);
  return a.Run();
}
//---------------------------------------------------------------------------

 

 

 

 

 

./ToolTestGroupWidget/wttestgroupwidgetmaindialog.h

 

//---------------------------------------------------------------------------
/*
TestGroupWidget, tool to test the GroupWidget class
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm
//---------------------------------------------------------------------------
#ifndef WTTESTGROUPWIDGETDIALOG_H
#define WTTESTGROUPWIDGETDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <Wt/WContainerWidget>
#pragma GCC diagnostic pop

namespace ribi {

struct WtGroupWidget;
//---------------------------------------------------------------------------
struct WtTestGroupWidgetMainDialog : public Wt::WContainerWidget
{
  WtTestGroupWidgetMainDialog();

  private:
  struct Ui
  {
    Ui();
    Wt::WLineEdit * const m_edit;
    WtGroupWidget * const m_widget;
  } ui;

  ///Respond to a change in m_edit
  void OnChanged();

  ///Respond to a click on the button
  void OnClicked();

  //From http://www.richelbilderbeek.nl/CppSeperateString.htm
  static const std::vector<std::string> SeperateString(
    const std::string& input,
    const char seperator);

};

} //~namespace ribi

#endif // WTTESTGROUPWIDGETDIALOG_H

 

 

 

 

 

./ToolTestGroupWidget/wttestgroupwidgetmaindialog.cpp

 

//---------------------------------------------------------------------------
/*
TestGroupWidget, tool to test the GroupWidget class
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm
//---------------------------------------------------------------------------
#include <string>
#include <vector>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <boost/algorithm/string/split.hpp>
#include <boost/foreach.hpp>
//---------------------------------------------------------------------------
#include <Wt/WBreak>
#include <Wt/WLabel>
#include <Wt/WLineEdit>
#include <Wt/WPaintDevice>
#include <Wt/WPainter>
#include <Wt/WPushButton>
//---------------------------------------------------------------------------
#include "wtgroupwidget.h"
#include "wttestgroupwidgetmaindialog.h"
#pragma GCC diagnostic pop

ribi::WtTestGroupWidgetMainDialog::Ui::Ui()
  : m_edit(new Wt::WLineEdit),
    m_widget(new WtGroupWidget)
{

}
//---------------------------------------------------------------------------
ribi::WtTestGroupWidgetMainDialog::WtTestGroupWidgetMainDialog()
  : ui{}
{
  this->clear();
  this->setContentAlignment(Wt::AlignCenter);
  this->addWidget(new Wt::WBreak);
  this->addWidget(new Wt::WBreak);
  this->addWidget(ui.m_widget);
  this->addWidget(new Wt::WBreak);
  this->addWidget(ui.m_edit);
  this->addWidget(new Wt::WBreak);
  this->addWidget(new Wt::WBreak);
  {
    Wt::WPushButton * const button = new Wt::WPushButton("Create random groups",this);
    button->clicked().connect(this,&ribi::WtTestGroupWidgetMainDialog::OnClicked);
  }

  ui.m_edit->resize(400,Wt::WLength::Auto);
  ui.m_edit->changed().connect(this,&ribi::WtTestGroupWidgetMainDialog::OnChanged);
  ui.m_edit->enterPressed().connect(this,&ribi::WtTestGroupWidgetMainDialog::OnChanged);
  ui.m_edit->setText("1|2,3|4,5,6|7,8,9,10");
  ui.m_widget->resize(400,400);

  this->OnChanged();
}
//---------------------------------------------------------------------------
void ribi::WtTestGroupWidgetMainDialog::OnChanged()
{
  const std::vector<std::string> groups_str
    = SeperateString(ui.m_edit->text().toUTF8(),'|');

  std::vector<std::vector<int> > groups_ids;

  BOOST_FOREACH(const std::string& group_str,groups_str)
  {
    const std::vector<std::string> ids_str
      = SeperateString(group_str,',');
    std::vector<int> ids;

    BOOST_FOREACH(const std::string& s,ids_str)
    {
      try
      {
        const int id = boost::lexical_cast<int>(s);
        ids.push_back(id);
      }
      catch (boost::bad_lexical_cast& e)
      {
        ui.m_widget->SetIds(groups_ids);
        return;
      }
    }
    groups_ids.push_back(ids);
  }
  ui.m_widget->SetIds(groups_ids);
}
//---------------------------------------------------------------------------
void ribi::WtTestGroupWidgetMainDialog::OnClicked()
{
  int id = 0;
  std::vector<std::vector<int> > v;
  const int n_groups = std::rand() % 20;
  for (int i=0; i!=n_groups; ++i)
  {
    std::vector<int> w;
    const int group_size = std::rand() % 20;
    for (int j=0; j!=group_size;++j)
    {
      w.push_back(id++);
    }
    v.push_back(w);
  }
  ui.m_widget->SetIds(v);
}
//---------------------------------------------------------------------------
const std::vector<std::string> ribi::WtTestGroupWidgetMainDialog::SeperateString(
  const std::string& input,
  const char seperator)
{
  std::vector<std::string> v;
  boost::algorithm::split(v,input,
    std::bind2nd(std::equal_to<char>(),seperator),
    boost::algorithm::token_compress_on);
  return v;
}
//---------------------------------------------------------------------------

 

 

 

 

 

./ToolTestGroupWidget/wttestgroupwidgetmenudialog.h

 

//---------------------------------------------------------------------------
/*
TestGroupWidget, tool to test the GroupWidget class
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm
//---------------------------------------------------------------------------
#ifndef WTTESTGROUPWIDGETMENUDIALOG_H
#define WTTESTGROUPWIDGETMENUDIALOG_H
//---------------------------------------------------------------------------
#include <Wt/WContainerWidget>
//---------------------------------------------------------------------------
namespace ribi {

struct WtTestGroupWidgetMenuDialog : public Wt::WContainerWidget
{
  WtTestGroupWidgetMenuDialog();
  private:
  Wt::WWidget * CreateNewAboutDialog() const;
  Wt::WWidget * CreateNewMainDialog() const;
  Wt::WWidget * CreateNewWelcomeDialog() const;
};

} //~namespace ribi

#endif // WTTESTGROUPWIDGETMENUDIALOG_H

 

 

 

 

 

./ToolTestGroupWidget/wttestgroupwidgetmenudialog.cpp

 

//---------------------------------------------------------------------------
/*
TestGroupWidget, tool to test the GroupWidget class
Copyright (C) 2011-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestGroupWidget.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <cassert>

#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>

#include <Wt/WBreak>
#include <Wt/WContainerWidget>
#include <Wt/WGroupBox>
#include <Wt/WImage>
#include <Wt/WLabel>
#include <Wt/WStackedWidget>
#include <Wt/WMenu>
#include <Wt/WMenuItem>

#include "rainbow.h"
#include "testgroupwidgetmenudialog.h"
#include "wtaboutdialog.h"
#include "wtautoconfig.h"
#include "wtgroupwidget.h"
#include "wttestgroupwidgetmaindialog.h"
#include "wttestgroupwidgetmenudialog.h"

#include <QFile>
#pragma GCC diagnostic pop

ribi::WtTestGroupWidgetMenuDialog::WtTestGroupWidgetMenuDialog()
{
  {
    std::vector<std::string> image_names;
    image_names.push_back("ToolTestGroupWidgetWelcome.png");

    BOOST_FOREACH(const std::string& filename,image_names)
    {
      if (!(QFile::exists(filename.c_str())))
      {
        QFile f( (std::string(":/ToolTestGroupWidget/images/") + filename).c_str() );
        f.copy(filename.c_str());
      }
      if (!boost::filesystem::exists(filename.c_str()))
      {
        std::cerr << "File not found: " << filename << '\n';
      }
      assert(boost::filesystem::exists(filename.c_str()));
    }
  }
  this->setContentAlignment(Wt::AlignCenter);
  {
    Wt::WLabel * const title = new Wt::WLabel("TestGroupWidget");
    title->setStyleClass("title");
    this->addWidget(title);
  }
  //Menu
  {
    Wt::WStackedWidget * const contents = new Wt::WStackedWidget;
    Wt::WMenu * const menu = new Wt::WMenu(contents,Wt::Horizontal);
    //Using CSS styleclass is the best (only?) way to display the menu well
    menu->setStyleClass("menu");
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "Welcome",
        CreateNewWelcomeDialog());
      menu->addItem(item);
    }
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "Start",
        CreateNewMainDialog());
      menu->addItem(item);
    }
    {
      Wt::WMenuItem * const item = new Wt::WMenuItem(
        "About",
        CreateNewAboutDialog());
      menu->addItem(item);
    }
    //Display menu on top
    this->addWidget(menu);
    this->addWidget(new Wt::WBreak);
    //Display contents below menu
    this->addWidget(contents);
  }
}

Wt::WWidget * ribi::WtTestGroupWidgetMenuDialog::CreateNewAboutDialog() const
{
  About a = TestGroupWidgetMenuDialog().GetAbout();
  a.AddLibrary("Rainbow version: " + Rainbow::GetVersion());
  a.AddLibrary("WtAutoConfig version: " + WtAutoConfig::GetVersion());
  a.AddLibrary("WtGroupWidget version: " + WtGroupWidget::GetVersion());
  WtAboutDialog * const d = new WtAboutDialog(a,false);
  assert(d);
  return d;
}

Wt::WWidget * ribi::WtTestGroupWidgetMenuDialog::CreateNewMainDialog() const
{
  WtTestGroupWidgetMainDialog * const d = new WtTestGroupWidgetMainDialog;
  assert(d);
  return d;
}

Wt::WWidget * ribi::WtTestGroupWidgetMenuDialog::CreateNewWelcomeDialog() const
{
  Wt::WContainerWidget * dialog = new Wt::WContainerWidget;
  dialog->setContentAlignment(Wt::AlignCenter);
  dialog->addWidget(new Wt::WBreak);
  new Wt::WLabel("Welcome to TestGroupWidget",dialog);
  new Wt::WBreak(dialog);
  new Wt::WBreak(dialog);
  new Wt::WLabel("TestGroupWidget tests and displays the GroupWidget class",dialog);
  new Wt::WBreak(dialog);
  new Wt::WBreak(dialog);
  Wt::WGroupBox * const box = new Wt::WGroupBox("Explanation",dialog);
  box->addWidget(new Wt::WImage("ToolTestGroupWidgetWelcome.png"));
  return dialog;
}

 

 

 

 

 

./ToolTestGroupWidget/crosscompiletowindows.sh

 

#!/bin/sh
#From http://richelbilderbeek.nl/CppQtCrosscompileToWindowsExample15.htm

echo "Cross compiling to Windows"

echo "1/2: Creating Windows makefile"
i686-pc-mingw32-qmake ToolTestLedDesktop.pro

echo "2/2: making makefile"

make

echo "Done"

 

 

 

 

 

./ToolTestGroupWidget/zip.sh

 

#!/bin/sh
#zip packs all the files to port into a single .zip file,
#minicking the same folder structure
#Folder structure
# *
#   * Classes
#     * CppAbout
#     * CppRainbow
#     * CppWtAboutDialog
#     * CppWtAutoConfig
#     * CppWtGroupWidget
#     * ???
#   * Tools
#    * ToolTestGroupWidget

rm ToolTestGroupWidgetWebsite.pro.user
rm copy.txt
rm tmp.txt

echo "Mimicking file structure"
mkdir temp_zip
mkdir temp_zip/Classes
mkdir temp_zip/Classes/CppAbout
mkdir temp_zip/Classes/CppRainbow
mkdir temp_zip/Classes/CppWtAboutDialog
mkdir temp_zip/Classes/CppWtAutoConfig
mkdir temp_zip/Classes/CppWtGroupWidget
mkdir temp_zip/Tools
mkdir temp_zip/Tools/ToolTestGroupWidget

echo "Copying files"
cp ../../Classes/CppAbout/*.* temp_zip/Classes/CppAbout
cp ../../Classes/CppRainbow/*.* temp_zip/Classes/CppRainbow
cp ../../Classes/CppWtAboutDialog/*.* temp_zip/Classes/CppWtAboutDialog
cp ../../Classes/CppWtAutoConfig/*.* temp_zip/Classes/CppWtAutoConfig
cp ../../Classes/CppWtGroupWidget/*.* temp_zip/Classes/CppWtGroupWidget
cp ../../Tools/ToolTestGroupWidget/*.* temp_zip/Tools/ToolTestGroupWidget



FILENAME=ToolTestGroupWidgetSource_1_3
ZIP_FILENAME=$FILENAME".zip"

#echo "Compressing files"
cd temp_zip
zip -r $FILENAME Classes
#zip -r $FILENAME Libraries
#zip -r $FILENAME Projects
zip -r $FILENAME Tools
cd ..
cp "temp_zip/"$ZIP_FILENAME $ZIP_FILENAME

echo "Cleaning up"
#Classes
rm temp_zip/Classes/CppAbout/*.*
rm temp_zip/Classes/CppRainbow/*.*
rm temp_zip/Classes/CppWtAboutDialog/*.*
rm temp_zip/Classes/CppWtAutoConfig/*.*
rm temp_zip/Classes/CppWtGroupWidget/*.*

rmdir temp_zip/Classes/CppAbout
rmdir temp_zip/Classes/CppRainbow
rmdir temp_zip/Classes/CppWtAboutDialog
rmdir temp_zip/Classes/CppWtAutoConfig
rmdir temp_zip/Classes/CppWtGroupWidget
rmdir temp_zip/Classes

#Tools
rm temp_zip/Tools/ToolTestGroupWidget/*.*
rmdir temp_zip/Tools/ToolTestGroupWidget
rmdir temp_zip/Tools
rm temp_zip/*.*
rmdir temp_zip
echo "Done"

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml