From d25061ac0a32891397c7628cb6636d852292216c Mon Sep 17 00:00:00 2001 From: PT_Dreamer Date: Sun, 14 Oct 2012 01:10:30 +0100 Subject: [PATCH] GCS-Hides wizard to display dialog --- .../src/plugins/setupwizard/pages/autoupdatepage.cpp | 9 ++++++++- .../src/plugins/setupwizard/pages/autoupdatepage.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp index 0a99abd18..571ae774c 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.cpp @@ -8,7 +8,7 @@ AutoUpdatePage::AutoUpdatePage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), - ui(new Ui::AutoUpdatePage) + ui(new Ui::AutoUpdatePage),m_wiz(wizard) { ui->setupUi(this); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); @@ -29,9 +29,13 @@ void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant valu switch(status) { case uploader::WAITING_DISCONNECT: + m_wiz->setWindowFlags(m_wiz->windowFlags() & ~Qt::WindowStaysOnTopHint); ui->statusLabel->setText("Waiting for all OP boards to be disconnected"); break; case uploader::WAITING_CONNECT: + m_wiz->setWindowFlags(m_wiz->windowFlags() | Qt::WindowStaysOnTopHint); + m_wiz->setWindowIcon(qApp->windowIcon()); + m_wiz->show(); ui->statusLabel->setText("Please connect the board to the USB port (don't use external supply)"); ui->levellinProgressBar->setValue(value.toInt()); break; @@ -56,6 +60,9 @@ void AutoUpdatePage::updateStatus(uploader::AutoUpdateStep status, QVariant valu ui->statusLabel->setText("Board Updated, please press the 'next' button below"); break; case uploader::FAILURE: + m_wiz->setWindowFlags(m_wiz->windowFlags() | Qt::WindowStaysOnTopHint); + m_wiz->setWindowIcon(qApp->windowIcon()); + m_wiz->show(); ui->statusLabel->setText("Something went wrong, you will have to manualy upgrade the board using the uploader plugin"); break; } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.h index 3e0e8143f..8d77085e2 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/autoupdatepage.h @@ -52,6 +52,7 @@ private slots: private: Ui::AutoUpdatePage *ui; + SetupWizard * m_wiz; }; #endif // AUTOUPDATEPAGE_H