Avoid double-invoke of Launcher Fly! button
If the user double-clicks, and their system is slow, the action can fire twice, which then breaks because we add options twice. Sentry-Id: FLIGHTGEAR-HKV
This commit is contained in:
parent
d57bc67420
commit
f1ab977ceb
2 changed files with 8 additions and 0 deletions
|
@ -599,6 +599,13 @@ void LauncherController::setEnvironmentSummary(QStringList environmentSummary)
|
|||
|
||||
void LauncherController::fly()
|
||||
{
|
||||
// avoid duplicate calls to fly, if the user's system is slow, and they
|
||||
// generate multiple clicks / events before the qApp->exit() fires.
|
||||
// without this, we can apply options, etc twice which breaks.
|
||||
if (m_flyRequested)
|
||||
return;
|
||||
m_flyRequested = true;
|
||||
|
||||
if (m_inAppMode) {
|
||||
doApply();
|
||||
m_keepRunningInAppMode = false;
|
||||
|
|
|
@ -326,6 +326,7 @@ private:
|
|||
bool m_aircraftGridMode;
|
||||
int m_launchCount = 0;
|
||||
int m_versionLaunchCount = 0;
|
||||
bool m_flyRequested = false;
|
||||
};
|
||||
|
||||
#endif // LAUNCHERCONTROLLER_HXX
|
||||
|
|
Loading…
Reference in a new issue