diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index f673cc35..8ae3d589 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -55,6 +55,7 @@ #include "frameworks/UBCryptoUtils.h" #include "tools/UBToolsManager.h" +#include "UBDisplayManager.h" #include "core/memcheck.h" QPointer UBApplication::undoStack; @@ -378,9 +379,18 @@ int UBApplication::exec(const QString& pFileToImport) else applicationController->showBoard(); + onScreenCountChanged(1); + connect(desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(onScreenCountChanged(int))); return QApplication::exec(); } +void UBApplication::onScreenCountChanged(int newCount) +{ + Q_UNUSED(newCount); + UBDisplayManager displayManager; + mainWindow->actionMultiScreen->setEnabled(displayManager.numScreens() > 1); +} + void UBApplication::importUniboardFiles() { mUniboardSankoreTransition = new UniboardSankoreTransition(); diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h index b08fdcee..9726cd52 100644 --- a/src/core/UBApplication.h +++ b/src/core/UBApplication.h @@ -117,6 +117,8 @@ class UBApplication : public QtSingleApplication #endif void importUniboardFiles(); + void onScreenCountChanged(int newCount); + private: void updateProtoActionsState(); void setupTranslators(QStringList args); diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp index 06f62b5d..8bfede9f 100644 --- a/src/core/UBPreferencesController.cpp +++ b/src/core/UBPreferencesController.cpp @@ -88,6 +88,7 @@ UBPreferencesController::~UBPreferencesController() void UBPreferencesController::adjustScreens(int screen) { + Q_UNUSED(screen); UBDisplayManager displayManager; mPreferencesUI->multiDisplayGroupBox->setEnabled(displayManager.numScreens() > 1); }