disbale exit-button as long as update process is running

This commit is contained in:
2023-08-02 17:51:35 +02:00
parent a995cae000
commit 0ee92f0181
4 changed files with 16 additions and 0 deletions

View File

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