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);
} }
@ -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