mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
SetupWizard: Store a flag if the wizard is running to prevent starting two.
This is still not as good as getting that dialog modal since the user can get it lost behind the main window.
This commit is contained in:
parent
b99b221a6d
commit
28d3cdcd7a
@ -37,9 +37,8 @@
|
||||
#include <QKeySequence>
|
||||
#include <coreplugin/modemanager.h>
|
||||
|
||||
SetupWizardPlugin::SetupWizardPlugin()
|
||||
SetupWizardPlugin::SetupWizardPlugin() : wizardRunning(false)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
SetupWizardPlugin::~SetupWizardPlugin()
|
||||
@ -82,9 +81,19 @@ void SetupWizardPlugin::shutdown()
|
||||
|
||||
void SetupWizardPlugin::showSetupWizard()
|
||||
{
|
||||
SetupWizard *m_wiz = new SetupWizard();
|
||||
m_wiz->setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
m_wiz->show();
|
||||
if (!wizardRunning) {
|
||||
wizardRunning = true;
|
||||
SetupWizard *m_wiz = new SetupWizard();
|
||||
connect(m_wiz, SIGNAL(finished(int)), this, SLOT(wizardTerminated()));
|
||||
m_wiz->setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
m_wiz->show();
|
||||
}
|
||||
}
|
||||
|
||||
void SetupWizardPlugin::wizardTerminated()
|
||||
{
|
||||
wizardRunning = false;
|
||||
disconnect(this,SLOT(wizardTerminated()));
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN(SetupWizardPlugin)
|
||||
|
@ -44,7 +44,10 @@ public:
|
||||
|
||||
private slots:
|
||||
void showSetupWizard();
|
||||
void wizardTerminated();
|
||||
|
||||
private:
|
||||
bool wizardRunning;
|
||||
};
|
||||
|
||||
#endif // SETUPWIZARDPLUGIN_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user