diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2007-11-07 16:31:55 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2007-11-07 16:31:55 (GMT) |
commit | c05f8aa70ed5837b75211483bddd9ae27012cd12 (patch) | |
tree | d4c97a97a85a3b6029b5b5f107f1aa7b8327bff2 | |
parent | 31d4280bf3c1c0b24cd586b17c8d34cdb2f09647 (diff) | |
download | CMake-c05f8aa70ed5837b75211483bddd9ae27012cd12.zip CMake-c05f8aa70ed5837b75211483bddd9ae27012cd12.tar.gz CMake-c05f8aa70ed5837b75211483bddd9ae27012cd12.tar.bz2 |
ENH: remove status bar and move interrupt/progress next to configure/generate.
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 17 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.h | 2 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.ui | 20 |
3 files changed, 24 insertions, 15 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index c1484f5..650a7a6 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -80,14 +80,9 @@ CMakeSetupDialog::CMakeSetupDialog() this->Splitter->setStretchFactor(0, 2); this->Splitter->setStretchFactor(1, 1); this->setCentralWidget(cont); - this->ProgressBar = new QProgressBar(); - this->ProgressBar->setRange(0,100); - this->InterruptButton = new QToolButton(); - this->InterruptButton->setEnabled(false); + this->ProgressBar->reset(); this->InterruptButton->setIcon( this->style()->standardPixmap(QStyle::SP_DialogCancelButton)); - this->statusBar()->addPermanentWidget(this->InterruptButton); - this->statusBar()->addPermanentWidget(this->ProgressBar); QMenu* FileMenu = this->menuBar()->addMenu(tr("&File")); this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache")); @@ -180,8 +175,6 @@ void CMakeSetupDialog::initialize() Qt::BlockingQueuedConnection); QObject::connect(this->InterruptButton, SIGNAL(clicked(bool)), - this->CMakeThread->cmakeInstance(), SLOT(interrupt())); - QObject::connect(this->InterruptButton, SIGNAL(clicked(bool)), this, SLOT(doInterrupt())); QObject::connect(this->CMakeThread->cmakeInstance(), @@ -282,7 +275,6 @@ void CMakeSetupDialog::finishConfigure(int err) this->InterruptButton->setEnabled(false); this->setEnabledState(true); this->ProgressBar->reset(); - this->statusBar()->showMessage(tr("Configure Done"), 2000); if(err != 0) { QMessageBox::critical(this, tr("Error"), @@ -301,7 +293,6 @@ void CMakeSetupDialog::finishGenerate(int err) this->setEnabledState(true); this->setGenerateEnabled(true); this->ProgressBar->reset(); - this->statusBar()->showMessage(tr("Generate Done")); if(err != 0) { QMessageBox::critical(this, tr("Error"), @@ -387,7 +378,8 @@ void CMakeSetupDialog::doHelp() void CMakeSetupDialog::doInterrupt() { this->InterruptButton->setEnabled(false); - this->statusBar()->showMessage(tr("Interrupting...")); + QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(), + "interrupt", Qt::QueuedConnection); } void CMakeSetupDialog::doSourceBrowse() @@ -442,9 +434,8 @@ void CMakeSetupDialog::setSourceDirectory(const QString& dir) this->SourceDirectory->setText(dir); } -void CMakeSetupDialog::showProgress(const QString& msg, float percent) +void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent) { - this->statusBar()->showMessage(msg); this->ProgressBar->setValue(qRound(percent * 100)); } diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h index 006569f..bd8b9c2 100644 --- a/Source/QtDialog/CMakeSetupDialog.h +++ b/Source/QtDialog/CMakeSetupDialog.h @@ -75,8 +75,6 @@ protected: void dropEvent(QDropEvent*); QCMakeThread* CMakeThread; - QProgressBar* ProgressBar; - QToolButton* InterruptButton; bool ExitAfterGenerate; QAction* ReloadCacheAction; QAction* DeleteCacheAction; diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui index aa2433a..ba27cd8 100644 --- a/Source/QtDialog/CMakeSetupDialog.ui +++ b/Source/QtDialog/CMakeSetupDialog.ui @@ -183,6 +183,26 @@ </property> </spacer> </item> + <item> + <widget class="QToolButton" name="InterruptButton" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="text" > + <string>...</string> + </property> + </widget> + </item> + <item> + <widget class="QProgressBar" name="ProgressBar" > + <property name="value" > + <number>0</number> + </property> + <property name="textVisible" > + <bool>true</bool> + </property> + </widget> + </item> </layout> </item> </layout> |