disbale exit-button as long as update process is running
This commit is contained in:
parent
a995cae000
commit
0ee92f0181
@ -31,6 +31,8 @@ MainWindow::MainWindow(Worker *worker, QWidget *parent)
|
||||
connect(m_exitTimer, SIGNAL(timeout()), ui->exit, SLOT(click()));
|
||||
connect(ui->start, SIGNAL(clicked()), m_worker, SLOT(update()));
|
||||
connect(ui->exit, SIGNAL(clicked()), this, SLOT(onQuit()));
|
||||
connect(m_worker, SIGNAL(disableExit()), this, SLOT(onDisableExit()));
|
||||
connect(m_worker, SIGNAL(enableExit()), this, SLOT(onEnableExit()));
|
||||
connect(m_worker, SIGNAL(stopStartTimer()), this, SLOT(onStopStartTimer()));
|
||||
connect(m_worker, SIGNAL(restartExitTimer()), this, SLOT(onRestartExitTimer()));
|
||||
connect(m_worker, SIGNAL(appendText(QString, QString)), this, SLOT(onAppendText(QString, QString)));
|
||||
@ -60,6 +62,14 @@ void MainWindow::onStopStartTimer() {
|
||||
m_startTimer->stop();
|
||||
}
|
||||
|
||||
void MainWindow::onDisableExit() {
|
||||
ui->exit->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindow::onEnableExit() {
|
||||
ui->exit->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::onRestartExitTimer() {
|
||||
m_exitTimer->stop();
|
||||
m_exitTimer->start(10 * 1000);
|
||||
|
@ -23,6 +23,8 @@ public slots:
|
||||
void onSetProgress(quint8);
|
||||
void onStopStartTimer();
|
||||
void onRestartExitTimer();
|
||||
void onEnableExit();
|
||||
void onDisableExit();
|
||||
|
||||
private slots:
|
||||
void onQuit();
|
||||
|
@ -122,6 +122,7 @@ void Worker::privateUpdate() {
|
||||
start->setEnabled(false);
|
||||
|
||||
emit stopStartTimer();
|
||||
emit disableExit();
|
||||
m_updateProcessRunning = true;
|
||||
|
||||
bool sentIsmasLastVersionNotification = false;
|
||||
@ -217,6 +218,7 @@ void Worker::privateUpdate() {
|
||||
}
|
||||
|
||||
m_updateProcessRunning = false;
|
||||
emit enableExit();
|
||||
emit restartExitTimer();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user