diff --git a/src/nexus.cpp b/src/nexus.cpp index 4347ed9b2..b077ce8e3 100644 --- a/src/nexus.cpp +++ b/src/nexus.cpp @@ -245,7 +245,7 @@ void Nexus::showMainGUI() // 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); + widget->setEnabled(false); // Connections connect(profile, &Profile::selfAvatarChanged, widget, &Widget::onSelfAvatarLoaded); @@ -259,7 +259,7 @@ void Nexus::showMainGUI() profile->startCore(); - GUI::setEnabled(true); + widget->setEnabled(true); } /** diff --git a/src/widget/gui.cpp b/src/widget/gui.cpp index 8417b76c5..0397386e9 100644 --- a/src/widget/gui.cpp +++ b/src/widget/gui.cpp @@ -61,21 +61,6 @@ GUI& GUI::getInstance() // Implementation of the public clean interface -/** - * @brief Will enable or disable the GUI. - * @note A disabled GUI can't be interacted with by the user. - * @param state Enable/disable GUI. - */ -void GUI::setEnabled(bool state) -{ - if (QThread::currentThread() == qApp->thread()) { - getInstance()._setEnabled(state); - } else { - QMetaObject::invokeMethod(&getInstance(), "_setEnabled", Qt::BlockingQueuedConnection, - Q_ARG(bool, state)); - } -} - /** * @brief Change the title of the main window. * @param title Titile to set. @@ -209,13 +194,6 @@ bool GUI::askQuestion(const QString& title, const QString& msg, const QString& b // Private implementations -void GUI::_setEnabled(bool state) -{ - Widget* w = Nexus::getDesktopGUI(); - if (w) - w->setEnabled(state); -} - void GUI::_setWindowTitle(const QString& title) { QWidget* w = getMainWidget(); diff --git a/src/widget/gui.h b/src/widget/gui.h index a6ce6ee35..38364de56 100644 --- a/src/widget/gui.h +++ b/src/widget/gui.h @@ -30,7 +30,6 @@ class GUI : public QObject public: static GUI& getInstance(); static QWidget* getMainWidget(); - static void setEnabled(bool state); static void setWindowTitle(const QString& title); static void reloadTheme(); static void showInfo(const QString& title, const QString& msg); @@ -48,7 +47,6 @@ private: private slots: // Private implementation, those must be called from the GUI thread - void _setEnabled(bool state); void _setWindowTitle(const QString& title); void _showInfo(const QString& title, const QString& msg); void _showWarning(const QString& title, const QString& msg);