Handling the multiscreen option

preferencesAboutTextFull
Didier Clerc 12 years ago
parent 20d6064f68
commit 7220a63034
  1. 10
      src/core/UBApplication.cpp
  2. 2
      src/core/UBApplication.h
  3. 1
      src/core/UBPreferencesController.cpp

@ -55,6 +55,7 @@
#include "frameworks/UBCryptoUtils.h" #include "frameworks/UBCryptoUtils.h"
#include "tools/UBToolsManager.h" #include "tools/UBToolsManager.h"
#include "UBDisplayManager.h"
#include "core/memcheck.h" #include "core/memcheck.h"
QPointer<QUndoStack> UBApplication::undoStack; QPointer<QUndoStack> UBApplication::undoStack;
@ -378,9 +379,18 @@ int UBApplication::exec(const QString& pFileToImport)
else else
applicationController->showBoard(); applicationController->showBoard();
onScreenCountChanged(1);
connect(desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(onScreenCountChanged(int)));
return QApplication::exec(); return QApplication::exec();
} }
void UBApplication::onScreenCountChanged(int newCount)
{
Q_UNUSED(newCount);
UBDisplayManager displayManager;
mainWindow->actionMultiScreen->setEnabled(displayManager.numScreens() > 1);
}
void UBApplication::importUniboardFiles() void UBApplication::importUniboardFiles()
{ {
mUniboardSankoreTransition = new UniboardSankoreTransition(); mUniboardSankoreTransition = new UniboardSankoreTransition();

@ -117,6 +117,8 @@ class UBApplication : public QtSingleApplication
#endif #endif
void importUniboardFiles(); void importUniboardFiles();
void onScreenCountChanged(int newCount);
private: private:
void updateProtoActionsState(); void updateProtoActionsState();
void setupTranslators(QStringList args); void setupTranslators(QStringList args);

@ -88,6 +88,7 @@ UBPreferencesController::~UBPreferencesController()
void UBPreferencesController::adjustScreens(int screen) void UBPreferencesController::adjustScreens(int screen)
{ {
Q_UNUSED(screen);
UBDisplayManager displayManager; UBDisplayManager displayManager;
mPreferencesUI->multiDisplayGroupBox->setEnabled(displayManager.numScreens() > 1); mPreferencesUI->multiDisplayGroupBox->setEnabled(displayManager.numScreens() > 1);
} }

Loading…
Cancel
Save