Delay OTA check after successful network connection

This commit is contained in:
Nicolas Mailloux 2021-08-19 11:11:16 -04:00
parent eab27fabd9
commit b8f4da12f7
2 changed files with 9 additions and 4 deletions

View file

@ -962,10 +962,8 @@ void MainWindow::showToast(QString messageToDisplay) {
toastWindow->show();
if(messageToDisplay == "Connection successful") {
otaManagerWindow = new otaManager(this);
connect(otaManagerWindow, SIGNAL(canOtaUpdate(bool)), SLOT(openUpdateDialogOTA(bool)));
otaManagerWindow->setAttribute(Qt::WA_DeleteOnClose);
// Give the toast some time to vanish away
QTimer::singleShot(5000, this, SLOT(launchOtaUpdater()));
}
}
@ -987,3 +985,9 @@ void MainWindow::openUpdateDialogOTA(bool open) {
;
}
}
void MainWindow::launchOtaUpdater() {
otaManagerWindow = new otaManager(this);
connect(otaManagerWindow, SIGNAL(canOtaUpdate(bool)), SLOT(openUpdateDialogOTA(bool)));
otaManagerWindow->setAttribute(Qt::WA_DeleteOnClose);
}

View file

@ -84,6 +84,7 @@ private slots:
void showToast(QString messageToDisplay);
void closeIndefiniteToast();
void openUpdateDialogOTA(bool open);
void launchOtaUpdater();
private:
Ui::MainWindow *ui;