diff --git a/resources/etc/OpenBoard.config b/resources/etc/OpenBoard.config index 2ccc834e..7cd2dfa7 100644 --- a/resources/etc/OpenBoard.config +++ b/resources/etc/OpenBoard.config @@ -1,6 +1,7 @@ [App] AngleTolerance=4 HideCheckForSoftwareUpdate=false +HideSwapDisplayScreens=true EnableAutomaticSoftwareUpdates=true EnableSoftwareUpdates=true EnableStartupHints=true diff --git a/resources/forms/preferences.ui b/resources/forms/preferences.ui index bf5e8b64..331aea8e 100644 --- a/resources/forms/preferences.ui +++ b/resources/forms/preferences.ui @@ -72,17 +72,10 @@ - - - - version : … - - - - 1 + 0 @@ -95,21 +88,11 @@ Multi display - - - - Show internal web page content on secondary screen or projector - - - - - + + Qt::Horizontal - - QSizePolicy::Preferred - 40 @@ -118,11 +101,14 @@ - - + + Qt::Horizontal + + QSizePolicy::Preferred + 40 @@ -131,13 +117,27 @@ - + Swap control display and view display + + + + Show internal web page content on secondary screen or projector + + + + + + + Swap first and second displays + + + @@ -244,6 +244,38 @@ 12 + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 40 + 20 + + + + @@ -296,38 +328,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 40 - 20 - - - - @@ -400,74 +400,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -533,6 +465,74 @@ + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -2980,7 +2980,7 @@ Public License instead of this License. But first, please read <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:12pt; font-weight:600;">Translations</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;"><br /></span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">A special thanks to:</span></p> @@ -3027,7 +3027,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://creativecommons.org/licenses/by/3.0/"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;">Creative Commons BY-ND</span></a></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://douteau.ecolier.perso.sfr.fr/page_ecolier.htm"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#000000;">DGESCO (</span></a><a href="mailto:degre.numerique@education.gouv.fr"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;">degre.numerique@education.gouv.fr</span></a><a href="http://douteau.ecolier.perso.sfr.fr/page_ecolier.htm"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#000000;">)</span></a></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://douteau.ecolier.perso.sfr.fr/page_ecolier.htm"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#000000;">Source: </span></a><a href="http://eduscol.education.fr/cid72979/polices-de-caracteres-cursives-pour-l-enseignement-de-l-ecriture.html"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;">http://eduscol.education.fr/cid72979/polices-de-caracteres-cursives-pour-l-enseignement-de-l-ecriture.html</span></a></p> -<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande'; font-size:13pt;"><br /></p> +<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande';"><br /></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">GeTypo Libre</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">Creative Commons BY-NC-ND</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.ge.ch/sem/cc/by-nc-nd/"><span style=" font-family:'Lucida Grande'; font-size:10pt; text-decoration: underline; color:#0000ff;">http://www.ge.ch/sem/cc/by-nc-nd/</span></a></p> @@ -3074,7 +3074,7 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;"> <table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> <tr> <td style="border: none;"> @@ -3093,9 +3093,9 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">Case Postale 241</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">1211 Genève 8</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">Switzerland</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.openboard.ch"><span style=" font-family:'.Helvetica Neue DeskInterface'; text-decoration: underline; color:#0000ff;">openboard.ch</span></a></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface'; text-decoration: underline; color:#0000ff;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">emails: </span><a href="mailto:sem.logistique@edu.ge.ch"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;">sem.logistique@edu.ge.ch</span></a>, <a href="mailto:sem.logistique@edu.ge.ch"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;">support@openboard.ch</span></a></p></td></tr></table></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://www.openboard.ch"><span style=" font-family:'.Helvetica Neue DeskInterface'; font-size:11pt; text-decoration: underline; color:#0000ff;">openboard.ch</span></a></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface'; font-size:11pt; text-decoration: underline; color:#0000ff;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:10pt;">emails: </span><a href="mailto:sem.logistique@edu.ge.ch"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;">sem.logistique@edu.ge.ch</span></a><span style=" font-family:'Ubuntu'; font-size:11pt;">, </span><a href="mailto:sem.logistique@edu.ge.ch"><span style=" font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;">support@openboard.ch</span></a></p></td></tr></table></body></html> true @@ -3182,6 +3182,13 @@ p, li { white-space: pre-wrap; } + + + + version : … + + + diff --git a/src/board/UBBoardController.h b/src/board/UBBoardController.h index 23fc688f..cc674ccc 100644 --- a/src/board/UBBoardController.h +++ b/src/board/UBBoardController.h @@ -237,7 +237,7 @@ class UBBoardController : public UBDocumentContainer UBGraphicsMediaItem* addVideo(const QUrl& pUrl, bool startPlay, const QPointF& pos, bool bUseSource = false); UBGraphicsMediaItem* addAudio(const QUrl& pUrl, bool startPlay, const QPointF& pos, bool bUseSource = false); UBGraphicsWidgetItem *addW3cWidget(const QUrl& pUrl, const QPointF& pos); - + void adjustDisplayViews(); void cut(); void copy(); void paste(); @@ -289,7 +289,6 @@ class UBBoardController : public UBDocumentContainer void initBackgroundGridSize(); void updatePageSizeState(); void saveViewState(); - void adjustDisplayViews(); int autosaveTimeoutFromSettings(); UBMainWindow *mMainWindow; diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index d8bdc89f..f3a6e199 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -98,7 +98,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, connect(mDisplayManager, SIGNAL(screenLayoutChanged()), this, SLOT(screenLayoutChanged())); connect(mDisplayManager, SIGNAL(screenLayoutChanged()), mUninoteController, SLOT(screenLayoutChanged())); connect(mDisplayManager, SIGNAL(screenLayoutChanged()), UBApplication::webController, SLOT(screenLayoutChanged())); - + connect(mDisplayManager, SIGNAL(adjustDisplayViewsRequired()), UBApplication::boardController, SLOT(adjustDisplayViews())); connect(mUninoteController, SIGNAL(imageCaptured(const QPixmap &, bool)), this, SLOT(addCapturedPixmap(const QPixmap &, bool))); connect(mUninoteController, SIGNAL(restoreUniboard()), this, SLOT(hideDesktop())); diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 2d0e418b..db5c1318 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -24,8 +24,6 @@ * along with OpenBoard. If not, see . */ - - #include "UBDisplayManager.h" #include "frameworks/UBPlatformUtils.h" @@ -109,6 +107,65 @@ void UBDisplayManager::initScreenIndexes() } } +void UBDisplayManager::swapDisplayScreens(bool swap) +{ + int screenCount = numScreens(); + + mScreenIndexesRoles.clear(); + + if (screenCount > 0) + { + mControlScreenIndex = mDesktop->primaryScreen(); + if (screenCount > 1 && UBSettings::settings()->swapControlAndDisplayScreens->get().toBool()) + { + mControlScreenIndex = mControlScreenIndex^1; + } + mScreenIndexesRoles << Control; + } + else + { + mControlScreenIndex = -1; + } + + if (screenCount > 1 && mUseMultiScreen) + { + mDisplayScreenIndex = mControlScreenIndex != 0 ? 0 : 1; + mScreenIndexesRoles << Display; + } + else + { + mDisplayScreenIndex = -1; + } + + mPreviousScreenIndexes.clear(); + + if (screenCount > 2) + { + for(int i = 2; i < screenCount; i++) + { + if(mControlScreenIndex == i) + mPreviousScreenIndexes.append(1); + else + mPreviousScreenIndexes.append(i); + } + } + + if (swap) + { + // As it s a really specific ask and we don't have much time to handle it correctly + // this code handles only the swap between the main display screen and the first previous one + int displayScreenIndex = mDisplayScreenIndex; + mDisplayScreenIndex = mPreviousScreenIndexes.at(0); + mPreviousScreenIndexes.clear(); + mPreviousScreenIndexes.append(displayScreenIndex); + } + + positionScreens(); + + emit screenLayoutChanged(); + emit adjustDisplayViewsRequired(); +} + UBDisplayManager::~UBDisplayManager() { diff --git a/src/core/UBDisplayManager.h b/src/core/UBDisplayManager.h index eee2aef8..9e0d57ca 100644 --- a/src/core/UBDisplayManager.h +++ b/src/core/UBDisplayManager.h @@ -91,6 +91,7 @@ class UBDisplayManager : public QObject signals: void screenLayoutChanged(); + void adjustDisplayViewsRequired(); public slots: @@ -104,6 +105,7 @@ class UBDisplayManager : public QObject void setRoleToScreen(DisplayRole role, int screenIndex); + void swapDisplayScreens(bool swap); private: void positionScreens(); diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp index b7f4dfdd..80d1a59d 100644 --- a/src/core/UBPreferencesController.cpp +++ b/src/core/UBPreferencesController.cpp @@ -140,11 +140,18 @@ void UBPreferencesController::wire() connect(mPreferencesUI->keyboardPaletteKeyButtonSize, SIGNAL(currentIndexChanged(const QString &)), settings->boardKeyboardPaletteKeyBtnSize, SLOT(setString(const QString &))); connect(mPreferencesUI->startModeComboBox, SIGNAL(currentIndexChanged(int)), settings->appStartMode, SLOT(setInt(int))); - connect(mPreferencesUI->useExternalBrowserCheckBox, SIGNAL(clicked(bool)), settings->webUseExternalBrowser, SLOT(setBool(bool))); connect(mPreferencesUI->displayBrowserPageCheckBox, SIGNAL(clicked(bool)), settings->webShowPageImmediatelyOnMirroredScreen, SLOT(setBool(bool))); connect(mPreferencesUI->swapControlAndDisplayScreensCheckBox, SIGNAL(clicked(bool)), settings->swapControlAndDisplayScreens, SLOT(setBool(bool))); connect(mPreferencesUI->swapControlAndDisplayScreensCheckBox, SIGNAL(clicked(bool)), UBApplication::applicationController->displayManager(), SLOT(reinitScreens(bool))); + if (settings->appHideSwapDisplayScreens->get().toBool()) + { + mPreferencesUI->swapDisplayScreensCheckBox->hide(); + } + else + { + connect(mPreferencesUI->swapDisplayScreensCheckBox, SIGNAL(clicked(bool)), UBApplication::applicationController->displayManager(), SLOT(swapDisplayScreens(bool))); + } connect(mPreferencesUI->toolbarAtTopRadioButton, SIGNAL(clicked(bool)), this, SLOT(toolbarPositionChanged(bool))); connect(mPreferencesUI->toolbarAtBottomRadioButton, SIGNAL(clicked(bool)), this, SLOT(toolbarPositionChanged(bool))); diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index d30855cc..dc9e5702 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -236,6 +236,7 @@ void UBSettings::init() appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", false); appSoftwareUpdateURL = new UBSetting(this, "App", "SoftwareUpdateURL", "http://www.openboard.ch/update.json"); appHideCheckForSoftwareUpdate = new UBSetting(this, "App", "HideCheckForSoftwareUpdate", false); + appHideSwapDisplayScreens = new UBSetting(this, "App", "HideSwapDisplayScreens", true); appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false); appPreferredLanguage = new UBSetting(this,"App","PreferredLanguage", ""); diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 28af670b..314b80ce 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -252,6 +252,7 @@ class UBSettings : public QObject UBSetting* appEnableAutomaticSoftwareUpdates; UBSetting* appSoftwareUpdateURL; UBSetting* appHideCheckForSoftwareUpdate; + UBSetting* appHideSwapDisplayScreens; UBSetting* appToolBarOrientationVertical; UBSetting* appPreferredLanguage;