Merge branch 'dev' into dev-singleapplication

preferencesAboutTextFull
Clément Fauconnier 3 years ago
commit deb1b131bc
  1. 23
      .qmake.stash
  2. 2
      src/board/UBBoardController.cpp
  3. 2
      src/core/UBDisplayManager.cpp
  4. 3
      src/core/UBPersistenceManager.cpp
  5. 3
      src/core/UBPersistenceManager.h
  6. 1
      src/document/UBDocumentContainer.cpp
  7. 5
      src/document/UBDocumentController.cpp
  8. 3
      src/domain/UBGraphicsScene.cpp
  9. 61
      src/frameworks/UBPlatformUtils_mac.mm

@ -1,23 +0,0 @@
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 9
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_GCC_MAJOR_VERSION \
QMAKE_GCC_MINOR_VERSION \
QMAKE_GCC_PATCH_VERSION
QMAKE_CXX.INCDIRS = \
/usr/include/c++/9 \
/usr/include/x86_64-linux-gnu/c++/9 \
/usr/include/c++/9/backward \
/usr/lib/gcc/x86_64-linux-gnu/9/include \
/usr/local/include \
/usr/include/x86_64-linux-gnu \
/usr/include
QMAKE_CXX.LIBDIRS = \
/usr/lib/gcc/x86_64-linux-gnu/9 \
/usr/lib/x86_64-linux-gnu \
/usr/lib \
/lib/x86_64-linux-gnu \
/lib

@ -2020,7 +2020,7 @@ void UBBoardController::persistCurrentScene(bool isAnAutomaticBackup, bool force
&& (mActiveSceneIndex >= 0) && mActiveSceneIndex != mMovingSceneIndex && (mActiveSceneIndex >= 0) && mActiveSceneIndex != mMovingSceneIndex
&& (mActiveScene->isModified())) && (mActiveScene->isModified()))
{ {
UBPersistenceManager::persistenceManager()->persistDocumentScene(selectedDocument(), mActiveScene, mActiveSceneIndex); UBPersistenceManager::persistenceManager()->persistDocumentScene(selectedDocument(), mActiveScene, mActiveSceneIndex, isAnAutomaticBackup);
updatePage(mActiveSceneIndex); updatePage(mActiveSceneIndex);
} }
} }

@ -180,7 +180,7 @@ void UBDisplayManager::setDisplayWidget(QWidget* pDisplayWidget)
} }
mDisplayWidget = pDisplayWidget; mDisplayWidget = pDisplayWidget;
mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex)); mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex));
if (UBSettings::settings()->appUseMultiscreen->get().toBool()) if (numScreens() > 1 && UBSettings::settings()->appUseMultiscreen->get().toBool())
UBPlatformUtils::showFullScreen(mDisplayWidget); UBPlatformUtils::showFullScreen(mDisplayWidget);
} }
} }

@ -931,10 +931,11 @@ void UBPersistenceManager::reassignDocProxy(UBDocumentProxy *newDocument, UBDocu
return mSceneCache.reassignDocProxy(newDocument, oldDocument); return mSceneCache.reassignDocProxy(newDocument, oldDocument);
} }
void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex) void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex, bool isAnAutomaticBackup)
{ {
checkIfDocumentRepositoryExists(); checkIfDocumentRepositoryExists();
if (!isAnAutomaticBackup)
pScene->deselectAllItems(); pScene->deselectAllItems();
generatePathIfNeeded(pDocumentProxy); generatePathIfNeeded(pDocumentProxy);

@ -103,8 +103,7 @@ class UBPersistenceManager : public QObject
virtual void copyDocumentScene(UBDocumentProxy *from, int fromIndex, UBDocumentProxy *to, int toIndex); virtual void copyDocumentScene(UBDocumentProxy *from, int fromIndex, UBDocumentProxy *to, int toIndex);
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy, virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex, bool isAnAutomaticBackup = false);
UBGraphicsScene* pScene, const int pSceneIndex);
virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index, bool useUndoRedoStack = true); virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index, bool useUndoRedoStack = true);

@ -106,7 +106,6 @@ void UBDocumentContainer::addPage(int index)
void UBDocumentContainer::addPixmapAt(const QPixmap *pix, int index) void UBDocumentContainer::addPixmapAt(const QPixmap *pix, int index)
{ {
mDocumentThumbs.insert(index, pix); mDocumentThumbs.insert(index, pix);
emit documentThumbnailsUpdated(this);
} }

@ -664,7 +664,7 @@ QMimeData *UBDocumentTreeModel::mimeData (const QModelIndexList &indexes) const
#if defined(Q_OS_OSX) #if defined(Q_OS_OSX)
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
if (QOperatingSystemVersion::current().minorVersion() < 15) /* < Mojave */ if (QOperatingSystemVersion::current().majorVersion() == 10 && QOperatingSystemVersion::current().minorVersion() < 15) /* <= Mojave */
mimeData->setUrls(urlList); mimeData->setUrls(urlList);
#endif #endif
#else #else
@ -1548,7 +1548,6 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event)
const QPixmap *pix = new QPixmap(thumbTmp); const QPixmap *pix = new QPixmap(thumbTmp);
UBDocumentController *ctrl = UBApplication::documentController; UBDocumentController *ctrl = UBApplication::documentController;
ctrl->addPixmapAt(pix, toIndex); ctrl->addPixmapAt(pix, toIndex);
ctrl->TreeViewSelectionChanged(ctrl->firstSelectedTreeIndex(), QModelIndex());
} }
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
@ -1557,6 +1556,8 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event)
docModel->setHighLighted(QModelIndex()); docModel->setHighLighted(QModelIndex());
} }
UBApplication::documentController->TreeViewSelectionChanged(UBApplication::documentController->firstSelectedTreeIndex(), QModelIndex());
} }
else else
{ {

@ -2380,6 +2380,9 @@ void UBGraphicsScene::changeMagnifierMode(int mode)
{ {
if(magniferControlViewWidget) if(magniferControlViewWidget)
magniferControlViewWidget->setDrawingMode(mode); magniferControlViewWidget->setDrawingMode(mode);
if(magniferDisplayViewWidget)
magniferDisplayViewWidget->setDrawingMode(mode);
} }
void UBGraphicsScene::resizedMagnifier(qreal newPercent) void UBGraphicsScene::resizedMagnifier(qreal newPercent)

@ -31,6 +31,7 @@
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "gui/UBMainWindow.h"
#include <QWidget> #include <QWidget>
@ -621,10 +622,12 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget)
void UBPlatformUtils::showOSK(bool show) void UBPlatformUtils::showOSK(bool show)
{
if (QOperatingSystemVersion::current().majorVersion() == 10 && QOperatingSystemVersion::current().minorVersion() < 15) /* < Catalina */
{ {
@autoreleasepool { @autoreleasepool {
CFDictionaryRef properties = (CFDictionaryRef)[NSDictionary CFDictionaryRef properties = (CFDictionaryRef)[NSDictionary
dictionaryWithObject: @"com.apple.KeyboardViewer" dictionaryWithObject: @"com.apple.keyboardViewer"
forKey: (NSString *)kTISPropertyInputSourceID]; forKey: (NSString *)kTISPropertyInputSourceID];
NSArray *sources = (NSArray *)TISCreateInputSourceList(properties, true); NSArray *sources = (NSArray *)TISCreateInputSourceList(properties, true);
@ -654,3 +657,59 @@ void UBPlatformUtils::showOSK(bool show)
} }
} }
} }
else
{
NSString *source =
@"tell application \"System Events\"\n\
if application process \"TextInputMenuAgent\" exists then\n\
tell application process \"TextInputMenuAgent\"\n\
tell menu bar item 1 of menu bar 2\n\
ignoring application responses\n\
click\n\
end ignoring\n\
end tell\n\
end tell\n\
end if\n\
end tell\n\
do shell script \"killall 'System Events'\"\n";
source = [source stringByAppendingString:@"if application \"Assistive Control\" is"];
if (show)
{
source = [source stringByAppendingString:@" not"];
}
source = [source stringByAppendingString:@" running then\n\
tell application \"System Events\"\n\
tell application process \"TextInputMenuAgent\"\n\
tell menu 1 of menu bar item 1 of menu bar 2\n\
click menu item 2\n\
end tell\n\
end tell\n\
end tell\n\
end if"];
NSAppleScript *script = [[[NSAppleScript alloc] initWithSource:source] autorelease];
NSDictionary *errorInfo = nil;
[script executeAndReturnError:&errorInfo];
if(errorInfo!=nil)
{
NSAlert *alert = [[NSAlert alloc] init];
if (alert != nil)
{
alert.messageText = errorInfo.allValues[0];
[alert runModal];
[alert release];
//restore action state to previous one as it failed
if (show)
UBApplication::mainWindow->actionVirtualKeyboard->setChecked(false);
else
UBApplication::mainWindow->actionVirtualKeyboard->setChecked(true);
}
}
}
}

Loading…
Cancel
Save