1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Disable the GUI until a profile is active

There are small instants on startup and while profile switching during which no profile is loaded but the GUI could still receive events, e.g. between two modal windows. Disable the GUI to prevent that.
This commit is contained in:
tux3 2015-04-25 21:05:29 +02:00
parent e682dada3b
commit 7eb9370c0b
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 9 additions and 2 deletions

View File

@ -327,6 +327,9 @@ void Core::start()
emit idSet(getSelfId().toString());
}
if (isReady())
GUI::setEnabled(true);
process(); // starts its own timer
}
@ -988,8 +991,6 @@ void Core::switchConfiguration(const QString& _profile)
HistoryKeeper::resetInstance();
start();
if (isReady())
GUI::setEnabled(true);
}
void Core::loadFriends()

View File

@ -79,6 +79,12 @@ void Nexus::start()
#endif
GUI::getInstance();
// Zetok protection
// There are small instants on startup during which no
// profile is loaded but the GUI could still receive events,
// e.g. between two modal windows. Disable the GUI to prevent that.
GUI::setEnabled(false);
// Connections
#ifdef Q_OS_ANDROID
connect(core, &Core::connected, androidgui, &AndroidGUI::onConnected);