From 17312e88ab30560c40b753dd434d39c314068cee Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 3 Sep 2016 13:36:27 -0400 Subject: [PATCH 01/20] Fixed type testing of media items (qgraphicsitem_cast couldn't tell the difference between audio and video items) --- src/core/UB.h | 2 ++ src/domain/UBGraphicsMediaItem.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/core/UB.h b/src/core/UB.h index 651ac139..6b218858 100644 --- a/src/core/UB.h +++ b/src/core/UB.h @@ -151,6 +151,8 @@ struct UBGraphicsItemType SvgItemType, DelegateButtonType, MediaItemType, + VideoItemType, + AudioItemType, PDFItemType, TextItemType, CurtainItemType, diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index 34b70b95..f08a5ae5 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.h @@ -160,6 +160,11 @@ class UBGraphicsAudioItem: public UBGraphicsMediaItem Q_OBJECT public: + enum { Type = UBGraphicsItemType::AudioItemType}; + virtual int type() const + { + return Type; + } UBGraphicsAudioItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent = 0); mediaType getMediaType() const { return mediaType_Audio; } @@ -172,6 +177,11 @@ class UBGraphicsVideoItem: public UBGraphicsMediaItem Q_OBJECT public: + enum { Type = UBGraphicsItemType::VideoItemType}; + virtual int type() const + { + return Type; + } UBGraphicsVideoItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent = 0); From 9b4e009f902f1692ca10ac0d2b48ef08791d7e5f Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 4 Sep 2016 17:20:03 -0400 Subject: [PATCH 02/20] Minor changes and fixes to windows deployment script --- release_scripts/windows/release.win7.vc9.bat | 21 ++++++-------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/release_scripts/windows/release.win7.vc9.bat b/release_scripts/windows/release.win7.vc9.bat index 369526f3..e55429d7 100644 --- a/release_scripts/windows/release.win7.vc9.bat +++ b/release_scripts/windows/release.win7.vc9.bat @@ -19,17 +19,17 @@ set SCRIPT_PATH=%~dp0 set PROJECT_ROOT=%SCRIPT_PATH%\..\.. set APPLICATION_NAME=OpenBoard -set QT_DIR=C:\Qt\5.5\msvc2010 +set QT_DIR=C:\Program Files\Qt\5.5\msvc2010 set QT_BIN=%QT_DIR%\bin set PROGRAMS_FILE_PATH=C:\Program Files (x86) -set GIT_BIN=%PROGRAMS_FILE_PATH%\Git\bin +set GIT_BIN=C:\Program Files\Git\bin set VS_BIN=%PROGRAMS_FILE_PATH%\Microsoft Visual Studio 10.0\VC\bin set WIN_SDK_BIN=%PROGRAMS_FILE_PATH%\Microsoft SDKs\Windows\v6.0A\Bin set INNO_EXE=%PROGRAMS_FILE_PATH%\Inno Setup 5\iscc.exe set BUILD_DIR=%PROJECT_ROOT%\build\win32\release -set LRELEASE=%QT_DIR%\bin\lrelease +set LRELEASE=%QT_DIR%\bin\lrelease.exe set BASE_QT_TRANSLATIONS_DIRECTORY=%QT_DIR%\translations set PATH=%QT_BIN%;%PATH%;%WIN_SDK_BIN%;%GIT_BIN% @@ -68,34 +68,25 @@ rmdir /S /Q install "%QT_BIN%\qmake.exe" %APPLICATION_NAME%.pro -%LRELEASE% %APPLICATION_NAME%.pro -%LRELEASE% %BASE_QT_TRANSLATIONS_DIRECTORY%\translations.pro +call "%LRELEASE%" "%APPLICATION_NAME%.pro" set /p VERSION= < build\win32\release\version REM remove the last character that is a space set VERSION=%VERSION: =% -REM git rev-list --tags --max-count=1 > tmp -REM set /p LAST_TAG= < tmp -REM erase tmp -REM git describe %LAST_TAG% > tmp -REM set /p LAST_TAG_VERSION=< tmp -REM erase tmp -REM echo %VERSION% -REM echo %LAST_TAG_VERSION% nmake release-install IF NOT EXIST build\win32\release\product\%APPLICATION_NAME%.exe GOTO EXIT_WITH_ERROR xcopy C:\%APPLICATION_NAME%\bin\*.dll build\win32\release\product\ -xcopy %QT_DIR%\bin\Qt5OpenGL.dll build\win32\release\product\ +xcopy "%QT_DIR%\bin\Qt5OpenGL.dll" build\win32\release\product\ set CUSTOMIZATIONS=build\win32\release\product\customizations mkdir %CUSTOMIZATIONS% xcopy /s resources\customizations %CUSTOMIZATIONS% set I18n=build\win32\release\product\i18n -xcopy /s %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm %I18n%\ +xcopy /s "%BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm" %I18n%\ del build\win32\release\product\i18n\qt_help* From 1c3f879be9654aa10eae99a7ccccc1e5db228ceb Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 4 Sep 2016 17:21:06 -0400 Subject: [PATCH 03/20] Windows: Fixed parameters for silent installation of bundled visual c++ runtime lib --- release_scripts/windows/OpenBoard.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_scripts/windows/OpenBoard.iss b/release_scripts/windows/OpenBoard.iss index f3fea20f..35003f86 100644 --- a/release_scripts/windows/OpenBoard.iss +++ b/release_scripts/windows/OpenBoard.iss @@ -158,7 +158,7 @@ Root: HKLM64; Subkey: "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Low Righ Root: HKLM64; Subkey: "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: string; ValueName: "AppPath"; ValueData: "{app}"; Flags: uninsdeletevalue; Check: isProcessorX64 [Run] -Filename: "{tmp}\vcredist_x86.exe";WorkingDir:"{tmp}"; Parameters: "/q:a/c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""""""; StatusMsg: Installing CRT ... +Filename: "{tmp}\vcredist_x86.exe";WorkingDir:"{tmp}"; Parameters: "/q /norestart"; StatusMsg: Installing CRT... Filename: "{app}\OpenBoard.exe"; Description: "{cm:LaunchProgram,OpenBoard}"; Flags: nowait postinstall skipifsilent [UninstallDelete] From a8076a2be6927ad76e2bce19c97311b6e34c9d6a Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Mon, 5 Sep 2016 02:29:02 +0200 Subject: [PATCH 04/20] Make sure that drop shadows are deactivated in desktop mode On OS X, making annotations in desktop mode then switching to board mode and back could cause shadows to be drawn around every stroke, and these persisted after erasing the strokes (though they did disappear upon switching to board mode and back again). --- src/desktop/UBDesktopAnnotationController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 894b33bc..4969315e 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -85,7 +85,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB #ifdef Q_OS_OSX mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); #endif - mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window); + mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window | Qt::NoDropShadowWindowHint); mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone); mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height()); From 88ef7fdd3b4866869a3675d08f3053aa885da277 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 4 Sep 2016 23:31:49 -0400 Subject: [PATCH 05/20] Fix crash when media item is dragged on a page --- src/domain/UBItem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/domain/UBItem.cpp b/src/domain/UBItem.cpp index 7d756258..f8f5b8a7 100644 --- a/src/domain/UBItem.cpp +++ b/src/domain/UBItem.cpp @@ -119,6 +119,8 @@ UBGraphicsItemDelegate *UBGraphicsItem::Delegate(QGraphicsItem *pItem) result = (static_cast(pItem))->Delegate(); break; case UBGraphicsMediaItem::Type: + case UBGraphicsVideoItem::Type: + case UBGraphicsAudioItem::Type: result = (static_cast(pItem))->Delegate(); break; case UBGraphicsStrokesGroup::Type : From c729d965bc5bccc0bb1a733cbf8da95dcefa19fd Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 4 Sep 2016 23:33:08 -0400 Subject: [PATCH 06/20] Library (right panel): fix for elements not disappearing from current path when they are moved --- src/gui/UBFeaturesWidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 8779fb50..348ea771 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -1224,7 +1224,7 @@ bool UBFeaturesModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction act UBFeature sourceElement; if (dataFromSameModel) { sourceElement = featList.at(i); - moveData(sourceElement, parentFeature, Qt::MoveAction); + moveData(sourceElement, parentFeature, Qt::MoveAction, true); } } } else if (mimeData->hasUrls()) { @@ -1323,6 +1323,11 @@ void UBFeaturesModel::moveData(const UBFeature &source, const UBFeature &destina UBFeatureElementType sourceType = source.getType(); QImage sourceIcon = source.getThumbnail(); + if (sourceType == FEATURE_INTERNAL) { + qWarning() << "Built-in tools cannot be moved"; + return; + } + Q_ASSERT( QFileInfo( sourcePath ).exists() ); QString name = QFileInfo( sourcePath ).fileName(); From 01e1248a98b71c7b760b2bcf541f94de4e4fa69d Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Mon, 5 Sep 2016 19:42:10 -0400 Subject: [PATCH 07/20] Fix for cloned displays being considered as multiple displays on Linux --- src/core/UBDisplayManager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 8176da50..4b8e1e65 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -120,7 +120,16 @@ int UBDisplayManager::numScreens() { if (mUseMultiScreen) { - return mDesktop->screenCount(); + int screenCount = mDesktop->screenCount(); + // Some window managers report two screens when the two monitors are in "cloned" mode; this hack ensures + // that we consider this as just one screen. +#ifdef Q_OS_LINUX + if (screenCount > 1 + && (mDesktop->screenNumber(mDesktop->screen(0)) == mDesktop->screenNumber(mDesktop->screen(1)))) + return 1; + else +#endif + return screenCount; } else { From e5b4de90132ed61202126b7b093b03c6a3143ccc Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 6 Sep 2016 14:25:16 -0400 Subject: [PATCH 08/20] When control view is reset, update the display view and the zoom palette --- src/board/UBBoardController.cpp | 4 +++- src/board/UBBoardPaletteManager.cpp | 1 + src/gui/UBZoomPalette.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index c7e1c657..04ea0d22 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1688,8 +1688,10 @@ void UBBoardController::boardViewResized(QResizeEvent* event) mControlView->centerOn(0,0); - if (mDisplayView) + if (mDisplayView) { + UBApplication::applicationController->adjustDisplayView(); mDisplayView->centerOn(0,0); + } mPaletteManager->containerResized(); diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index bb7324d1..eff776c5 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -497,6 +497,7 @@ void UBBoardPaletteManager::containerResized() mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() , userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); mZoomPalette->adjustSizeAndPosition(); + mZoomPalette->refreshPalette(); } if (isFirstResized && mKeyboardPalette && mKeyboardPalette->parent() == UBApplication::boardController->controlContainer()) diff --git a/src/gui/UBZoomPalette.h b/src/gui/UBZoomPalette.h index 77200d6e..8b017f16 100644 --- a/src/gui/UBZoomPalette.h +++ b/src/gui/UBZoomPalette.h @@ -45,6 +45,7 @@ class UBZoomPalette : public UBFloatingPalette public slots: void hide(); + void refreshPalette(); private: UBBoardController* mBoardController; @@ -55,7 +56,6 @@ class UBZoomPalette : public UBFloatingPalette bool mIsExpanded; private slots: - void refreshPalette(); void showHideExtraButton(); void goHundred(); From 17461abd2b7fa147a8f37ccf72bae27b4c174ce4 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 6 Sep 2016 15:17:53 -0400 Subject: [PATCH 09/20] Fix for folder renaming not being persisted --- src/document/UBDocumentController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 80f0be5a..25dd3c95 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -1018,6 +1018,7 @@ void UBDocumentController::itemChanged(QTreeWidgetItem * item, int column) if (0 != (item->flags() & Qt::ItemIsEditable)) { childItem->proxy()->setMetaData(UBSettings::documentGroupName, item->text(column)); + UBPersistenceManager::persistenceManager()->persistDocumentMetadata(childItem->proxy()); } } } From 93b03b2ec1fa957d8873bcabde48e736e1b21879 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 6 Sep 2016 16:05:55 -0400 Subject: [PATCH 10/20] Hide eraser/marker preview circles when mouse enters palettes, in board mode --- src/desktop/UBDesktopAnnotationController.cpp | 2 ++ src/gui/UBDockPalette.cpp | 1 + src/gui/UBDockPalette.h | 3 +++ 3 files changed, 6 insertions(+) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 4969315e..3544d464 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -126,6 +126,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered()), this, SLOT(onToolClicked())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); + connect(mDesktopPalette, SIGNAL(mouseEntered()), mTransparentDrawingScene, SLOT(hideTool())); + connect(mRightPalette, SIGNAL(mouseEntered()), mTransparentDrawingScene, SLOT(hideTool())); connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized())); diff --git a/src/gui/UBDockPalette.cpp b/src/gui/UBDockPalette.cpp index 401a3c6d..7dda5258 100644 --- a/src/gui/UBDockPalette.cpp +++ b/src/gui/UBDockPalette.cpp @@ -197,6 +197,7 @@ void UBDockPalette::enterEvent(QEvent *event) Q_UNUSED(event); // We want to set the cursor as an arrow everytime it enters the palette setCursor(Qt::ArrowCursor); + emit mouseEntered(); } /** diff --git a/src/gui/UBDockPalette.h b/src/gui/UBDockPalette.h index d2476b8f..d13b36bf 100644 --- a/src/gui/UBDockPalette.h +++ b/src/gui/UBDockPalette.h @@ -150,6 +150,9 @@ public slots: void onAllDownloadsFinished(); virtual void onDocumentSet(UBDocumentProxy* documentProxy); +signals: + void mouseEntered(); + protected: virtual int border(); virtual int radius(); From c8c2685838dc123d19e396466a18590a37a8c04d Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Wed, 7 Sep 2016 18:53:06 -0400 Subject: [PATCH 11/20] Fix nested folder bug In the right-hand pane, two folders that were at the same path and whose names started with the same characters were considered to be nested by the breadcrumbs trail. E.g, folders named "abc" and "abcd", both in the "Audio" folder: clicking on "abcd" made the breadcrumb trail display "[Audio] > [abc] > [abcd]" --- src/gui/UBFeaturesWidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 348ea771..fe3520c7 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -1464,8 +1464,11 @@ bool UBFeaturesPathProxyModel::filterAcceptsRow( int sourceRow, const QModelInde { QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); UBFeature feature = sourceModel()->data(index, Qt::UserRole + 1).value(); - - return feature.isFolder() && path.startsWith( feature.getFullVirtualPath()) ; + + // We want to display parent folders up to and including the current one + return (feature.isFolder() + && ( path.startsWith(feature.getFullVirtualPath() + "/") + || path == feature.getFullVirtualPath())); } From ee9965ac9ebceb8fa83dca03e247cb0a3f4d98c9 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Wed, 7 Sep 2016 20:10:47 -0400 Subject: [PATCH 12/20] Fix for text items still being editable even when marked as non-editable --- src/domain/UBGraphicsTextItem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index f559bee3..6785a563 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -102,7 +102,6 @@ QVariant UBGraphicsTextItem::itemChange(GraphicsItemChange change, const QVarian void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { - setTextInteractionFlags(Qt::TextEditorInteraction); // scene()->itemAt(pos) returns 0 if pos is not over text, but over text item, but mouse press comes. // It is a cludge... @@ -138,6 +137,8 @@ void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) if (!data(UBGraphicsItemData::ItemEditable).toBool()) return; + setTextInteractionFlags(Qt::TextEditorInteraction); + int elapsed = mLastMousePressTime.msecsTo(QTime::currentTime()); if (elapsed < UBApplication::app()->doubleClickInterval()) From c3e8e6397c3c39f5a432599a70129cbc3c3412ea Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 10 Sep 2016 14:35:41 -0400 Subject: [PATCH 13/20] Fix for text items being selected on page load, and for non-editable text items being editable on page load --- src/adaptors/UBSvgSubsetAdaptor.cpp | 1 + src/domain/UBGraphicsTextItem.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index e44eba15..93dc16b6 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -854,6 +854,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene(UBDocumentProx { textItem->setFlag(QGraphicsItem::ItemIsMovable, true); textItem->setFlag(QGraphicsItem::ItemIsSelectable, true); + textItem->activateTextEditor(false); mScene->addItem(textItem); diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index 6785a563..e48cbb5b 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -134,8 +134,10 @@ void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) } } - if (!data(UBGraphicsItemData::ItemEditable).toBool()) + if (!data(UBGraphicsItemData::ItemEditable).toBool()) { + setTextInteractionFlags(Qt::NoTextInteraction); return; + } setTextInteractionFlags(Qt::TextEditorInteraction); From 4698cb49f53aa2f2e263005048fb8f6a4a2b5a37 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 11 Sep 2016 11:47:38 -0400 Subject: [PATCH 14/20] Added a condition for checking display configuration (cloned/extended) --- src/core/UBDisplayManager.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 4b8e1e65..5576becd 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -118,23 +118,21 @@ UBDisplayManager::~UBDisplayManager() int UBDisplayManager::numScreens() { - if (mUseMultiScreen) - { + if (mUseMultiScreen) { int screenCount = mDesktop->screenCount(); // Some window managers report two screens when the two monitors are in "cloned" mode; this hack ensures - // that we consider this as just one screen. + // that we consider this as just one screen. On most desktops, at least one of the following conditions is + // a good indicator of the displays being in cloned or extended mode. #ifdef Q_OS_LINUX if (screenCount > 1 - && (mDesktop->screenNumber(mDesktop->screen(0)) == mDesktop->screenNumber(mDesktop->screen(1)))) + && (mDesktop->screenNumber(mDesktop->screen(0)) == mDesktop->screenNumber(mDesktop->screen(1)) + || mDesktop->screenGeometry(0) == mDesktop->screenGeometry(1))) return 1; - else #endif - return screenCount; + return screenCount; } else - { return 1; - } } From 2f4a0a49a3e96b2c1bda853715e7b38be0ec3972 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 11 Sep 2016 12:04:56 -0400 Subject: [PATCH 15/20] Fix for video items not being movable by the video window anymore --- src/board/UBBoardView.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 34ed6f1f..92fe17d6 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -671,6 +671,8 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item) if (item->isSelected()) return false; case UBGraphicsMediaItem::Type: + case UBGraphicsVideoItem::Type: + case UBGraphicsAudioItem::Type: return true; case UBGraphicsStrokesGroup::Type: return false; From c41ed06a9cb72a30b023d755bddb0ad7453b2d11 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 11 Sep 2016 12:05:07 -0400 Subject: [PATCH 16/20] Bumped version to 1.3.4-b.1 --- OpenBoard.pro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenBoard.pro b/OpenBoard.pro index a164d483..4b2903e3 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -10,9 +10,9 @@ CONFIG += debug_and_release \ VERSION_MAJ = 1 VERSION_MIN = 3 -VERSION_PATCH = 3 -VERSION_TYPE = r # a = alpha, b = beta, rc = release candidate, r = release, other => error -VERSION_BUILD = 0 +VERSION_PATCH = 4 +VERSION_TYPE = b # a = alpha, b = beta, rc = release candidate, r = release, other => error +VERSION_BUILD = 1 VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_PATCH}-$${VERSION_TYPE}.$${VERSION_BUILD}" From 6d35a5a3f8dc0231c498f4489e3003b8ca7e5f3a Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 18 Sep 2016 14:35:31 -0400 Subject: [PATCH 17/20] Correct screen indexing in some cases Several issues remain with multi-screen mode on Linux. The behavior is inconsistent from one desktop evironment to the next, making it hard to work around these problems. Among the known issues at this stage: On Ubuntu 14.04, a call to QWidget::setGeometry requires the widget to be hidden on KDE, but visible on MATE, for the geometry changes to take effect. Despite the widget's geometry being updated by this call, the windows aren't necessarily moved. Meaning that the control and display widgets will tend to be displayed on the same monitor, even though their positions are correctly set to different areas on the extended screen. In the current state, this behavior is observed on MATE. Unity works fine and KDE only has transient positioning issues (for example, swapping control and display windows in multi-screen mode leads to both windows being placed on the same monitor, until multi-screen mode is turned off then on again). # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch dev # Your branch is ahead of 'origin/dev' by 29 commits. # (use "git push" to publish your local commits) # # Changes to be committed: # modified: src/core/UBApplicationController.cpp # modified: src/core/UBDisplayManager.cpp # modified: src/core/UBDisplayManager.h # # Changes not staged for commit: # modified: release_scripts/linux/build.sh # modified: release_scripts/linux/package.sh # # Untracked files: # release_scripts/linux/generateDependencies.sh # --- src/core/UBApplicationController.cpp | 2 +- src/core/UBDisplayManager.cpp | 26 +++++++++++--------------- src/core/UBDisplayManager.h | 2 ++ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 48d670ad..37582e53 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -113,7 +113,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, mBlackScene = new UBGraphicsScene(0); // deleted by UBApplicationController::destructor mBlackScene->setBackground(true, false); - if (mDisplayManager->numScreens() >= 2) + if (mDisplayManager->numScreens() >= 2 && mDisplayManager->useMultiScreen()) { mMirror = new UBScreenMirror(); } diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 5576becd..77538458 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -73,7 +73,7 @@ void UBDisplayManager::initScreenIndexes() if (screenCount > 0) { mControlScreenIndex = mDesktop->primaryScreen(); - if (mDesktop->screenCount() > 1 && UBSettings::settings()->swapControlAndDisplayScreens->get().toBool()) + if (screenCount > 1 && UBSettings::settings()->swapControlAndDisplayScreens->get().toBool()) { mControlScreenIndex = mControlScreenIndex^1; } @@ -85,7 +85,7 @@ void UBDisplayManager::initScreenIndexes() mControlScreenIndex = -1; } - if (screenCount > 1) + if (screenCount > 1 && mUseMultiScreen) { mDisplayScreenIndex = mControlScreenIndex != 0 ? 0 : 1; mScreenIndexesRoles << Display; @@ -118,21 +118,17 @@ UBDisplayManager::~UBDisplayManager() int UBDisplayManager::numScreens() { - if (mUseMultiScreen) { - int screenCount = mDesktop->screenCount(); - // Some window managers report two screens when the two monitors are in "cloned" mode; this hack ensures - // that we consider this as just one screen. On most desktops, at least one of the following conditions is - // a good indicator of the displays being in cloned or extended mode. + int screenCount = mDesktop->screenCount(); + // Some window managers report two screens when the two monitors are in "cloned" mode; this hack ensures + // that we consider this as just one screen. On most desktops, at least one of the following conditions is + // a good indicator of the displays being in cloned or extended mode. #ifdef Q_OS_LINUX - if (screenCount > 1 - && (mDesktop->screenNumber(mDesktop->screen(0)) == mDesktop->screenNumber(mDesktop->screen(1)) - || mDesktop->screenGeometry(0) == mDesktop->screenGeometry(1))) - return 1; -#endif - return screenCount; - } - else + if (screenCount > 1 + && (mDesktop->screenNumber(mDesktop->screen(0)) == mDesktop->screenNumber(mDesktop->screen(1)) + || mDesktop->screenGeometry(0) == mDesktop->screenGeometry(1))) return 1; +#endif + return screenCount; } diff --git a/src/core/UBDisplayManager.h b/src/core/UBDisplayManager.h index 0c96cb80..eee2aef8 100644 --- a/src/core/UBDisplayManager.h +++ b/src/core/UBDisplayManager.h @@ -76,6 +76,8 @@ class UBDisplayManager : public QObject None = 0, Control, Display, Previous1, Previous2, Previous3, Previous4, Previous5 }; + bool useMultiScreen() { return mUseMultiScreen; } + void setUseMultiScreen(bool pUse); int controleScreenIndex() From 2263c46d504f6cfb8724f79742fa4d209a369f3c Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 18 Sep 2016 14:37:04 -0400 Subject: [PATCH 18/20] Bumped version to 1.3.4 --- OpenBoard.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenBoard.pro b/OpenBoard.pro index 4b2903e3..2505bb5b 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -11,8 +11,8 @@ CONFIG += debug_and_release \ VERSION_MAJ = 1 VERSION_MIN = 3 VERSION_PATCH = 4 -VERSION_TYPE = b # a = alpha, b = beta, rc = release candidate, r = release, other => error -VERSION_BUILD = 1 +VERSION_TYPE = r # a = alpha, b = beta, rc = release candidate, r = release, other => error +VERSION_BUILD = 0 VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_PATCH}-$${VERSION_TYPE}.$${VERSION_BUILD}" From 334839d2d7dc893a6abdef925446191df39c6d62 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Fri, 23 Sep 2016 18:53:12 -0400 Subject: [PATCH 19/20] Desktop mode: don't display on 2nd screen if multiscreen mode is deactivated --- src/core/UBApplicationController.cpp | 7 +++++++ src/core/UBDisplayManager.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 37582e53..04b49ed6 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -721,6 +721,13 @@ void UBApplicationController::importFile(const QString& pFilePath) void UBApplicationController::useMultiScreen(bool use) { + if (use && !mMirror) + mMirror = new UBScreenMirror(); + if (!use && mMirror) { + delete mMirror; + mMirror = NULL; + } + mDisplayManager->setUseMultiScreen(use); mDisplayManager->adjustScreens(0); UBSettings::settings()->appUseMultiscreen->set(use); diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 77538458..2d0e418b 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -55,7 +55,7 @@ UBDisplayManager::UBDisplayManager(QObject *parent) { mDesktop = qApp->desktop(); - mUseMultiScreen = true; + mUseMultiScreen = UBSettings::settings()->appUseMultiscreen->get().toBool(); initScreenIndexes(); From 91f534e152997582a3576278c3a86b48cf5bd95b Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Fri, 23 Sep 2016 19:43:06 -0400 Subject: [PATCH 20/20] Fixed marker preview circle color --- src/core/UBSettings.cpp | 4 ++-- src/domain/UBGraphicsScene.cpp | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index c344908a..9f2c72fb 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -80,8 +80,8 @@ QBrush UBSettings::eraserBrushLightBackground = QBrush(QColor(255, 255, 255, 30) QPen UBSettings::eraserPenDarkBackground = QPen(QColor(255, 255, 255, 127)); QPen UBSettings::eraserPenLightBackground = QPen(QColor(0, 0, 0, 127)); -QColor UBSettings::markerCircleBrushColorDarkBackground = QColor(127, 127, 127, 0); -QColor UBSettings::markerCircleBrushColorLightBackground = QColor(255, 255, 255, 0); +QColor UBSettings::markerCircleBrushColorDarkBackground = QColor(127, 127, 127, 80); +QColor UBSettings::markerCircleBrushColorLightBackground = QColor(255, 255, 255, 30); QColor UBSettings::markerCirclePenColorDarkBackground = QColor(255, 255, 255, 127); QColor UBSettings::markerCirclePenColorLightBackground = QColor(0, 0, 0, 127); diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 5181af4a..deb6cbd5 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -2608,20 +2608,19 @@ void UBGraphicsScene::updateMarkerCircleColor() if (!mMarkerCircle) return; - QBrush mcBrush = mMarkerCircle->brush(); QPen mcPen = mMarkerCircle->pen(); if (mDarkBackground) { - mcBrush.setColor(UBSettings::markerCircleBrushColorDarkBackground); mcPen.setColor(UBSettings::markerCirclePenColorDarkBackground); + mMarkerCircle->setBrush(UBSettings::markerCircleBrushColorDarkBackground); } else { - mcBrush.setColor(UBSettings::markerCircleBrushColorLightBackground); mcPen.setColor(UBSettings::markerCirclePenColorLightBackground); + mMarkerCircle->setBrush(UBSettings::markerCircleBrushColorLightBackground); } - mMarkerCircle->setBrush(mcBrush); + mcPen.setStyle(Qt::DotLine); mMarkerCircle->setPen(mcPen); }