From 7eb9370c0b7b740cbd847bffb285dc1a614ad997 Mon Sep 17 00:00:00 2001 From: tux3 Date: Sat, 25 Apr 2015 21:05:29 +0200 Subject: [PATCH] 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. --- src/core/core.cpp | 5 +++-- src/nexus.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index 834efb5cb..a99da9ff8 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -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() diff --git a/src/nexus.cpp b/src/nexus.cpp index 2473dcbb5..d716ed78a 100644 --- a/src/nexus.cpp +++ b/src/nexus.cpp @@ -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);