[Compbench-devel] CompBenchmarks++/Qt-4/Compiler CompilerInfo.cpp, 1.1, 1.2 CompilerInfo.h, 1.1, 1.
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-05-17 22:38:02
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6182 Modified Files: CompilerInfo.cpp CompilerInfo.h CompilerList.cpp CompilerList.h CompilerManager.cpp CompilerManager.h Log Message: Cosmetic changes. Index: CompilerManager.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerManager.cpp 16 May 2007 20:24:26 -0000 1.1 --- CompilerManager.cpp 17 May 2007 22:37:58 -0000 1.2 *************** *** 2,17 **** #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); */ --- 2,17 ---- #include <QHBoxLayout> + #include <QSplitter> + using namespace CQT; CompilerManager::CompilerManager(QWidget *parent) ! : QSplitter(parent) { list=new CompilerList; ! addWidget(list); info=new CompilerInfo; ! addWidget(info); /* list->setSelection(0); */ *************** *** 21,26 **** */ - setLayout(lay); - connect(list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), --- 21,24 ---- *************** *** 32,35 **** --- 30,56 ---- this, SLOT(doCompilersRefresh()), Qt::QueuedConnection); + + + connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), + this, SLOT(doCompilerRegister(CBM::Compiler*))); + + connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), + this, SLOT(doCompilerUnregister(CBM::Compiler*))); + + } + + CompilerList *CompilerManager::List(void) + { + return(list); + } + + void CompilerManager::compilerRegister(CBM::Compiler *_compiler) + { + emit sigCompilerRegister(_compiler); + } + + void CompilerManager::compilerUnregister(CBM::Compiler *_compiler) + { + emit sigCompilerUnregister(_compiler); } Index: CompilerManager.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerManager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerManager.h 16 May 2007 20:24:26 -0000 1.1 --- CompilerManager.h 17 May 2007 22:37:58 -0000 1.2 *************** *** 5,12 **** #include <Compiler/CompilerInfo.h> namespace CQT { ! class CompilerManager : public QWidget { Q_OBJECT --- 5,13 ---- #include <Compiler/CompilerInfo.h> + #include <QSplitter> namespace CQT { ! class CompilerManager : public QSplitter { Q_OBJECT *************** *** 17,20 **** --- 18,23 ---- signals: void sigCompilersRefresh(void); + void sigCompilerRegister(CBM::Compiler *_compiler); + void sigCompilerUnregister(CBM::Compiler *_compiler); public slots: *************** *** 26,29 **** --- 29,37 ---- CompilerManager(QWidget *parent = 0); + virtual CompilerList *List(void); + + virtual void compilerRegister(CBM::Compiler *_compiler); + virtual void compilerUnregister(CBM::Compiler *_compiler); + virtual void compilersRefresh(void); Index: CompilerInfo.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerInfo.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerInfo.cpp 16 May 2007 20:24:26 -0000 1.1 --- CompilerInfo.cpp 17 May 2007 22:37:58 -0000 1.2 *************** *** 15,19 **** QLineEdit *CompilerInfoTab::addInfo(std::string _label, ! std::string _value) { QLabel *l; --- 15,19 ---- QLineEdit *CompilerInfoTab::addInfo(std::string _label, ! std::string _value) { QLabel *l; *************** *** 29,32 **** --- 29,37 ---- } + void CompilerInfoTab::addSpace(void) + { + lay->setRowStretch(20,20); + } + QGridLayout *CompilerInfoTab::Layout(void) { *************** *** 44,65 **** 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) { --- 49,79 ---- addTab(main, tr("General")); + setTabToolTip(0, tr("General information found about selected compiler")); compilerName=main->addInfo(tr("Compiler :").toStdString(), ""); + compilerName->setToolTip(tr("Compiler's name")); compilerVersion=main->addInfo(tr("Version :").toStdString(), ""); + compilerVersion->setToolTip(tr("Compiler's version")); compilerLanguage=main->addInfo(tr("Language :").toStdString(), ""); + compilerLanguage->setToolTip(tr("Compiler's supported language")); compilerBinary=main->addInfo(tr("Binary :").toStdString(), ""); + compilerBinary->setToolTip(tr("Compiler's binary program")); + main->addSpace(); CompilerInfoTab *meta = new CompilerInfoTab(); addTab(meta, tr("Meta-informations")); + setTabToolTip(1, tr("Internal CompBenchmarks informations")); compilerDescriptionDirectory=meta->addInfo(tr("Nearest compatible branch :").toStdString(), ""); + compilerDescriptionDirectory->setToolTip(tr("Option descriptions used from CompBenchmarks knowledge-base for selected compiler")); compilerOptions=meta->addInfo(tr("Option number :").toStdString(), ""); + compilerOptions->setToolTip(tr("Number of descriptions for compiler's compatible options present in knownledge-base")); + meta->addSpace(); } void CompilerInfo::doSelectionChanged(QListWidgetItem *current, ! QListWidgetItem *) { Index: CompilerInfo.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerInfo.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerInfo.h 16 May 2007 20:24:26 -0000 1.1 --- CompilerInfo.h 17 May 2007 22:37:58 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- std::string _value); + virtual void addSpace(void); virtual QGridLayout *Layout(void); Index: CompilerList.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerList.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerList.h 16 May 2007 20:24:26 -0000 1.1 --- CompilerList.h 17 May 2007 22:37:58 -0000 1.2 *************** *** 62,65 **** --- 62,67 ---- CompilerList(QWidget *parent = 0); + virtual int isPresent(CBM::Compiler *_compiler); + virtual void compilersRefresh(void); Index: CompilerList.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerList.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerList.cpp 16 May 2007 20:24:26 -0000 1.1 --- CompilerList.cpp 17 May 2007 22:37:58 -0000 1.2 *************** *** 33,36 **** --- 33,38 ---- addAction(QIcon(":/icons/find.png"), "Auto-detect", App, SLOT(doCompilerAutodetect())); + + setToolTip(tr("Right click on items to add or remove compiler(s)")); } *************** *** 88,91 **** --- 90,118 ---- } + int CompilerList::isPresent(CBM::Compiler *_compiler) + { + int i, n = count(); + CompilerListItem *I; + CBM::Compiler *C; + + for(i=0;i<n;i++) { + I=(CompilerListItem*) item(i); + C=I->Compiler(); + if (C->Name()==_compiler->Name()) { + return(0); + } + if (C->Binary()==_compiler->Binary()) { + return(0); + } + + if ((C->compiler()==_compiler->compiler()) && + (C->Version()==_compiler->Version())) { + return(0); + } + } + + return(1); + } + void CompilerList::doCompilersRefresh(void) { |