diff --git a/OpenBoard.pro b/OpenBoard.pro index a164d483..2505bb5b 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -10,7 +10,7 @@ CONFIG += debug_and_release \ VERSION_MAJ = 1 VERSION_MIN = 3 -VERSION_PATCH = 3 +VERSION_PATCH = 4 VERSION_TYPE = r # a = alpha, b = beta, rc = release candidate, r = release, other => error VERSION_BUILD = 0 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] 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* diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index bf04c400..e0dbb4e2 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -891,6 +891,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/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index b1dac51f..6ba15e3e 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1684,8 +1684,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 449d0831..393a40ac 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -502,6 +502,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/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 490e3955..096a4898 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; diff --git a/src/core/UB.h b/src/core/UB.h index 4c791615..bb197d95 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/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 7e45d365..4f541062 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, UBPageBackground::plain); - if (mDisplayManager->numScreens() >= 2) + if (mDisplayManager->numScreens() >= 2 && mDisplayManager->useMultiScreen()) { mMirror = new UBScreenMirror(); } @@ -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 8176da50..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(); @@ -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,14 +118,17 @@ UBDisplayManager::~UBDisplayManager() int UBDisplayManager::numScreens() { - if (mUseMultiScreen) - { - return mDesktop->screenCount(); - } - else - { + 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; } 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() diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 3b1bc4f5..373a9062 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -82,8 +82,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/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 40188703..0500e3c9 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()); @@ -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/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()); } } } 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); diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 6a451a28..23db81d5 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -2705,20 +2705,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); } diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index f559bee3..e48cbb5b 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... @@ -135,8 +134,12 @@ void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) } } - if (!data(UBGraphicsItemData::ItemEditable).toBool()) + if (!data(UBGraphicsItemData::ItemEditable).toBool()) { + setTextInteractionFlags(Qt::NoTextInteraction); return; + } + + setTextInteractionFlags(Qt::TextEditorInteraction); int elapsed = mLastMousePressTime.msecsTo(QTime::currentTime()); 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 : 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(); diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 8779fb50..fe3520c7 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(); @@ -1459,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())); } 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();