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. 5
      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. 101
      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
&& (mActiveScene->isModified()))
{
UBPersistenceManager::persistenceManager()->persistDocumentScene(selectedDocument(), mActiveScene, mActiveSceneIndex);
UBPersistenceManager::persistenceManager()->persistDocumentScene(selectedDocument(), mActiveScene, mActiveSceneIndex, isAnAutomaticBackup);
updatePage(mActiveSceneIndex);
}
}

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

@ -931,11 +931,12 @@ void UBPersistenceManager::reassignDocProxy(UBDocumentProxy *newDocument, UBDocu
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();
pScene->deselectAllItems();
if (!isAnAutomaticBackup)
pScene->deselectAllItems();
generatePathIfNeeded(pDocumentProxy);

@ -103,8 +103,7 @@ class UBPersistenceManager : public QObject
virtual void copyDocumentScene(UBDocumentProxy *from, int fromIndex, UBDocumentProxy *to, int toIndex);
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy,
UBGraphicsScene* pScene, const int pSceneIndex);
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex, bool isAnAutomaticBackup = false);
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)
{
mDocumentThumbs.insert(index, pix);
emit documentThumbnailsUpdated(this);
}

@ -664,7 +664,7 @@ QMimeData *UBDocumentTreeModel::mimeData (const QModelIndexList &indexes) const
#if defined(Q_OS_OSX)
#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);
#endif
#else
@ -1548,7 +1548,6 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event)
const QPixmap *pix = new QPixmap(thumbTmp);
UBDocumentController *ctrl = UBApplication::documentController;
ctrl->addPixmapAt(pix, toIndex);
ctrl->TreeViewSelectionChanged(ctrl->firstSelectedTreeIndex(), QModelIndex());
}
QApplication::restoreOverrideCursor();
@ -1557,6 +1556,8 @@ void UBDocumentTreeView::dropEvent(QDropEvent *event)
docModel->setHighLighted(QModelIndex());
}
UBApplication::documentController->TreeViewSelectionChanged(UBApplication::documentController->firstSelectedTreeIndex(), QModelIndex());
}
else
{

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

@ -31,6 +31,7 @@
#include "core/UBApplication.h"
#include "core/UBSettings.h"
#include "frameworks/UBFileSystemUtils.h"
#include "gui/UBMainWindow.h"
#include <QWidget>
@ -622,35 +623,93 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget)
void UBPlatformUtils::showOSK(bool show)
{
@autoreleasepool {
CFDictionaryRef properties = (CFDictionaryRef)[NSDictionary
dictionaryWithObject: @"com.apple.KeyboardViewer"
forKey: (NSString *)kTISPropertyInputSourceID];
if (QOperatingSystemVersion::current().majorVersion() == 10 && QOperatingSystemVersion::current().minorVersion() < 15) /* < Catalina */
{
@autoreleasepool {
CFDictionaryRef properties = (CFDictionaryRef)[NSDictionary
dictionaryWithObject: @"com.apple.keyboardViewer"
forKey: (NSString *)kTISPropertyInputSourceID];
NSArray *sources = (NSArray *)TISCreateInputSourceList(properties, true);
NSArray *sources = (NSArray *)TISCreateInputSourceList(properties, true);
if ([sources count] > 0) {
TISInputSourceRef osk = (TISInputSourceRef)[sources objectAtIndex: 0];
if ([sources count] > 0) {
TISInputSourceRef osk = (TISInputSourceRef)[sources objectAtIndex: 0];
OSStatus result;
if (show) {
TISEnableInputSource(osk);
result = TISSelectInputSource(osk);
}
else {
TISDisableInputSource(osk);
result = TISDeselectInputSource(osk);
OSStatus result;
if (show) {
TISEnableInputSource(osk);
result = TISSelectInputSource(osk);
}
else {
TISDisableInputSource(osk);
result = TISDeselectInputSource(osk);
}
if (result == paramErr) {
qWarning() << "Unable to select input source";
UBApplication::showMessage(tr("Unable to activate system on-screen keyboard"));
}
}
if (result == paramErr) {
qWarning() << "Unable to select input source";
UBApplication::showMessage(tr("Unable to activate system on-screen keyboard"));
else {
qWarning() << "System OSK not found";
UBApplication::showMessage(tr("System on-screen keyboard not found"));
}
}
}
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"];
}
else {
qWarning() << "System OSK not found";
UBApplication::showMessage(tr("System on-screen keyboard not found"));
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