Disabling progressbar if stop button is pressed.

This actually had no visible effect on KDE.
This commit is contained in:
Vesa Pikki 2009-07-02 20:23:44 +03:00
parent 8f516a5638
commit 27d630f58d
7 changed files with 33 additions and 8 deletions

View File

@ -65,7 +65,7 @@ MainWindow::MainWindow() :
connect(mUI.mActionRecheck, SIGNAL(triggered()), this, SLOT(ReCheck())); connect(mUI.mActionRecheck, SIGNAL(triggered()), this, SLOT(ReCheck()));
connect(mUI.mActionStop, SIGNAL(triggered()), mThread, SLOT(Stop())); connect(mUI.mActionStop, SIGNAL(triggered()), this, SLOT(StopChecking()));
connect(mUI.mActionSave, SIGNAL(triggered()), this, SLOT(Save())); connect(mUI.mActionSave, SIGNAL(triggered()), this, SLOT(Save()));
connect(mUI.mActionAbout, SIGNAL(triggered()), this, SLOT(About())); connect(mUI.mActionAbout, SIGNAL(triggered()), this, SLOT(About()));
@ -362,6 +362,8 @@ void MainWindow::CheckDone()
mUI.mActionSave->setEnabled(true); mUI.mActionSave->setEnabled(true);
} }
// Notify user - if the window is not active - that check is ready // Notify user - if the window is not active - that check is ready
QApplication::alert(this, 3000); QApplication::alert(this, 3000);
} }
@ -485,14 +487,14 @@ void MainWindow::About()
void MainWindow::ShowLicense() void MainWindow::ShowLicense()
{ {
FileViewDialog *dlg = new FileViewDialog(":COPYING",tr("License"), this); FileViewDialog *dlg = new FileViewDialog(":COPYING", tr("License"), this);
dlg->resize(570, 400); dlg->resize(570, 400);
dlg->exec(); dlg->exec();
} }
void MainWindow::ShowAuthors() void MainWindow::ShowAuthors()
{ {
FileViewDialog *dlg = new FileViewDialog(":AUTHORS",tr("Authors"), this); FileViewDialog *dlg = new FileViewDialog(":AUTHORS", tr("Authors"), this);
dlg->resize(350, 400); dlg->resize(350, 400);
dlg->exec(); dlg->exec();
} }
@ -602,3 +604,9 @@ void MainWindow::AboutToShowViewMenu()
{ {
mUI.mActionToolbar->setChecked(mUI.mToolBar->isVisible()); mUI.mActionToolbar->setChecked(mUI.mToolBar->isVisible());
} }
void MainWindow::StopChecking()
{
mThread->Stop();
mUI.mResults->DisableProgressbar();
}

View File

@ -168,6 +168,12 @@ protected slots:
*/ */
void AboutToShowViewMenu(); void AboutToShowViewMenu();
/**
* @brief Slot when stop checking button is pressed
*
*/
void StopChecking();
protected: protected:
/** /**

View File

@ -98,6 +98,7 @@ void ResultsView::Progress(int value, int max)
else else
{ {
mUI.mProgress->setVisible(true); mUI.mProgress->setVisible(true);
mUI.mProgress->setEnabled(true);
} }
} }
@ -202,3 +203,7 @@ void ResultsView::Translate()
mUI.mTree->Translate(); mUI.mTree->Translate();
} }
void ResultsView::DisableProgressbar()
{
mUI.mProgress->setEnabled(false);
}

View File

@ -116,6 +116,8 @@ public:
* *
*/ */
void Translate(); void Translate();
void DisableProgressbar();
signals: signals:
/** /**

View File

@ -98,13 +98,17 @@ signals:
* *
*/ */
void Done(); void Done();
protected slots:
public slots:
/** /**
* @brief Slot to stop all threads * @brief Slot to stop all threads
* *
*/ */
void Stop(); void Stop();
protected slots:
/** /**
* @brief Slot that a single thread is done * @brief Slot that a single thread is done