compbench-devel Mailing List for CompBenchmarks (Page 13)
Brought to you by:
xfred
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(51) |
Nov
(66) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(242) |
Feb
(56) |
Mar
(95) |
Apr
(120) |
May
(127) |
Jun
(32) |
Jul
(10) |
Aug
(55) |
Sep
(114) |
Oct
(3) |
Nov
|
Dec
|
From: Frederic T. <xf...@us...> - 2007-05-17 14:29:17
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8008 Modified Files: Benchmark.cpp Benchmark.h Log Message: CBM::Plan modified. Index: Benchmark.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Benchmark.h 15 Feb 2007 18:57:30 -0000 1.5 --- Benchmark.h 17 May 2007 14:29:12 -0000 1.6 *************** *** 15,31 **** #include <vector> - #ifdef SWIG - /* !!! If in SWIG parser, we need to define CBM::Plan so that all methods get - * correctly wrapped. Hope there's a better solution... */ - %module CBM - %{ - #include <Plan/Plan.h> - %} - #define CBM_PLAN CBM::Plan - - #else - # define CBM_PLAN class Plan - #endif - namespace CBM { class System; --- 15,18 ---- *************** *** 48,52 **** protected: class Package *package; ! CBM_PLAN *plan; /** Constructor * Initialise the Benchmark::system variable. */ --- 35,39 ---- protected: class Package *package; ! /** Constructor * Initialise the Benchmark::system variable. */ *************** *** 68,73 **** public: - virtual void setPlan(CBM_PLAN *_plan, int modifyPlanObject); - /** Benchmark name \return a std::string representing current benchmark's identification --- 55,58 ---- Index: Benchmark.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Benchmark.cpp 16 May 2007 12:06:17 -0000 1.8 --- Benchmark.cpp 17 May 2007 14:29:12 -0000 1.9 *************** *** 9,13 **** #include <Benchmark/Benchmark.h> #include <Benchmark/Package.h> - #include <Plan/Plan.h> #include <iostream> --- 9,12 ---- *************** *** 20,24 **** { package=_package; - plan=0; } /* --- 19,22 ---- *************** *** 35,46 **** */ - void Benchmark::setPlan(CBM::Plan *_plan, int modifyPlanObject) - { - if ((modifyPlanObject) && (plan)) - plan->remove(this); - - plan=_plan; - } - std::string Benchmark::Name(void) { --- 33,36 ---- *************** *** 114,117 **** { package->removeCached(this); - setPlan(0, 1); } --- 104,106 ---- |
From: Frederic T. <xf...@us...> - 2007-05-17 00:41:48
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12988 Modified Files: compbenchmarks-ui-qt4.pro Log Message: warn_on added. Index: compbenchmarks-ui-qt4.pro =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/compbenchmarks-ui-qt4.pro,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** compbenchmarks-ui-qt4.pro 16 May 2007 20:25:50 -0000 1.2 --- compbenchmarks-ui-qt4.pro 17 May 2007 00:41:44 -0000 1.3 *************** *** 6,9 **** --- 6,11 ---- TARGET = compbenchmarks-ui-qt4 DEPENDPATH += . Package Status + CONFIG += warn_on + INCLUDEPATH += . ../libcompbenchmarks ../testing/libcompbenchmarks |
From: Frederic T. <xf...@us...> - 2007-05-16 20:25:53
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15041 Modified Files: compbenchmarks-ui-qt4.pro main.cpp main.h Log Message: Many improvements. Index: main.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 16 May 2007 16:12:06 -0000 1.1 --- main.cpp 16 May 2007 20:25:50 -0000 1.2 *************** *** 2,8 **** #include <config.h> #include <libcompbenchmarks.h> - #include <Status/Status.h> using namespace CQT; --- 2,9 ---- #include <config.h> #include <libcompbenchmarks.h> #include <Status/Status.h> + #include <QFileDialog> + using namespace CQT; *************** *** 45,51 **** --- 46,118 ---- } + CompilerAutodetectThread::CompilerAutodetectThread(QObject *parent) + : QThread(parent) + { + } + + void CompilerAutodetectThread::run() + { + static int known_compiler_number = 24; + const char *known_compilers[] = {"/usr/bin/gcc", + "/usr/bin/tcc", + "gcc-2.95", + "gcc-2.96", + "gcc-3.1", + "gcc-3.2", + "gcc-3.3", + "gcc-3.4", + "gcc-4.0", + "gcc-4.1", + "gcc-4.2", + "/usr/local/bin/gcc", + "/usr/local/bin/tcc", + "/usr/bin/g++", + "g++-2.95", + "g++-2.96", + "g++-3.1", + "g++-3.2", + "g++-3.3", + "g++-3.4", + "g++-4.0", + "g++-4.1", + "g++-4.2", + "/usr/local/bin/g++"}; + CBM::CompilerSelector SC(CBM::cbmSystem); + CBM::Compiler *C; + + int i; + + CBM::cbmUI->Information(CBM::UI::CompilerAutodetect, + "", + CBM::UI::Start); + + + for(i=0; i<known_compiler_number; i++) { + C=SC.select(known_compilers[i]); + if (C) { + App->compilerRegister(C); + } + CBM::cbmUI->Information(CBM::UI::CompilerAutodetect, + "", + CBM::UI::Running, + (float) (i*100)/known_compiler_number); + } + CBM::cbmUI->Information(CBM::UI::CompilerAutodetect, + "", + CBM::UI::OK); + + if (parent()) + parent()->deleteLater(); + } + + CompilerAutodetectThread::~CompilerAutodetectThread() + { + } + Application::Application(int &argc, char **argv) : QApplication(argc, argv) { + mainTab = new QTabWidget; + App=this; *************** *** 53,57 **** --- 120,129 ---- qRegisterMetaType<CBM::Package*>("CBM::Package*"); + packageManager=new PackageManager; + mainTab->addTab(packageManager,tr("Packages")); + + compilerManager=new CompilerManager; + mainTab->addTab(compilerManager,tr("Compilers")); connect(this, SIGNAL(sigPackageInstallation(CBM::Package*)), *************** *** 66,69 **** --- 138,147 ---- this, SLOT(doPackagesRefresh()), Qt::QueuedConnection); + + connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), + compilerManager, SLOT(doCompilerRegister(CBM::Compiler*))); + + connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), + compilerManager, SLOT(doCompilerUnregister(CBM::Compiler*))); } *************** *** 102,105 **** --- 180,217 ---- } + void Application::doCompilerAutodetect(void) + { + StatusWidget *W; + CompilerAutodetectThread *T; + + W=new StatusWidget(0); + + W->show(); + T=new CompilerAutodetectThread(W); + T->start(); + } + + void Application::doCompilerRegisterManual(void) + { + CBM::Compiler *C; + + QFileDialog F(0, Qt::Dialog); + + F.setAcceptMode(QFileDialog::AcceptOpen); + F.setFileMode(QFileDialog::ExistingFile); + F.setModal(true); + + if (F.exec()==QDialog::Accepted) { + QStringList L = F.selectedFiles(); + + CBM::CompilerSelector SC(CBM::cbmSystem); + + C=SC.select(L[0].toStdString()); + if (C) { + compilerRegister(C); + } + } + } + void Application::packageInstallation(CBM::Package *_package) { *************** *** 112,115 **** --- 224,236 ---- } + void Application::compilerRegister(CBM::Compiler *_compiler) + { + emit sigCompilerRegister(_compiler); + } + + void Application::compilerUnregister(CBM::Compiler *_compiler) + { + emit sigCompilerUnregister(_compiler); + } Application::~Application() *************** *** 143,148 **** */ ! ! app.packageManager->show(); result=app.exec(); --- 264,268 ---- */ ! app.mainTab->show(); result=app.exec(); Index: compbenchmarks-ui-qt4.pro =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/compbenchmarks-ui-qt4.pro,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** compbenchmarks-ui-qt4.pro 16 May 2007 16:12:06 -0000 1.1 --- compbenchmarks-ui-qt4.pro 16 May 2007 20:25:50 -0000 1.2 *************** *** 9,15 **** # Input ! HEADERS += Package/PackageHolder.h Package/PackageInfo.h Package/PackageList.h Package/PackageManager.h Status/Status.h main.h # FORMS += tests-designer/checkItem.ui tests-designer/test.ui ! SOURCES += Package/PackageHolder.cpp Package/PackageInfo.cpp Package/PackageList.cpp Package/PackageManager.cpp Status/Status.cpp main.cpp LIBS += -L../testing/libcompbenchmarks/.libs -lcompbenchmarks RESOURCES += icons/icons.qrc --- 9,15 ---- # Input ! HEADERS += Package/PackageHolder.h Package/PackageInfo.h Package/PackageList.h Package/PackageManager.h Compiler/CompilerHolder.h Compiler/CompilerInfo.h Compiler/CompilerList.h Compiler/CompilerManager.h Status/Status.h main.h # FORMS += tests-designer/checkItem.ui tests-designer/test.ui ! SOURCES += Package/PackageHolder.cpp Package/PackageInfo.cpp Package/PackageList.cpp Package/PackageManager.cpp Compiler/CompilerHolder.cpp Compiler/CompilerInfo.cpp Compiler/CompilerList.cpp Compiler/CompilerManager.cpp Status/Status.cpp main.cpp LIBS += -L../testing/libcompbenchmarks/.libs -lcompbenchmarks RESOURCES += icons/icons.qrc Index: main.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.h 16 May 2007 16:12:06 -0000 1.1 --- main.h 16 May 2007 20:25:50 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- #include <Package/PackageManager.h> + #include <Compiler/CompilerManager.h> namespace CQT { *************** *** 34,37 **** --- 35,47 ---- }; + class CompilerAutodetectThread : public QThread + { + Q_OBJECT + public: + CompilerAutodetectThread(QObject *parent = 0); + virtual void run(); + virtual ~CompilerAutodetectThread(); + }; + class Application : public QApplication { *************** *** 39,44 **** Q_OBJECT - public: PackageManager *packageManager; protected: protected slots: --- 49,58 ---- Q_OBJECT PackageManager *packageManager; + CompilerManager *compilerManager; + + public: + QTabWidget *mainTab; + protected: protected slots: *************** *** 50,57 **** --- 64,77 ---- void sigPackagesRefresh(); + void sigCompilerRegister(CBM::Compiler *_compiler); + void sigCompilerUnregister(CBM::Compiler *_compiler); + public slots: void doPackageInstallation(CBM::Package *_package); void doPackageUninstallation(CBM::Package *_package); + void doCompilerAutodetect(void); + void doCompilerRegisterManual(void); + public: Application(int &argc, char **argv); *************** *** 60,63 **** --- 80,85 ---- virtual void packageUninstallation(CBM::Package *_package); virtual void packagesRefresh(void); + virtual void compilerRegister(CBM::Compiler *_compiler); + virtual void compilerUnregister(CBM::Compiler *_compiler); virtual ~Application(); |
From: Frederic T. <xf...@us...> - 2007-05-16 20:25:33
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Status In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15016 Modified Files: Status.cpp Status.h Log Message: Many improvements. Index: Status.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Status/Status.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Status.h 16 May 2007 16:12:07 -0000 1.1 --- Status.h 16 May 2007 20:25:30 -0000 1.2 *************** *** 31,34 **** --- 31,36 ---- virtual void sigProgressDone(void); virtual void sigUninstall(CBM::UI::State state); + virtual void sigCompilerAutodetect(CBM::UI::State state, + float _p); protected slots: *************** *** 37,40 **** --- 39,44 ---- virtual void progressDone(void); virtual void uninstall(CBM::UI::State state); + virtual void compilerAutodetect(CBM::UI::State state, + float _p); public: Index: Status.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Status/Status.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Status.cpp 16 May 2007 16:12:07 -0000 1.1 --- Status.cpp 16 May 2007 20:25:30 -0000 1.2 *************** *** 42,45 **** --- 42,49 ---- this, SLOT(uninstall(CBM::UI::State)), Qt::QueuedConnection); + + connect(this, SIGNAL(sigCompilerAutodetect(CBM::UI::State, float)), + this, SLOT(compilerAutodetect(CBM::UI::State, float)), + Qt::QueuedConnection); } *************** *** 81,84 **** --- 85,102 ---- } + + void StatusWidget::compilerAutodetect(CBM::UI::State state, + float _p) + { + if (state==CBM::UI::Start) + ProgressInit("Detecting installed compilers..."); + else { + if (state==CBM::UI::Running) + Progress(_p); + else + ProgressDone(); + } + } + int StatusWidget::Information(CBM::UI::Info type, std::string msg, *************** *** 90,93 **** --- 108,113 ---- emit sigUninstall(state); break; + case CompilerAutodetect: + emit sigCompilerAutodetect(state, _progress); default: break; |
From: Frederic T. <xf...@us...> - 2007-05-16 20:25:13
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/icons In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14995 Modified Files: icons.qrc Log Message: New icons. Index: icons.qrc =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/icons/icons.qrc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** icons.qrc 16 May 2007 16:12:07 -0000 1.1 --- icons.qrc 16 May 2007 20:25:10 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- <RCC> <qresource prefix="/icons" > + <file>add.png</file> <file>admin.png</file> <file>arrow-right.png</file> *************** *** 6,12 **** --- 7,15 ---- <file>downloads.png</file> <file>error.png</file> + <file>find.png</file> <file>led-green.png</file> <file>led-yellow.png</file> <file>package.png</file> + <file>remove.png</file> <file>success.png</file> <file>tip.png</file> |
From: Frederic T. <xf...@us...> - 2007-05-16 20:24:58
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/icons In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14635 Added Files: add.png find.png remove.png Log Message: First import. --- NEW FILE: add.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: remove.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: find.png --- (This appears to be a binary file; contents omitted.) |
From: Frederic T. <xf...@us...> - 2007-05-16 20:24:29
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14608 Added Files: CompilerHolder.cpp CompilerHolder.h CompilerInfo.cpp CompilerInfo.h CompilerList.cpp CompilerList.h CompilerManager.cpp CompilerManager.h Log Message: First import. --- NEW FILE: CompilerHolder.cpp --- #include <Compiler/CompilerHolder.h> using namespace CQT; CompilerHolder::CompilerHolder(CBM::Compiler *_compiler) { compiler=_compiler; } CBM::Compiler *CompilerHolder::Compiler(void) { return(compiler); } CompilerHolder::~CompilerHolder() { } --- NEW FILE: CompilerHolder.h --- #ifndef H_CQT_COMPILERHOLDER #define H_CQT_COMPILERHOLDER #include <Compiler/Compiler.h> #include <QMetaType> Q_DECLARE_METATYPE(CBM::Compiler*) namespace CQT { class CompilerHolder { private: CBM::Compiler *compiler; protected: CompilerHolder(CBM::Compiler *_compiler); public: virtual CBM::Compiler *Compiler(void); virtual ~CompilerHolder(); }; } #endif --- NEW FILE: CompilerManager.cpp --- #include <Compiler/CompilerManager.h> #include <QHBoxLayout> using namespace CQT; CompilerManager::CompilerManager(QWidget *parent) : QWidget(parent) { QHBoxLayout *lay; lay=new QHBoxLayout; list=new CompilerList; lay->addWidget(list); info=new CompilerInfo; lay->addWidget(info); /* list->setSelection(0); */ /* info=new CompilerInfo(); lay->addWidget(info); */ setLayout(lay); connect(list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), info, SLOT(doSelectionChanged(QListWidgetItem*, QListWidgetItem*)), Qt::QueuedConnection); connect(this, SIGNAL(sigCompilersRefresh()), this, SLOT(doCompilersRefresh()), Qt::QueuedConnection); } void CompilerManager::doCompilersRefresh(void) { // list->compilersRefresh(); } void CompilerManager::doCompilerRegister(CBM::Compiler *_compiler) { list->doCompilerRegister(_compiler); } void CompilerManager::doCompilerUnregister(CBM::Compiler *_compiler) { list->doCompilerUnregister(_compiler); } void CompilerManager::compilersRefresh(void) { emit sigCompilersRefresh(); } CompilerManager::~CompilerManager() { } --- NEW FILE: CompilerManager.h --- #ifndef H_CQT_COMPILERMANAGER #define H_CQT_COMPILERMANAGER #include <Compiler/CompilerList.h> #include <Compiler/CompilerInfo.h> namespace CQT { class CompilerManager : public QWidget { Q_OBJECT private: CompilerList *list; CompilerInfo *info; protected: signals: void sigCompilersRefresh(void); public slots: void doCompilersRefresh(void); void doCompilerRegister(CBM::Compiler *_compiler); void doCompilerUnregister(CBM::Compiler *_compiler); public: CompilerManager(QWidget *parent = 0); virtual void compilersRefresh(void); virtual ~CompilerManager(); }; } #endif --- NEW FILE: CompilerInfo.cpp --- #include <Compiler/CompilerInfo.h> #include <Compiler/CompilerList.h> #include <Compiler/Compiler-Option-Description.h> using namespace CQT; CompilerInfoTab::CompilerInfoTab(QWidget *parent) : QWidget(parent) { lay=new QGridLayout; layIndex=0; setLayout(lay); } QLineEdit *CompilerInfoTab::addInfo(std::string _label, std::string _value) { QLabel *l; QLineEdit *v; l=new QLabel(tr(_label.c_str())); v=new QLineEdit(_value.c_str()); v->setReadOnly(true); lay->addWidget(l, layIndex, 0); lay->addWidget(v, layIndex, 1); layIndex++; return(v); } QGridLayout *CompilerInfoTab::Layout(void) { return(lay); } CompilerInfoTab::~CompilerInfoTab() { } CompilerInfo::CompilerInfo(QWidget *parent) : QTabWidget(parent) { CompilerInfoTab *main = new CompilerInfoTab(); addTab(main, tr("General")); compilerName=main->addInfo(tr("Compiler :").toStdString(), ""); compilerVersion=main->addInfo(tr("Version :").toStdString(), ""); compilerLanguage=main->addInfo(tr("Language :").toStdString(), ""); compilerBinary=main->addInfo(tr("Binary :").toStdString(), ""); CompilerInfoTab *meta = new CompilerInfoTab(); addTab(meta, tr("Meta-informations")); compilerDescriptionDirectory=meta->addInfo(tr("Nearest compatible branch :").toStdString(), ""); compilerOptions=meta->addInfo(tr("Option number :").toStdString(), ""); } void CompilerInfo::doSelectionChanged(QListWidgetItem *current, QListWidgetItem *previous) { CompilerListItem *I = (CompilerListItem*) current; CBM::Compiler *C; if (!I) { compilerName->setText(""); compilerVersion->setText(""); compilerLanguage->setText(""); compilerBinary->setText(""); compilerDescriptionDirectory->setText(""); return; } C=I->Compiler(); compilerName->setText(C->Name().c_str()); compilerVersion->setText(C->Version().c_str()); compilerLanguage->setText(C->Language().c_str()); compilerBinary->setText(C->Binary().c_str()); compilerDescriptionDirectory->setText(C->relativeDescriptionDirectory().c_str()); CBM::CompilerOptionDescriptions *OD = C->OptionDescriptions(); QString n; n.setNum(OD->DescriptionNumber()); compilerOptions->setText(n); // delete(OD); } CompilerInfo::~CompilerInfo() { } --- NEW FILE: CompilerInfo.h --- #ifndef H_CQT_COMPILERINFO #define H_CQT_COMPILERINFO #include <Compiler/CompilerHolder.h> #include <QListWidget> #include <QGridLayout> #include <QLabel> #include <QLineEdit> #include <QTextEdit> #include <QTabWidget> namespace CQT { class CompilerInfoTab : public QWidget { Q_OBJECT private: QGridLayout *lay; int layIndex; protected: public: CompilerInfoTab(QWidget *parent = 0); virtual QLineEdit *addInfo(std::string _label, std::string _value); virtual QGridLayout *Layout(void); virtual ~CompilerInfoTab(); }; class CompilerInfo : public QTabWidget { Q_OBJECT private: QLineEdit *compilerName; QLineEdit *compilerVersion; QLineEdit *compilerLanguage; QLineEdit *compilerBinary; QLineEdit *compilerDescriptionDirectory; QLineEdit *compilerOptions; protected: protected slots: virtual void doSelectionChanged(QListWidgetItem *current, QListWidgetItem *previous); public: CompilerInfo(QWidget *parent = 0); virtual ~CompilerInfo(); }; } #endif --- NEW FILE: CompilerList.h --- #ifndef H_CQT_COMPILERLIST #define H_CQT_COMPILERLIST #include <QListWidget> #include <QMenu> #include <QContextMenuEvent> #include <Compiler/CompilerHolder.h> namespace CQT { class CompilerListContextMenuEvent : public QContextMenuEvent, public CompilerHolder { public: CompilerListContextMenuEvent(Reason reason, const QPoint &globalPos, CBM::Compiler *_compiler); virtual ~CompilerListContextMenuEvent(); }; class CompilerListContextMenu : public QMenu, public CompilerHolder { Q_OBJECT protected slots: void compilerUnregister(void); public: CompilerListContextMenu(CBM::Compiler *_compiler); virtual ~CompilerListContextMenu(); }; class CompilerListItem : public QListWidgetItem, public CompilerHolder { public: CompilerListItem(CBM::Compiler *_compiler); virtual ~CompilerListItem(); }; class CompilerList : public QListWidget { Q_OBJECT private: protected: virtual void contextMenuEvent(QContextMenuEvent *event); signals: void sigCompilersRefresh(void); public slots: void doCompilersRefresh(void); void doCompilerRegister(CBM::Compiler *_compiler); void doCompilerUnregister(CBM::Compiler *_compiler); public: CompilerList(QWidget *parent = 0); virtual void compilersRefresh(void); virtual ~CompilerList(); }; } #endif --- NEW FILE: CompilerList.cpp --- #include <QLabel> #include <main.h> #include <Compiler/CompilerList.h> #include <System/System.h> using namespace CQT; CompilerListContextMenuEvent::CompilerListContextMenuEvent(Reason reason, const QPoint &globalPos, CBM::Compiler *_compiler) : QContextMenuEvent(reason, globalPos), CompilerHolder(_compiler) { } CompilerListContextMenuEvent::~CompilerListContextMenuEvent() { } CompilerListContextMenu::CompilerListContextMenu(CBM::Compiler *_compiler) : QMenu("Compiler management"), CompilerHolder(_compiler) { addAction(QIcon(":/icons/add.png"), "Add", App, SLOT(doCompilerRegisterManual())); if (_compiler) addAction(QIcon(":/icons/remove.png"), "Remove", this, SLOT(compilerUnregister())); addAction(QIcon(":/icons/find.png"), "Auto-detect", App, SLOT(doCompilerAutodetect())); } void CompilerListContextMenu::compilerUnregister(void) { App->compilerUnregister(Compiler()); } CompilerListContextMenu::~CompilerListContextMenu() { } CompilerListItem::CompilerListItem(CBM::Compiler *_compiler) : QListWidgetItem(_compiler->Name().c_str()), CompilerHolder(_compiler) { /* if (Compiler()->getStatus()<CBM::Compiler::Preconfigured) setIcon(QIcon(":/icons/error.png")); else */ setIcon(QIcon(":/icons/success.png")); } CompilerListItem::~CompilerListItem() { } CompilerList::CompilerList(QWidget *parent) : QListWidget(parent) { setContextMenuPolicy(Qt::DefaultContextMenu); connect(this, SIGNAL(sigCompilersRefresh()), this, SLOT(doCompilersRefresh()), Qt::QueuedConnection); compilersRefresh(); } void CompilerList::compilersRefresh(void) { emit sigCompilersRefresh(); } void CompilerList::contextMenuEvent(QContextMenuEvent *event) { CompilerListItem *I = (CompilerListItem*) currentItem(); CBM::Compiler *C = 0; if (I) C=I->Compiler(); CompilerListContextMenu m(C); m.exec(event->globalPos()); } void CompilerList::doCompilersRefresh(void) { /* int i, n; CBM::Compiler *P; int psel = currentRow(); clear(); setContextMenuPolicy(Qt::DefaultContextMenu); n=CBM::cbmSystem->compilerNumber(); for(i=0; i<n; i++) { P=CBM::cbmSystem->Compiler(i); addItem(new CompilerListItem(P)); } sortItems(); setCurrentRow(psel); */ } void CompilerList::doCompilerRegister(CBM::Compiler *_compiler) { addItem(new CompilerListItem(_compiler)); } void CompilerList::doCompilerUnregister(CBM::Compiler *_compiler) { int i, n = count(); CompilerListItem *I; for(i=0;i<n;i++) { I=(CompilerListItem*) item(i); if (I->Compiler()->Binary()==_compiler->Binary()) { I=(CompilerListItem*) takeItem(i); delete(I); break; } } } CompilerList::~CompilerList() { } |
From: Frederic T. <xf...@us...> - 2007-05-16 20:24:00
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14237/Compiler Log Message: Directory /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler added to the repository |
From: Frederic T. <xf...@us...> - 2007-05-16 16:12:15
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/icons In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15012/icons Added Files: admin.png arrow-right.png browse.png downloads.png error.png icons.qrc led-green.png led-yellow.png package.png success.png tip.png trash.png www.png Log Message: First import. --- NEW FILE: www.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: led-green.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: led-yellow.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: package.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: success.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: trash.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icons.qrc --- <RCC> <qresource prefix="/icons" > <file>admin.png</file> <file>arrow-right.png</file> <file>browse.png</file> <file>downloads.png</file> <file>error.png</file> <file>led-green.png</file> <file>led-yellow.png</file> <file>package.png</file> <file>success.png</file> <file>tip.png</file> <file>trash.png</file> <file>www.png</file> </qresource> </RCC> --- NEW FILE: browse.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: downloads.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: arrow-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: error.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: admin.png --- (This appears to be a binary file; contents omitted.) |
From: Frederic T. <xf...@us...> - 2007-05-16 16:12:13
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Status In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15012/Status Added Files: Status.cpp Status.h Log Message: First import. --- NEW FILE: Status.h --- #ifndef H_CQT_STATUS #define H_CQT_STATUS #include <UI/UI.h> #include <QWidget> #include <QPixmap> #include <QLabel> #include <QGridLayout> #include <QProgressBar> #include <Package/PackageHolder.h> Q_DECLARE_METATYPE(CBM::UI::State) namespace CQT { class StatusWidget : public QWidget, public CBM::UI { private: Q_OBJECT QLabel *actionLabel; QProgressBar *progressBar; protected: QGridLayout *layout; signals: virtual void sigProgressInit(QString what); virtual void sigProgress(float _p); virtual void sigProgressDone(void); virtual void sigUninstall(CBM::UI::State state); protected slots: virtual void progressInit(QString what); virtual void progress(float _p); virtual void progressDone(void); virtual void uninstall(CBM::UI::State state); public: StatusWidget(QWidget *parent = 0); public: virtual void ProgressInit(std::string what); virtual void Progress(float _p); virtual void ProgressDone(void); virtual int Information(CBM::UI::Info type, std::string msg, CBM::UI::State state, float _progress = 0); public: virtual ~StatusWidget(); }; class StatusLedText : public QWidget { private: Q_OBJECT public: typedef enum { Waiting, Running, OK, KO } LedColor; private: QPixmap pixmapWaiting; QPixmap pixmapOK; QPixmap pixmapKO; QPixmap pixmapRunning; LedColor ledColor; QLabel *icon; QLabel *label; QPixmap *pixmapObject(LedColor _color); public: StatusLedText(std::string _label, LedColor _color = Waiting, QWidget *_parent = 0); public slots: virtual void changeColor(LedColor _color); public: virtual ~StatusLedText(); }; class StatusInstall : public StatusWidget, public PackageHolder { private: Q_OBJECT StatusLedText *ledDownloaded; StatusLedText *ledChecksum; StatusLedText *ledExtracted; StatusLedText *ledPatched; StatusLedText *ledPreconfigured; int ledIndex; StatusLedText *ledCreate(std::string _label, int _done); CQT::StatusLedText::LedColor colorFor(CBM::UI::State state); signals: void sigDownload(CBM::UI::State state, float progress); void sigChecksum(CBM::UI::State state); void sigExtract(CBM::UI::State state); void sigPatch(CBM::UI::State state); void sigPreconfigure(CBM::UI::State state, float progress); protected slots: void download(CBM::UI::State state, float _progress); void checksum(CBM::UI::State state); void extract(CBM::UI::State state); void patch(CBM::UI::State state); void preconfigure(CBM::UI::State state, float _progress); public: StatusInstall(CBM::Package *_package, QWidget *parent = 0); // virtual void ProgressDone(void); virtual int Information(CBM::UI::Info type, std::string msg, CBM::UI::State state, float _progress = 0); ~StatusInstall(); }; } #endif --- NEW FILE: Status.cpp --- #include <Status/Status.h> #include <QGridLayout> #include <QHBoxLayout> #include <QIcon> #include <math.h> using namespace CQT; StatusWidget::StatusWidget(QWidget *parent) : QWidget(parent), CBM::UI() { layout = new QGridLayout; actionLabel=new QLabel(tr("")); layout->addWidget(actionLabel, 0, 0, 1, 2); progressBar=new QProgressBar(); progressBar->setRange(0,100); layout->addWidget(progressBar, 1, 0, 1, 2); setLayout(layout); setWindowTitle(tr("Progress")); // setWindowModality(Qt::ApplicationModal); progressBar->setRange(0,100); connect(this, SIGNAL(sigProgressInit(QString)), this, SLOT(progressInit(QString)), Qt::QueuedConnection); connect(this, SIGNAL(sigProgress(float)), this, SLOT(progress(float)), Qt::QueuedConnection); connect(this, SIGNAL(sigProgressDone()), this, SLOT(progressDone()), Qt::QueuedConnection); connect(this, SIGNAL(sigUninstall(CBM::UI::State)), this, SLOT(uninstall(CBM::UI::State)), Qt::QueuedConnection); } void StatusWidget::progressInit(QString what) { actionLabel->setText(what); progressBar->setValue(0); } void StatusWidget::progress(float _p) { int r = (int) round(_p); progressBar->setValue(r); } void StatusWidget::progressDone(void) { progressBar->setValue(100); } void StatusWidget::ProgressInit(std::string what) { emit sigProgressInit(what.c_str()); } void StatusWidget::Progress(float _p) { emit sigProgress(_p); } void StatusWidget::ProgressDone(void) { emit sigProgressDone(); } void StatusWidget::uninstall(CBM::UI::State state) { actionLabel->setText("Uninstalling package..."); } int StatusWidget::Information(CBM::UI::Info type, std::string msg, CBM::UI::State state, float _progress) { switch(type) { case PackageUninstall: emit sigUninstall(state); break; default: break; } return(0); } StatusWidget::~StatusWidget() { } StatusLedText::StatusLedText(std::string _label, LedColor _color, QWidget *_parent) : QWidget(_parent) { QHBoxLayout *lay = new QHBoxLayout; QIcon I(":/icons/led-yellow.png"); pixmapWaiting=I.pixmap(12); QIcon I2(":/icons/success.png"); pixmapOK=I2.pixmap(12); QIcon I3(":/icons/error.png"); pixmapKO=I3.pixmap(12); QIcon I4(":/icons/arrow-right.png"); pixmapRunning=I4.pixmap(12); icon=new QLabel(); icon->setPixmap(*pixmapObject(_color)); lay->addWidget(icon); icon->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); label=new QLabel(_label.c_str()); lay->addWidget(label); label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); lay->setMargin(2); setLayout(lay); } QPixmap *StatusLedText::pixmapObject(LedColor _color) { switch(_color) { case Waiting: return(&pixmapWaiting); break; case Running: return(&pixmapRunning); break; case OK: return(&pixmapOK); break; case KO: return(&pixmapKO); break; } return(0); } void StatusLedText::changeColor(LedColor _color) { icon->setPixmap(*pixmapObject(_color)); } StatusLedText::~StatusLedText() { } StatusInstall::StatusInstall(CBM::Package *_package, QWidget *parent) : StatusWidget(parent), PackageHolder(_package) { std::string tit = "Installing package "; tit+=Package()->Name(); ProgressInit(tit); ledIndex=1; ledDownloaded=ledCreate("Downloading", (Package()->getStatus()>=CBM::Package::Downloaded)); ledChecksum=ledCreate("Checksum", (Package()->getStatus()>=CBM::Package::Downloaded)); ledExtracted=ledCreate("Extracting", (Package()->getStatus()>=CBM::Package::Extracted)); ledPatched=0; if (Package()->hasPatch()) { ledPatched=ledCreate("Patching", (Package()->getStatus()>=CBM::Package::Patched)); } ledPreconfigured=ledCreate("Preconfiguring", (Package()->getStatus()>=CBM::Package::Preconfigured)); connect(this, SIGNAL(sigDownload(CBM::UI::State, float)), this, SLOT(download(CBM::UI::State, float)), Qt::QueuedConnection); connect(this, SIGNAL(sigChecksum(CBM::UI::State)), this, SLOT(checksum(CBM::UI::State)), Qt::QueuedConnection); connect(this, SIGNAL(sigExtract(CBM::UI::State)), this, SLOT(extract(CBM::UI::State)), Qt::QueuedConnection); connect(this, SIGNAL(sigPatch(CBM::UI::State)), this, SLOT(patch(CBM::UI::State)), Qt::QueuedConnection); connect(this, SIGNAL(sigPreconfigure(CBM::UI::State, float)), this, SLOT(preconfigure(CBM::UI::State, float)), Qt::QueuedConnection); } StatusLedText *StatusInstall::ledCreate(std::string _label, int _done) { StatusLedText *R; ledIndex++; R = new StatusLedText(_label, _done ? StatusLedText::OK : StatusLedText::Waiting); layout->addWidget(R, ledIndex, 1, 1, 1, Qt::AlignLeft); return(R); } CQT::StatusLedText::LedColor StatusInstall::colorFor(CBM::UI::State state) { switch(state) { case CBM::UI::Start: case CBM::UI::Running: return(StatusLedText::Running); break; case CBM::UI::OK: return(StatusLedText::OK); break; case CBM::UI::Failed: return(StatusLedText::KO); break; default: return(StatusLedText::Waiting); } return(StatusLedText::Waiting); } void StatusInstall::download(CBM::UI::State state, float _progress) { ledDownloaded->changeColor(colorFor(state)); if (_progress>0) Progress(_progress); } void StatusInstall::checksum(CBM::UI::State state) { ledChecksum->changeColor(colorFor(state)); } void StatusInstall::extract(CBM::UI::State state) { ledExtracted->changeColor(colorFor(state)); } void StatusInstall::patch(CBM::UI::State state) { ledPatched->changeColor(colorFor(state)); } void StatusInstall::preconfigure(CBM::UI::State state, float _progress) { ledPreconfigured->changeColor(colorFor(state)); if (_progress>0) Progress(_progress); } /* void StatusInstall::ProgressDone(void) { StatusWidget::ProgressDone(); emit sigDownloaded(); } */ int StatusInstall::Information(CBM::UI::Info type, std::string msg, CBM::UI::State state, float _progress) { switch(type) { case Checksum: emit sigChecksum(state); break; case PackageDownload: emit sigDownload(state, _progress); break; case PackageExtract: emit sigExtract(state); break; case PackagePatch: emit sigPatch(state); break; case PackagePreconfigure: if (_progress==0) Progress(0); emit sigPreconfigure(state, _progress); break; default: break; } return(0); } StatusInstall::~StatusInstall() { } |
From: Frederic T. <xf...@us...> - 2007-05-16 16:12:13
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15012 Added Files: compbenchmarks-ui-qt4.pro main.cpp main.h Log Message: First import. --- NEW FILE: main.cpp --- #include <main.h> #include <config.h> #include <libcompbenchmarks.h> #include <Status/Status.h> using namespace CQT; Application *CQT::App = 0; PackageInstallThread::PackageInstallThread(CBM::Package *_package, QObject *parent) : QThread(parent), PackageHolder(_package) { } void PackageInstallThread::run() { Package()->Install(); App->packagesRefresh(); if (parent()) parent()->deleteLater(); } PackageInstallThread::~PackageInstallThread() { } PackageUninstallThread::PackageUninstallThread(CBM::Package *_package, QObject *parent) : QThread(parent), PackageHolder(_package) { } void PackageUninstallThread::run() { Package()->Uninstall(); App->packagesRefresh(); if (parent()) parent()->deleteLater(); } PackageUninstallThread::~PackageUninstallThread() { } Application::Application(int &argc, char **argv) : QApplication(argc, argv) { App=this; qRegisterMetaType<CBM::UI::State>("CBM::UI::State"); qRegisterMetaType<CBM::Package*>("CBM::Package*"); packageManager=new PackageManager; connect(this, SIGNAL(sigPackageInstallation(CBM::Package*)), this, SLOT(doPackageInstallation(CBM::Package*)), Qt::QueuedConnection); connect(this, SIGNAL(sigPackageUninstallation(CBM::Package*)), this, SLOT(doPackageUninstallation(CBM::Package*)), Qt::QueuedConnection); connect(this, SIGNAL(sigPackagesRefresh()), this, SLOT(doPackagesRefresh()), Qt::QueuedConnection); } void Application::doPackagesRefresh(void) { packageManager->packagesRefresh(); } void Application::packagesRefresh(void) { emit sigPackagesRefresh(); } void Application::doPackageInstallation(CBM::Package *_package) { StatusWidget *W; PackageInstallThread *T; W=new StatusInstall(_package); W->show(); T=new PackageInstallThread(_package, W); T->start(); } void Application::doPackageUninstallation(CBM::Package *_package) { StatusWidget *W; PackageUninstallThread *T; W=new StatusWidget(0); W->show(); T=new PackageUninstallThread(_package, W); T->start(); } void Application::packageInstallation(CBM::Package *_package) { emit sigPackageInstallation(_package); } void Application::packageUninstallation(CBM::Package *_package) { emit sigPackageUninstallation(_package); } Application::~Application() { delete(packageManager); } int main(int argc, char **argv) { int result; Application app(argc, argv); CBM_SYSTEM sys; sys.init(); /* StatusInstall *W; W=new StatusInstall(sys.Package("gzip")); W->Progress(28); W->show(); */ /* PackageList P; P.show(); */ /* StatusWidget B(0); B.start("something", 100); B.show(); */ app.packageManager->show(); result=app.exec(); sys.done(); return(result); } --- NEW FILE: compbenchmarks-ui-qt4.pro --- ###################################################################### # Automatically generated by qmake (2.01a) Mon May 14 17:34:14 2007 ###################################################################### TEMPLATE = app TARGET = compbenchmarks-ui-qt4 DEPENDPATH += . Package Status INCLUDEPATH += . ../libcompbenchmarks ../testing/libcompbenchmarks # Input HEADERS += Package/PackageHolder.h Package/PackageInfo.h Package/PackageList.h Package/PackageManager.h Status/Status.h main.h # FORMS += tests-designer/checkItem.ui tests-designer/test.ui SOURCES += Package/PackageHolder.cpp Package/PackageInfo.cpp Package/PackageList.cpp Package/PackageManager.cpp Status/Status.cpp main.cpp LIBS += -L../testing/libcompbenchmarks/.libs -lcompbenchmarks RESOURCES += icons/icons.qrc --- NEW FILE: main.h --- #ifndef H_CQT_APPLICATION #define H_CQT_APPLICATION #include <QApplication> #include <QWidget> #include <QLabel> #include <QProgressBar> #include <QThread> #include <Package/PackageManager.h> namespace CQT { class PackageInstallThread : public QThread, public PackageHolder { Q_OBJECT protected: public: PackageInstallThread(CBM::Package *_package, QObject *parent = 0); virtual void run(); virtual ~PackageInstallThread(); }; class PackageUninstallThread : public QThread, public PackageHolder { Q_OBJECT protected: public: PackageUninstallThread(CBM::Package *_package, QObject *parent = 0); virtual void run(); virtual ~PackageUninstallThread(); }; class Application : public QApplication { private: Q_OBJECT public: PackageManager *packageManager; protected: protected slots: void doPackagesRefresh(void); signals: void sigPackageInstallation(CBM::Package *_package); void sigPackageUninstallation(CBM::Package *_package); void sigPackagesRefresh(); public slots: void doPackageInstallation(CBM::Package *_package); void doPackageUninstallation(CBM::Package *_package); public: Application(int &argc, char **argv); virtual void packageInstallation(CBM::Package *_package); virtual void packageUninstallation(CBM::Package *_package); virtual void packagesRefresh(void); virtual ~Application(); }; extern "C++" Application *App; } #endif |
From: Frederic T. <xf...@us...> - 2007-05-16 16:12:12
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Package In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15012/Package Added Files: PackageHolder.cpp PackageHolder.h PackageInfo.cpp PackageInfo.h PackageList.cpp PackageList.h PackageManager.cpp PackageManager.h Log Message: First import. --- NEW FILE: PackageManager.cpp --- #include <Package/PackageManager.h> #include <QHBoxLayout> using namespace CQT; PackageManager::PackageManager(QWidget *parent) : QWidget(parent) { QHBoxLayout *lay; lay=new QHBoxLayout; list=new PackageList; lay->addWidget(list); /* list->setSelection(0); */ info=new PackageInfo(); lay->addWidget(info); setLayout(lay); connect(list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), info, SLOT(doSelectionChanged(QListWidgetItem*, QListWidgetItem*)), Qt::QueuedConnection); connect(this, SIGNAL(sigPackagesRefresh()), this, SLOT(doPackagesRefresh()), Qt::QueuedConnection); } void PackageManager::doPackagesRefresh(void) { list->packagesRefresh(); } void PackageManager::packagesRefresh(void) { emit sigPackagesRefresh(); } PackageManager::~PackageManager() { } --- NEW FILE: PackageInfo.h --- #ifndef H_CQT_PACKAGEINFO #define H_CQT_PACKAGEINFO #include <Package/PackageHolder.h> #include <QListWidget> #include <QGridLayout> #include <QLabel> #include <QLineEdit> #include <QTextEdit> #include <QTabWidget> namespace CQT { class PackageInfoTab : public QWidget { Q_OBJECT private: QGridLayout *lay; int layIndex; protected: public: PackageInfoTab(QWidget *parent = 0); virtual QLineEdit *addInfo(std::string _label, std::string _value); virtual QGridLayout *Layout(void); virtual ~PackageInfoTab(); }; class PackageInfo : public QTabWidget { Q_OBJECT private: QLineEdit *packageName; QLineEdit *packageVersion; QLineEdit *packageLanguage; QLineEdit *packageAuthors; QLineEdit *packageLicense; QTextEdit *packageComments; QLineEdit *packageStatus; QLineEdit *packagePatch; QLineEdit *packageTestsuite; QLineEdit *packageBenchmarks; QLineEdit *packageHomepage; QLineEdit *packageDownloadURL; protected: protected slots: virtual void doSelectionChanged(QListWidgetItem *current, QListWidgetItem *previous); public: PackageInfo(QWidget *parent = 0); virtual ~PackageInfo(); }; } #endif --- NEW FILE: PackageList.cpp --- #include <QLabel> #include <main.h> #include <Package/PackageList.h> #include <System/System.h> using namespace CQT; PackageListContextMenuEvent::PackageListContextMenuEvent(Reason reason, const QPoint &globalPos, CBM::Package *_package) : QContextMenuEvent(reason, globalPos), PackageHolder(_package) { } PackageListContextMenuEvent::~PackageListContextMenuEvent() { } PackageListContextMenu::PackageListContextMenu(CBM::Package *_package) : QMenu("Package management"), PackageHolder(_package) { if (Package()->getStatus()<CBM::Package::Preconfigured) { addAction(QIcon(":/icons/downloads.png"), "Install", this, SLOT(packageInstall())); } if (Package()->getStatus()>CBM::Package::Unknown) { addAction(QIcon(":/icons/trash.png"), "Uninstall", this, SLOT(packageUninstall())); } } void PackageListContextMenu::packageInstall(void) { App->packageInstallation(Package()); } void PackageListContextMenu::packageUninstall(void) { App->packageUninstallation(Package()); } PackageListContextMenu::~PackageListContextMenu() { } PackageListItem::PackageListItem(CBM::Package *_package) : QListWidgetItem(_package->Name().c_str()), PackageHolder(_package) { if (Package()->getStatus()<CBM::Package::Preconfigured) setIcon(QIcon(":/icons/error.png")); else setIcon(QIcon(":/icons/success.png")); } PackageListItem::~PackageListItem() { } PackageList::PackageList(QWidget *parent) : QListWidget(parent) { setContextMenuPolicy(Qt::DefaultContextMenu); connect(this, SIGNAL(sigPackagesRefresh()), this, SLOT(doPackagesRefresh()), Qt::QueuedConnection); packagesRefresh(); } void PackageList::packagesRefresh(void) { emit sigPackagesRefresh(); } void PackageList::contextMenuEvent(QContextMenuEvent *event) { PackageListItem *I = (PackageListItem*) currentItem(); CBM::Package *P = 0; if (I) P=I->Package(); if (P) { PackageListContextMenu m(P); m.exec(event->globalPos()); } } long PackageList::bytesToDownload(QList<CBM::Package*> &list) { int n = list.size(); int i; CBM::Package *P; long result = 0; for(i=0; i<n; i++) { P=list[i]; if (P->getStatus()<CBM::Package::Downloaded) { result+=P->Size(); } } return(result); } void PackageList::doPackagesRefresh(void) { int i, n; CBM::Package *P; int psel = currentRow(); clear(); setContextMenuPolicy(Qt::DefaultContextMenu); n=CBM::cbmSystem->packageNumber(); for(i=0; i<n; i++) { P=CBM::cbmSystem->Package(i); addItem(new PackageListItem(P)); } sortItems(); setCurrentRow(psel); } PackageList::~PackageList() { } --- NEW FILE: PackageList.h --- #ifndef H_CQT_PACKAGELIST #define H_CQT_PACKAGELIST #include <QListWidget> #include <QMenu> #include <QContextMenuEvent> #include <Package/PackageHolder.h> namespace CQT { class PackageListContextMenuEvent : public QContextMenuEvent, public PackageHolder { public: PackageListContextMenuEvent(Reason reason, const QPoint &globalPos, CBM::Package *_package); virtual ~PackageListContextMenuEvent(); }; class PackageListContextMenu : public QMenu, public PackageHolder { Q_OBJECT protected slots: void packageInstall(void); void packageUninstall(void); public: PackageListContextMenu(CBM::Package *_package); virtual ~PackageListContextMenu(); }; class PackageListItem : public QListWidgetItem, public PackageHolder { public: PackageListItem(CBM::Package *_package); virtual ~PackageListItem(); }; class PackageList : public QListWidget { Q_OBJECT private: protected: virtual void contextMenuEvent(QContextMenuEvent *event); virtual long bytesToDownload(QList<CBM::Package*> &list); signals: void sigPackagesRefresh(void); public slots: void doPackagesRefresh(void); public: PackageList(QWidget *parent = 0); virtual void packagesRefresh(void); virtual ~PackageList(); }; } #endif --- NEW FILE: PackageHolder.h --- #ifndef H_CQT_PACKAGEHOLDER #define H_CQT_PACKAGEHOLDER #include <Benchmark/Package.h> #include <QMetaType> Q_DECLARE_METATYPE(CBM::Package*) namespace CQT { class PackageHolder { private: CBM::Package *package; protected: PackageHolder(CBM::Package *_package); public: virtual CBM::Package *Package(void); virtual ~PackageHolder(); }; } #endif --- NEW FILE: PackageHolder.cpp --- #include <Package/PackageHolder.h> using namespace CQT; PackageHolder::PackageHolder(CBM::Package *_package) { package=_package; } CBM::Package *PackageHolder::Package(void) { return(package); } PackageHolder::~PackageHolder() { } --- NEW FILE: PackageManager.h --- #ifndef H_CQT_PACKAGEMANAGER #define H_CQT_PACKAGEMANAGER #include <Package/PackageList.h> #include <Package/PackageInfo.h> namespace CQT { class PackageManager : public QWidget { Q_OBJECT private: PackageList *list; PackageInfo *info; protected: signals: void sigPackagesRefresh(void); public slots: void doPackagesRefresh(void); public: PackageManager(QWidget *parent = 0); virtual void packagesRefresh(void); // virtual void packageSelected(CBM::Package *_package); virtual ~PackageManager(); }; } #endif --- NEW FILE: PackageInfo.cpp --- #include <Package/PackageInfo.h> #include <Package/PackageList.h> using namespace CQT; PackageInfoTab::PackageInfoTab(QWidget *parent) : QWidget(parent) { lay=new QGridLayout; layIndex=0; setLayout(lay); } QLineEdit *PackageInfoTab::addInfo(std::string _label, std::string _value) { QLabel *l; QLineEdit *v; l=new QLabel(tr(_label.c_str())); v=new QLineEdit(_value.c_str()); v->setReadOnly(true); lay->addWidget(l, layIndex, 0); lay->addWidget(v, layIndex, 1); layIndex++; return(v); } QGridLayout *PackageInfoTab::Layout(void) { return(lay); } PackageInfoTab::~PackageInfoTab() { } PackageInfo::PackageInfo(QWidget *parent) : QTabWidget(parent) { PackageInfoTab *main = new PackageInfoTab(); addTab(main, "General"); packageName=main->addInfo("Package :", ""); packageVersion=main->addInfo("Version :", ""); packageLanguage=main->addInfo("Language :", ""); packageAuthors=main->addInfo("Author(s) :", ""); packageLicense=main->addInfo("License :", ""); PackageInfoTab *comments = new PackageInfoTab(); addTab(comments, "Comments"); packageComments = new QTextEdit(""); packageComments->setReadOnly(true); comments->Layout()->addWidget(packageComments, 0, 0); PackageInfoTab *meta = new PackageInfoTab(); addTab(meta, "Meta-informations"); packageStatus=meta->addInfo("Status :", ""); packagePatch=meta->addInfo("Need patch :", ""); packageTestsuite=meta->addInfo("Embbeded testsuite :", ""); packageBenchmarks=meta->addInfo("Embbeded benchmarks :", ""); PackageInfoTab *links = new PackageInfoTab(); addTab(links, "Links"); packageHomepage=links->addInfo("Home page :", ""); packageDownloadURL=links->addInfo("Download URL :", ""); } void PackageInfo::doSelectionChanged(QListWidgetItem *current, QListWidgetItem *previous) { PackageListItem *I = (PackageListItem*) current; CBM::Package *P; if (!I) return; P=I->Package(); packageName->setText(P->Name().c_str()); packageVersion->setText(P->Version().c_str()); packageLanguage->setText(P->language().c_str()); packageAuthors->setText(P->author().c_str()); packageLicense->setText(P->license().c_str()); packageComments->setText(P->Comments().c_str()); packageStatus->setText(P->getStatusStr().c_str()); packagePatch->setText(P->hasPatch() ? "Yes" : "No"); packageTestsuite->setText(P->hasTest() ? "Yes" : "No"); QString n; n.setNum(P->benchmarkNumber()); packageBenchmarks->setText(n); packageHomepage->setText(P->homePage().c_str()); packageDownloadURL->setText(P->downloadURL().c_str()); } PackageInfo::~PackageInfo() { } |
From: Frederic T. <xf...@us...> - 2007-05-16 16:10:17
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Package In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14114/Package Log Message: Directory /cvsroot/compbench/CompBenchmarks++/Qt-4/Package added to the repository |
From: Frederic T. <xf...@us...> - 2007-05-16 16:10:16
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/icons In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14114/icons Log Message: Directory /cvsroot/compbench/CompBenchmarks++/Qt-4/icons added to the repository |
From: Frederic T. <xf...@us...> - 2007-05-16 16:10:15
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Status In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14114/Status Log Message: Directory /cvsroot/compbench/CompBenchmarks++/Qt-4/Status added to the repository |
From: Frederic T. <xf...@us...> - 2007-05-16 16:09:45
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14007/Qt-4 Log Message: Directory /cvsroot/compbench/CompBenchmarks++/Qt-4 added to the repository |
From: Frederic T. <xf...@us...> - 2007-05-16 12:31:01
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17489 Modified Files: System.cpp Log Message: Improved UI API. Index: System.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System/System.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** System.cpp 16 May 2007 09:46:19 -0000 1.14 --- System.cpp 16 May 2007 12:06:39 -0000 1.15 *************** *** 133,147 **** ! msg="Downloading "; ! msg+=url; ! ! cbmUI->ProgressInit(msg); T.Start(); while (!T.Terminated()) { sleep(1); ! cbmUI->Progress(T.Progress()); } ! cbmUI->ProgressDone(); return(1); } --- 133,149 ---- ! cbmUI->Information(CBM::UI::PackageDownload, ! url); ! T.Start(); while (!T.Terminated()) { sleep(1); ! cbmUI->Information(CBM::UI::PackageDownload, ! CBM::UI::Running, ! T.Progress()); } ! cbmUI->Information(CBM::UI::PackageDownload, ! CBM::UI::OK); return(1); } |
From: Frederic T. <xf...@us...> - 2007-05-16 12:07:13
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17854 Modified Files: Benchmark-xZIP.cpp Benchmark-xZIP.h Log Message: Improved UI API. Threaded preConfigure(); Index: Benchmark-xZIP.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark-xZIP.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Benchmark-xZIP.cpp 7 May 2007 20:06:15 -0000 1.3 --- Benchmark-xZIP.cpp 16 May 2007 12:07:09 -0000 1.4 *************** *** 9,12 **** --- 9,13 ---- #include <Benchmark/Benchmark-xZIP.h> #include <System/System.h> + #include <UI/UI.h> #include <fstream> *************** *** 14,41 **** using namespace CBM; ! PackagexZIP::PackagexZIP(CBM::System *_system) ! : PackageAutotools(_system) { } ! int PackagexZIP::preConfigure(int _force) { - std::string fileName; - std::ofstream OUT; int n = 12 * 1024 * 1024; ! fileName+=localAbsoluteDirectory(); ! fileName+="/Compbenchmarks.dat"; ! ! OUT.open(fileName.c_str(), std::ios::out); ! /* !!! */ while (n--) { OUT << std::hex << n; } OUT.close(); return(1); } PackagexZIP::~PackagexZIP() { --- 15,75 ---- using namespace CBM; ! PackagexZIPPreconfigureThread::PackagexZIPPreconfigureThread(std::string _filename) ! : ThreadAction() { + filename=_filename; } ! void PackagexZIPPreconfigureThread::routine(void) { int n = 12 * 1024 * 1024; + std::ofstream OUT; ! OUT.open(filename.c_str(), std::ios::out); while (n--) { OUT << std::hex << n; } OUT.close(); + } + + float PackagexZIPPreconfigureThread::Progress(void) + { + float expect = 74378992; + int now = cbmSystem->fileSize(filename); + + return( (((float)now)*100)/expect ); + } + + PackagexZIPPreconfigureThread::~PackagexZIPPreconfigureThread() + { + } + + + PackagexZIP::PackagexZIP(CBM::System *_system) + : PackageAutotools(_system) + { + } + int PackagexZIP::preConfigure(int _force) + { + std::string fileName; + + fileName+=localAbsoluteDirectory(); + fileName+="/Compbenchmarks.dat"; + + PackagexZIPPreconfigureThread T(fileName); + T.Start(); + + while(!T.Terminated()) { + sleep(1); + cbmUI->Information(CBM::UI::PackagePreconfigure, + CBM::UI::Running, + T.Progress()); + } + return(1); } + PackagexZIP::~PackagexZIP() { Index: Benchmark-xZIP.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark-xZIP.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Benchmark-xZIP.h 22 Jan 2007 18:21:47 -0000 1.1 --- Benchmark-xZIP.h 16 May 2007 12:07:09 -0000 1.2 *************** *** 11,16 **** --- 11,32 ---- #include <Benchmark/Benchmark-Autotools.h> + #include <Base/Thread.h> namespace CBM { + class PackagexZIPPreconfigureThread : public ThreadAction { + private: + std::string filename; + + protected: + virtual void routine(void); + + public: + PackagexZIPPreconfigureThread(std::string _filename); + + virtual float Progress(void); + + virtual ~PackagexZIPPreconfigureThread(); + }; + /** \brief Defines an abstract package based on ZIP utilities. * |
From: Frederic T. <xf...@us...> - 2007-05-16 12:07:09
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17472 Modified Files: Benchmark.cpp Package.cpp Log Message: Improved UI API. Index: Package.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Package.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Package.cpp 16 May 2007 09:45:41 -0000 1.12 --- Package.cpp 16 May 2007 12:06:17 -0000 1.13 *************** *** 203,209 **** info+=Version(); - cbmUI->Information(CBM::UI::BenchDownload, - info); - try { system->download(downloadURL(), --- 203,206 ---- *************** *** 215,231 **** if (cbmSystem->fileExists(localFile)) { expected_md5=expectedMD5(); md5=system->md5File(localFile); if (expected_md5==md5) { ! cbmUI->Information(CBM::UI::ChecksumOK, ! localFile); storeStatus(Downloaded); return(1); } else { ! cbmUI->Information(CBM::UI::ChecksumFailed, ! localFile); ! system->unlink((char*) localFile.c_str()); info="Unsuccesfull download "; --- 212,231 ---- if (cbmSystem->fileExists(localFile)) { + + cbmUI->Information(CBM::UI::Checksum, + localFile); + expected_md5=expectedMD5(); md5=system->md5File(localFile); if (expected_md5==md5) { ! cbmUI->Information(CBM::UI::Checksum, ! CBM::UI::OK); storeStatus(Downloaded); return(1); } else { ! cbmUI->Information(CBM::UI::Checksum, ! CBM::UI::Failed); system->unlink((char*) localFile.c_str()); info="Unsuccesfull download "; *************** *** 237,240 **** --- 237,243 ---- } } else { + cbmUI->Information(CBM::UI::Checksum, + CBM::UI::Failed); + info="Can't download "; info+=downloadURL(); *************** *** 257,268 **** } ! cbmUI->Information(CBM::UI::BenchExtract, Name()); r=extract(_force); ! if (r) storeStatus(Extracted); ! else { std::string info; info="Error extracting "; --- 260,276 ---- } ! cbmUI->Information(CBM::UI::PackageExtract, Name()); r=extract(_force); ! if (r) { storeStatus(Extracted); ! cbmUI->Information(CBM::UI::PackageExtract, ! CBM::UI::OK); ! ! } else { ! cbmUI->Information(CBM::UI::PackageExtract, ! CBM::UI::Failed); std::string info; info="Error extracting "; *************** *** 288,299 **** } ! cbmUI->Information(CBM::UI::BenchPatch, Name()); r=patch(_force); ! if (r) storeStatus(Patched); ! else { std::string info; info="Error patching "; --- 296,312 ---- } ! cbmUI->Information(CBM::UI::PackagePatch, Name()); r=patch(_force); ! if (r) { storeStatus(Patched); ! cbmUI->Information(CBM::UI::PackagePatch, ! CBM::UI::OK); ! ! } else { ! cbmUI->Information(CBM::UI::PackagePatch, ! CBM::UI::Failed); std::string info; info="Error patching "; *************** *** 318,329 **** ! cbmUI->Information(CBM::UI::BenchPreconfigure, Name()); r=preConfigure(_force); ! if (r) storeStatus(Preconfigured); ! else { std::string info; --- 331,346 ---- ! cbmUI->Information(CBM::UI::PackagePreconfigure, Name()); r=preConfigure(_force); ! if (r) { storeStatus(Preconfigured); ! cbmUI->Information(CBM::UI::PackagePreconfigure, ! CBM::UI::OK); ! } else { ! cbmUI->Information(CBM::UI::PackagePreconfigure, ! CBM::UI::Failed); std::string info; *************** *** 371,376 **** } ! cbmUI->Information(CBM::UI::BenchConfigure, ! info); r=configure(_currentCompiler, --- 388,393 ---- } ! cbmUI->Information(CBM::UI::PackageConfigure, ! info); r=configure(_currentCompiler, *************** *** 378,385 **** --- 395,407 ---- if (r) { + cbmUI->Information(CBM::UI::PackageConfigure, + CBM::UI::OK); + storeStatus(Configured); currentCompiler=_currentCompiler; currentOptions=_currentOptions; } else { + cbmUI->Information(CBM::UI::PackageConfigure, + CBM::UI::Failed); info="Configure failed for "; info+=Name(); *************** *** 402,407 **** } ! cbmUI->Information(CBM::UI::BenchMake, ! Name()); system->startTimer(); --- 424,429 ---- } ! cbmUI->Information(CBM::UI::PackageMake, ! Name()); system->startTimer(); *************** *** 416,420 **** --- 438,446 ---- currentOptions); System()->storeConfiguration(); + cbmUI->Information(CBM::UI::PackageMake, + CBM::UI::OK); } else { + cbmUI->Information(CBM::UI::PackageMake, + CBM::UI::Failed); info="Make failed for "; info+=Name(); *************** *** 453,458 **** if (UO_enableTestSuite) { ! cbmUI->Information(CBM::UI::BenchTest, ! Name()); r=test(_force); --- 479,485 ---- if (UO_enableTestSuite) { ! cbmUI->Information(CBM::UI::PackageTest, ! Name()); ! r=test(_force); *************** *** 460,471 **** dum=Name(); dum+=" : passed (disabled by user option)."; ! cbmUI->Information(CBM::UI::BenchTest, ! dum); r=1; } ! if (r) storeStatus(Tested); ! else { std::string info; info="Error testing "; --- 487,502 ---- dum=Name(); dum+=" : passed (disabled by user option)."; ! cbmUI->Information(CBM::UI::PackageTest, ! dum); r=1; } ! if (r) { storeStatus(Tested); ! cbmUI->Information(CBM::UI::PackageTest, ! CBM::UI::OK); ! } else { ! cbmUI->Information(CBM::UI::PackageTest, ! CBM::UI::Failed); std::string info; info="Error testing "; *************** *** 486,491 **** } ! cbmUI->Information(CBM::UI::BenchClean, ! Name()); --- 517,522 ---- } ! cbmUI->Information(CBM::UI::PackageClean, ! Name()); *************** *** 494,498 **** --- 525,533 ---- resetContext(); storeStatus(Preconfigured); + cbmUI->Information(CBM::UI::PackageClean, + CBM::UI::OK); } else { + cbmUI->Information(CBM::UI::PackageClean, + CBM::UI::Failed); info="Clean failed for "; info+=Name(); *************** *** 548,562 **** if (cbmSystem->fileExists(dest)) { expected_md5=expectedMD5(); md5=system->md5File(dest); if (expected_md5==md5) { ! cbmUI->Information(CBM::UI::ChecksumOK, ! dest); storeStatus(Downloaded); return(1); } else { ! cbmUI->Information(CBM::UI::ChecksumFailed, ! dest); } } --- 583,601 ---- if (cbmSystem->fileExists(dest)) { expected_md5=expectedMD5(); + + cbmUI->Information(CBM::UI::Checksum, + dest); + md5=system->md5File(dest); if (expected_md5==md5) { ! cbmUI->Information(CBM::UI::Checksum, ! CBM::UI::OK); storeStatus(Downloaded); return(1); } else { ! cbmUI->Information(CBM::UI::Checksum, ! CBM::UI::Failed); } } *************** *** 569,573 **** int r; ! cbmUI->Information(CBM::UI::BenchUninstall, Name()); --- 608,612 ---- int r; ! cbmUI->Information(CBM::UI::PackageUninstall, Name()); *************** *** 579,585 **** currentCompiler=0; currentOptions=0; return(r); ! } else return(0); } --- 618,634 ---- currentCompiler=0; currentOptions=0; + + if (r) + cbmUI->Information(CBM::UI::PackageUninstall, + CBM::UI::OK); + else + cbmUI->Information(CBM::UI::PackageUninstall, + CBM::UI::Failed); return(r); ! } else { ! cbmUI->Information(CBM::UI::PackageUninstall, ! CBM::UI::Failed); return(0); + } } Index: Benchmark.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Benchmark.cpp 7 May 2007 20:06:15 -0000 1.7 --- Benchmark.cpp 16 May 2007 12:06:17 -0000 1.8 *************** *** 73,78 **** info=Name(); info+=" not tested !"; ! cbmUI->Information(CBM::UI::BenchTest, ! info); return("0"); --- 73,79 ---- info=Name(); info+=" not tested !"; ! cbmUI->Information(CBM::UI::PackageTest, ! info, ! CBM::UI::Failed); return("0"); *************** *** 93,98 **** Package()->storeStatus(Package::Benchmarked); cbmUI->Information(CBM::UI::BenchResult, ! r); } else { info="Benchmarking failed for "; info+=Package()->Name(); --- 94,101 ---- Package()->storeStatus(Package::Benchmarked); cbmUI->Information(CBM::UI::BenchResult, ! CBM::UI::OK); } else { + cbmUI->Information(CBM::UI::BenchResult, + CBM::UI::Failed); info="Benchmarking failed for "; info+=Package()->Name(); |
From: Frederic T. <xf...@us...> - 2007-05-16 12:06:52
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17107 Modified Files: UI.cpp UI.h Log Message: Improved UI API. Index: UI.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI/UI.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UI.h 16 May 2007 09:47:56 -0000 1.3 --- UI.h 16 May 2007 12:05:57 -0000 1.4 *************** *** 21,25 **** { private: ! std::string progressMsg; float progressLast; protected: --- 21,25 ---- { private: ! std::string msg; float progressLast; protected: *************** *** 28,50 **** /** Typedef for message sent to UI object. */ ! typedef enum Info { FileCreate, /*!< File creation */ ! FileRead, /*!< File is being read */ ! FileWrite, /*!< File has been written */ ! FileRemove, /*!< File has been removed */ ! ChecksumOK, /*!< Correct checksum message */ ! ChecksumFailed, /*!< Bad checksum */ ! DirectoryCreate, /*!< Directory has been created */ ! BenchDownload, /*!< Benchmark downloaded */ ! BenchExtract, /*!< Benchmark extracted */ ! BenchPatch, /*!< Benchmark patched */ ! BenchPreconfigure, /*!< Benchmark pre-configured */ ! BenchConfigure, /*!< Benchmark configured */ ! BenchMake, /*!< Benchmark (package) build */ ! BenchTest, /*!< Benchmark is tested */ ! BenchBench, /*!< Benchmark ran */ ! BenchResult, /*!< Benchmark result is being ! * displayed */ ! BenchClean, /*!< Package has been cleaned */ ! BenchUninstall /*!< Package uninstalled */ }; --- 28,53 ---- /** Typedef for message sent to UI object. */ ! typedef enum Info { FileCreate, /*!< File creation */ ! FileRead, /*!< File is being read */ ! FileWrite, /*!< File has been written */ ! FileRemove, /*!< File has been removed */ ! Checksum, /*!< Checksum related messages */ ! DirectoryCreate, /*!< Directory has been created */ ! PackageDownload, /*!< Package download */ ! PackageExtract, /*!< Package extract */ ! PackagePatch, /*!< Package patching */ ! PackagePreconfigure, /*!< Package pre-configuration */ ! PackageConfigure, /*!< Package configuration */ ! PackageMake, /*!< Package building */ ! PackageTest, /*!< Package testing */ ! BenchBench, /*!< Benchmark ran */ ! BenchResult, /*!< Benchmark result is being ! * displayed */ ! PackageClean, /*!< Package cleaning */ ! PackageUninstall /*!< Package uninstallation */ ! }; ! ! typedef enum State { ! Start, Running, OK, Failed }; *************** *** 61,70 **** \param msg Message (clear text) to display */ virtual int Information(Info type, ! std::string msg); ! virtual void ProgressInit(std::string msg); ! virtual void Progress(float _p); ! virtual void ProgressDone(void); /** Virtual destructor */ --- 64,85 ---- \param msg Message (clear text) to display */ + + virtual std::string LastMessage(void); + virtual float LastProgress(void); + virtual int Information(Info type, ! std::string _msg, ! State state = Start, ! float _progress = 0); ! virtual int Information(Info type, ! State state = Start, ! float _progress = 0); ! ! /* ! virtual void ProgressInit(std::string msg); ! virtual void Progress(float _p); ! virtual void ProgressDone(void); ! */ /** Virtual destructor */ Index: UI.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI/UI.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UI.cpp 16 May 2007 09:47:56 -0000 1.4 --- UI.cpp 16 May 2007 12:05:57 -0000 1.5 *************** *** 26,30 **** cbmUI=this; ! progressMsg=""; progressLast=0; } --- 26,30 ---- cbmUI=this; ! msg=""; progressLast=0; } *************** *** 40,45 **** } int UI::Information(CBM::UI::Info type, ! std::string msg) { std::string what; --- 40,58 ---- } + std::string UI::LastMessage(void) + { + return(msg); + } + + float UI::LastProgress(void) + { + return(progressLast); + } + + int UI::Information(CBM::UI::Info type, ! std::string _msg, ! State state, ! float _progress) { std::string what; *************** *** 61,92 **** what="Removing"; break; ! case ChecksumOK: ! what="MD5 Checksum successfuly verified on"; ! break; ! case ChecksumFailed: ! what="Bad MD5 Checksum on"; break; case DirectoryCreate: what="Creating directory"; break; ! case BenchDownload: what="Downloading"; break; ! case BenchExtract: what="Extracting"; break; ! case BenchPatch: what="Patching"; break; ! case BenchPreconfigure: what="Preconfiguring"; break; ! case BenchConfigure: what="Configuring"; break; ! case BenchTest: what="Testing"; break; ! case BenchMake: what="Making"; break; --- 74,102 ---- what="Removing"; break; ! case Checksum: ! what="MD5 Checksum verification"; break; case DirectoryCreate: what="Creating directory"; break; ! case PackageDownload: what="Downloading"; break; ! case PackageExtract: what="Extracting"; break; ! case PackagePatch: what="Patching"; break; ! case PackagePreconfigure: what="Preconfiguring"; break; ! case PackageConfigure: what="Configuring"; break; ! case PackageTest: what="Testing"; break; ! case PackageMake: what="Making"; break; *************** *** 97,104 **** what="Benchmark result :"; break; ! case BenchClean: what="Cleaning"; break; ! case BenchUninstall: what="Uninstalling"; break; --- 107,114 ---- what="Benchmark result :"; break; ! case PackageClean: what="Cleaning"; break; ! case PackageUninstall: what="Uninstalling"; break; *************** *** 106,113 **** what="(?)"; } ! std::cout << what << " " << msg << std::endl; return(1); } void UI::ProgressInit(std::string msg) { --- 116,172 ---- what="(?)"; } ! ! msg=_msg; ! ! if (state==Running) { ! float n = _progress-progressLast; ! float np = progressLast; ! float i; ! ! n/=5.0; ! ! for(i=0; i<n; i+=1.0) { ! printf("="); ! np+=1.0; ! } ! progressLast=np; ! ! fflush(stdout); ! } else { ! std::string dum; ! switch(state) { ! case Start: ! dum="Starting"; ! break; ! case Running: ! dum="Running"; ! break; ! case OK: ! dum="OK"; ! break; ! case Failed: ! dum="Failed"; ! break; ! default: ! dum="??? <internal error>"; ! break; ! } ! if (progressLast!=0) { ! std::cout << std::endl; ! progressLast=0; ! } ! std::cout << msg << " " << what << " " << dum << std::endl; ! } return(1); } + int UI::Information(CBM::UI::Info type, + State state, + float _progress) + { + return(Information(type, msg, state, _progress)); + } + + /* void UI::ProgressInit(std::string msg) { *************** *** 118,134 **** void UI::Progress(float _p) { - float n = _p-progressLast; - float np = progressLast; - float i; - - n/=5.0; - for(i=0; i<n; i+=1.0) { - printf("="); - np+=1.0; - } - progressLast=np; - - fflush(stdout); } --- 177,181 ---- *************** *** 138,141 **** --- 185,190 ---- printf(" - done.\n"); } + */ + UI::~UI() |
From: Frederic T. <xf...@us...> - 2007-05-16 09:47:59
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30162 Modified Files: UI.cpp UI.h Log Message: Progress*() methods introduced. Index: UI.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI/UI.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UI.h 25 Jan 2007 15:49:07 -0000 1.2 --- UI.h 16 May 2007 09:47:56 -0000 1.3 *************** *** 21,33 **** { private: - protected: - /** Unused for now. */ std::string progressMsg; ! /** Unused for now. */ ! int progressMax; ! /** Unused for now. */ ! int progressCur; ! ! public: UI(); --- 21,27 ---- { private: std::string progressMsg; ! float progressLast; ! protected: public: UI(); *************** *** 70,79 **** std::string msg); ! /* ! virtual int ProgressInit(std::string& msg, ! int max) = 0; ! virtual int Progress(int step) = 0; ! virtual int ProgressDone(void) = 0; ! */ /** Virtual destructor */ --- 64,70 ---- std::string msg); ! virtual void ProgressInit(std::string msg); ! virtual void Progress(float _p); ! virtual void ProgressDone(void); /** Virtual destructor */ *************** *** 82,85 **** --- 73,77 ---- extern UI *cbmUI; + extern UI *cbmUI_old; } Index: UI.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI/UI.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UI.cpp 17 Apr 2007 18:20:34 -0000 1.3 --- UI.cpp 16 May 2007 09:47:56 -0000 1.4 *************** *** 12,25 **** #include <iostream> using namespace CBM; CBM::UI *CBM::cbmUI = 0; UI::UI() { progressMsg=""; ! progressMax=-1; ! progressCur=-1; } --- 12,31 ---- #include <iostream> + #include <stdio.h> using namespace CBM; CBM::UI *CBM::cbmUI = 0; + CBM::UI *CBM::cbmUI_old = 0; UI::UI() { + if (cbmUI) + cbmUI_old=cbmUI; + + cbmUI=this; + progressMsg=""; ! progressLast=0; } *************** *** 104,108 **** --- 110,147 ---- } + void UI::ProgressInit(std::string msg) + { + progressMsg=msg; + printf("%s : ", progressMsg.c_str()); + } + + void UI::Progress(float _p) + { + float n = _p-progressLast; + float np = progressLast; + float i; + + n/=5.0; + + for(i=0; i<n; i+=1.0) { + printf("="); + np+=1.0; + } + progressLast=np; + + fflush(stdout); + } + + void UI::ProgressDone(void) + { + Progress(100.0); + printf(" - done.\n"); + } + UI::~UI() { + if (cbmUI_old) + cbmUI=cbmUI_old; + + cbmUI_old=0; } |
From: Frederic T. <xf...@us...> - 2007-05-16 09:47:27
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30138 Modified Files: Makefile.am Log Message: Added System-Thread-Download.* Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 22 Jan 2007 18:25:02 -0000 1.2 --- Makefile.am 16 May 2007 09:47:24 -0000 1.3 *************** *** 22,26 **** endif ! sources = System.cpp System-Unix.cpp libSystem_la_SOURCES = $(sources) $(source_sys) --- 22,26 ---- endif ! sources = System.cpp System-Unix.cpp System-Thread-Download.cpp libSystem_la_SOURCES = $(sources) $(source_sys) |
From: Frederic T. <xf...@us...> - 2007-05-16 09:47:05
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29757 Added Files: System-Thread-Download.cpp System-Thread-Download.h Log Message: First import. --- NEW FILE: System-Thread-Download.cpp --- /* ---------------------------------------------------------------------------- $Id: System-Thread-Download.cpp,v 1.1 2007/05/16 09:46:59 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <System/System-Thread-Download.h> #include <System/System.h> using namespace CBM; SystemThreadDownload::SystemThreadDownload(std::string _url, std::string _file, int _filesize) { url=_url; file=_file; filesize=_filesize; } void SystemThreadDownload::routine(void) { cbmSystem->downloadNow(url, file); } float SystemThreadDownload::Progress(void) { int currentsize = cbmSystem->fileSize(file); return((currentsize*100.0)/filesize); } SystemThreadDownload::~SystemThreadDownload() { } --- NEW FILE: System-Thread-Download.h --- /* ---------------------------------------------------------------------------- $Id: System-Thread-Download.h,v 1.1 2007/05/16 09:46:59 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBMSYSTEM_THREAD_DOWNLOAD #define H_CBMSYSTEM_THREAD_DOWNLOAD 1 #include <Base/Thread.h> #include <string> namespace CBM { class SystemThreadDownload : public ThreadAction { private: std::string url; std::string file; int filesize; protected: virtual void routine(void); public: SystemThreadDownload(std::string _url, std::string _file, int _filesize); virtual float Progress(void); ~SystemThreadDownload(); }; } #endif |
From: Frederic T. <xf...@us...> - 2007-05-16 09:46:23
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29716 Modified Files: System.cpp System.h Log Message: Asynchronous downloading. Index: System.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System/System.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** System.cpp 7 May 2007 20:06:54 -0000 1.13 --- System.cpp 16 May 2007 09:46:19 -0000 1.14 *************** *** 8,11 **** --- 8,12 ---- #include <System/System.h> + #include <System/System-Thread-Download.h> #include <Plan/Plan.h> #include <Base/Config.h> *************** *** 22,25 **** --- 23,27 ---- #include <stdlib.h> #include <sys/types.h> + #include <sys/stat.h> #include <unistd.h> #include <ctype.h> *************** *** 97,101 **** } ! int System::download(std::string url, std::string localfile) { --- 99,103 ---- } ! int System::downloadNow(std::string url, std::string localfile) { *************** *** 121,127 **** --- 123,151 ---- exec0(cmd); return(1); + } + + int System::download(std::string url, + std::string localfile, + int expectedSize) + { + std::string msg; + SystemThreadDownload T(url, localfile, expectedSize); + + msg="Downloading "; + msg+=url; + + cbmUI->ProgressInit(msg); + T.Start(); + + while (!T.Terminated()) { + sleep(1); + cbmUI->Progress(T.Progress()); + } + cbmUI->ProgressDone(); + return(1); } + int System::init(void) { *************** *** 559,562 **** --- 583,595 ---- } + int System::fileSize(std::string fn) + { + struct stat buf; + + stat(fn.c_str(), &buf); + + return(buf.st_size); + } + void System::startTimer(void) { Index: System.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/System/System.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** System.h 7 May 2007 20:06:54 -0000 1.8 --- System.h 16 May 2007 09:46:19 -0000 1.9 *************** *** 221,224 **** --- 221,225 ---- /** Download a file or a page to a physical file. + * * Uses wget for now. * \param url URL containing data to download *************** *** 226,231 **** * \return 1 if ok. */ \ virtual int download(std::string url, ! std::string localfile); /** Copy a local file. --- 227,245 ---- * \return 1 if ok. */ \ + virtual int downloadNow(std::string url, + std::string localfile); + + /** Threaded download of a file or a page to a physical file. + * + * Uses wget for now. + * + * \param url URL containing data to download + * \param localfile local filename used to store data + * \param expectedSize File size expected, in bytes + * \return 1 if ok. + */ \ virtual int download(std::string url, ! std::string localfile, ! int expectedSize); /** Copy a local file. *************** *** 274,277 **** --- 288,292 ---- std::string data); + virtual int fileSize(std::string fn); /** Initialize current object's timer. |
From: Frederic T. <xf...@us...> - 2007-05-16 09:45:46
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29341 Modified Files: Package.cpp Log Message: CBM::System::download() now expect data size. Index: Package.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Package.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Package.cpp 7 May 2007 20:06:15 -0000 1.11 --- Package.cpp 16 May 2007 09:45:41 -0000 1.12 *************** *** 208,212 **** try { system->download(downloadURL(), ! (char*) localFile.c_str()); } --- 208,212 ---- try { system->download(downloadURL(), ! (char*) localFile.c_str(), Size()); } |