[Compbench-devel] CompBenchmarks++/Qt-4/Compiler CompilerInfo.cpp, 1.2, 1.3 CompilerInfo.h, 1.2, 1.
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-05-22 17:28:16
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16095 Modified Files: CompilerInfo.cpp CompilerInfo.h CompilerList.cpp CompilerList.h Log Message: Use Basic/Info.h Index: CompilerInfo.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerInfo.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompilerInfo.cpp 17 May 2007 22:37:58 -0000 1.2 --- CompilerInfo.cpp 22 May 2007 17:28:13 -0000 1.3 *************** *** 1,2 **** --- 1,4 ---- + #include <Basic/Info.h> + #include <Compiler/CompilerInfo.h> #include <Compiler/CompilerList.h> *************** *** 5,50 **** 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); ! } ! ! void CompilerInfoTab::addSpace(void) ! { ! lay->setRowStretch(20,20); ! } ! ! QGridLayout *CompilerInfoTab::Layout(void) ! { ! return(lay); ! } ! ! CompilerInfoTab::~CompilerInfoTab() ! { ! } ! ! CompilerInfo::CompilerInfo(QWidget *parent) : QTabWidget(parent) { ! CompilerInfoTab *main = new CompilerInfoTab(); addTab(main, tr("General")); --- 7,14 ---- using namespace CQT; ! CompilerInfo::CompilerInfo(CBM::Compiler *_compiler, QWidget *parent) : QTabWidget(parent) { ! InfoTab *main = new InfoTab(); addTab(main, tr("General")); *************** *** 60,64 **** main->addSpace(); ! CompilerInfoTab *meta = new CompilerInfoTab(); addTab(meta, tr("Meta-informations")); setTabToolTip(1, tr("Internal CompBenchmarks informations")); --- 24,28 ---- main->addSpace(); ! InfoTab *meta = new InfoTab(); addTab(meta, tr("Meta-informations")); setTabToolTip(1, tr("Internal CompBenchmarks informations")); *************** *** 72,75 **** --- 36,57 ---- meta->addSpace(); + if (_compiler) + updateForCompiler(_compiler); + } + + void CompilerInfo::updateForCompiler(CBM::Compiler *C) + { + 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); } *************** *** 91,107 **** 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); } --- 73,77 ---- C=I->Compiler(); ! updateForCompiler(C); } Index: CompilerList.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerList.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompilerList.h 17 May 2007 22:37:58 -0000 1.2 --- CompilerList.h 22 May 2007 17:28:13 -0000 1.3 *************** *** 28,31 **** --- 28,32 ---- protected slots: void compilerUnregister(void); + void compilerInfo(void); public: Index: CompilerList.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerList.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompilerList.cpp 17 May 2007 22:37:58 -0000 1.2 --- CompilerList.cpp 22 May 2007 17:28:13 -0000 1.3 *************** *** 27,33 **** App, SLOT(doCompilerRegisterManual())); ! if (_compiler) addAction(QIcon(":/icons/remove.png"), "Remove", this, SLOT(compilerUnregister())); addAction(QIcon(":/icons/find.png"), "Auto-detect", --- 27,37 ---- App, SLOT(doCompilerRegisterManual())); ! if (_compiler) { ! addAction(QIcon(":/icons/tip.png"), "Popup informations", ! this, SLOT(compilerInfo())); ! addAction(QIcon(":/icons/remove.png"), "Remove", this, SLOT(compilerUnregister())); + } addAction(QIcon(":/icons/find.png"), "Auto-detect", *************** *** 42,45 **** --- 46,54 ---- } + void CompilerListContextMenu::compilerInfo(void) + { + App->compilerInfo(Compiler()); + } + CompilerListContextMenu::~CompilerListContextMenu() { Index: CompilerInfo.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerInfo.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompilerInfo.h 17 May 2007 22:37:58 -0000 1.2 --- CompilerInfo.h 22 May 2007 17:28:13 -0000 1.3 *************** *** 2,35 **** #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 void addSpace(void); ! virtual QGridLayout *Layout(void); ! ! virtual ~CompilerInfoTab(); ! }; class CompilerInfo : public QTabWidget { --- 2,11 ---- #define H_CQT_COMPILERINFO #include <QListWidget> #include <QTabWidget> ! #include <Compiler/Compiler.h> + namespace CQT { class CompilerInfo : public QTabWidget { *************** *** 45,48 **** --- 21,26 ---- protected: + virtual void updateForCompiler(CBM::Compiler *C); + protected slots: virtual void doSelectionChanged(QListWidgetItem *current, *************** *** 51,55 **** public: ! CompilerInfo(QWidget *parent = 0); virtual ~CompilerInfo(); }; --- 29,34 ---- public: ! CompilerInfo(CBM::Compiler *_compiler = 0, ! QWidget *parent = 0); virtual ~CompilerInfo(); }; |