From 20d6064f68ba674dc6967f6f091b084d5ba7512a Mon Sep 17 00:00:00 2001 From: Didier Clerc Date: Thu, 18 Oct 2012 10:36:42 +0200 Subject: [PATCH 1/5] Managed enable state of items regarding screen number --- resources/etc/Uniboard.css | 7 ++++++- src/core/UBPreferencesController.cpp | 8 ++++++++ src/core/UBPreferencesController.h | 5 ++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/resources/etc/Uniboard.css b/resources/etc/Uniboard.css index bd5cbbcf..9ae3cf38 100644 --- a/resources/etc/Uniboard.css +++ b/resources/etc/Uniboard.css @@ -1,6 +1,11 @@ -* +QWidget:enabled { color: #3F3F3F; +} + +QWidget:disabled +{ + color: #AAAAAA; } QTextEdit, diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp index 64fb3b20..06f62b5d 100644 --- a/src/core/UBPreferencesController.cpp +++ b/src/core/UBPreferencesController.cpp @@ -64,9 +64,12 @@ UBPreferencesController::UBPreferencesController(QWidget *parent) , mPenProperties(0) , mMarkerProperties(0) { + mDesktop = qApp->desktop(); mPreferencesWindow = new UBPreferencesDialog(this,parent, Qt::Dialog); mPreferencesUI = new Ui::preferencesDialog(); // deleted in mPreferencesUI->setupUi(mPreferencesWindow); + adjustScreens(1); + connect(mDesktop, SIGNAL(screenCountChanged(int)), this, SLOT(adjustScreens(int))); wire(); } @@ -83,6 +86,11 @@ UBPreferencesController::~UBPreferencesController() delete mMarkerProperties; } +void UBPreferencesController::adjustScreens(int screen) +{ + UBDisplayManager displayManager; + mPreferencesUI->multiDisplayGroupBox->setEnabled(displayManager.numScreens() > 1); +} void UBPreferencesController::show() { diff --git a/src/core/UBPreferencesController.h b/src/core/UBPreferencesController.h index 7ce7e0e9..74529392 100644 --- a/src/core/UBPreferencesController.h +++ b/src/core/UBPreferencesController.h @@ -85,12 +85,15 @@ class UBPreferencesController : public QObject void onCommunityPasswordChanged(); void onCommunityPersistenceChanged(); - private: + private slots: + void adjustScreens(int screen); + private: static qreal sSliderRatio; static qreal sMinPenWidth; static qreal sMaxPenWidth; void persistanceCheckboxUpdate(); + QDesktopWidget* mDesktop; }; From 7220a630342a4f7779b05fbb7079a78e84694aa4 Mon Sep 17 00:00:00 2001 From: Didier Clerc Date: Thu, 18 Oct 2012 11:43:12 +0200 Subject: [PATCH 2/5] Handling the multiscreen option --- src/core/UBApplication.cpp | 10 ++++++++++ src/core/UBApplication.h | 2 ++ src/core/UBPreferencesController.cpp | 1 + 3 files changed, 13 insertions(+) diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index f673cc35..8ae3d589 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -55,6 +55,7 @@ #include "frameworks/UBCryptoUtils.h" #include "tools/UBToolsManager.h" +#include "UBDisplayManager.h" #include "core/memcheck.h" QPointer UBApplication::undoStack; @@ -378,9 +379,18 @@ int UBApplication::exec(const QString& pFileToImport) else applicationController->showBoard(); + onScreenCountChanged(1); + connect(desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(onScreenCountChanged(int))); return QApplication::exec(); } +void UBApplication::onScreenCountChanged(int newCount) +{ + Q_UNUSED(newCount); + UBDisplayManager displayManager; + mainWindow->actionMultiScreen->setEnabled(displayManager.numScreens() > 1); +} + void UBApplication::importUniboardFiles() { mUniboardSankoreTransition = new UniboardSankoreTransition(); diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h index b08fdcee..9726cd52 100644 --- a/src/core/UBApplication.h +++ b/src/core/UBApplication.h @@ -117,6 +117,8 @@ class UBApplication : public QtSingleApplication #endif void importUniboardFiles(); + void onScreenCountChanged(int newCount); + private: void updateProtoActionsState(); void setupTranslators(QStringList args); diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp index 06f62b5d..8bfede9f 100644 --- a/src/core/UBPreferencesController.cpp +++ b/src/core/UBPreferencesController.cpp @@ -88,6 +88,7 @@ UBPreferencesController::~UBPreferencesController() void UBPreferencesController::adjustScreens(int screen) { + Q_UNUSED(screen); UBDisplayManager displayManager; mPreferencesUI->multiDisplayGroupBox->setEnabled(displayManager.numScreens() > 1); } From de429ddee0e539f5ac4bd3523d6183a4869f43d0 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Sun, 21 Oct 2012 14:20:46 +0200 Subject: [PATCH 3/5] fixed the transfomation persistance for polygons --- src/adaptors/UBSvgSubsetAdaptor.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 8392dc68..544a2128 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1693,6 +1693,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::polygonItemToSvgPolygon(UBGraphicsPo QString points = pointsToSvgPointsAttribute(polygon); mXmlWriter.writeAttribute("points", points); + mXmlWriter.writeAttribute("transform",toSvgTransform(polygonItem->sceneMatrix())); mXmlWriter.writeAttribute("fill", polygonItem->brush().color().name()); qreal alpha = polygonItem->brush().color().alphaF(); @@ -1781,6 +1782,16 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol polygonItem->setPolygon(polygon); + QStringRef svgTransform = mXmlReader.attributes().value("transform"); + + QMatrix itemMatrix; + + if (!svgTransform.isNull()) + { + itemMatrix = fromSvgTransform(svgTransform.toString()); + polygonItem->setMatrix(itemMatrix); + } + QStringRef svgFill = mXmlReader.attributes().value("fill"); QColor brushColor = pDefaultColor; From fe251020e6c31691df2e7183afeee1a3be8e8b26 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Sun, 21 Oct 2012 14:50:37 +0200 Subject: [PATCH 4/5] added uuid for the scene in order to fill the related field on svg --- src/domain/UBGraphicsScene.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 064d9b28..31dc0b96 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -287,6 +287,7 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta mShouldUseOMP = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5; #endif + setUuid(QUuid::createUuid()); setDocument(parent); createEraiser(); createPointer(); From af26acc9e22a4af2e1ccb52427fa5aeb203db4d6 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Mon, 22 Oct 2012 13:24:39 +0300 Subject: [PATCH 5/5] Fixed missing fonts for pdf for Windows. --- Sankore 3.1.iss | 4 ++++ resources/windows/xpdfrc | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 resources/windows/xpdfrc diff --git a/Sankore 3.1.iss b/Sankore 3.1.iss index 3feaa618..759c3b51 100644 --- a/Sankore 3.1.iss +++ b/Sankore 3.1.iss @@ -91,6 +91,10 @@ Source: "c:\OpenSankore\plugins\mediaservice\qtmedia_audioengined.dll"; DestDir: Source: "c:\OpenSankore\plugins\playlistformats\qtmultimediakit_m3u.dll"; DestDir: "c:\OpenSankore\plugins\playlistformats"; Flags: ignoreversion Source: "c:\OpenSankore\plugins\playlistformats\qtmultimediakit_m3ud.dll"; DestDir: "c:\OpenSankore\plugins\playlistformats"; Flags: ignoreversion +;fonts for xpdf +Source: "resources\windows\xpdfrc"; DestDir: "{app}"; Flags: ignoreversion +Source: "resources\fonts\*"; DestDir: "{app}\fonts"; Flags: ignoreversion + [Icons] Name: "{group}\Open-Sankoré"; Filename: "{app}\Open-Sankore.exe" Name: "{group}\{cm:UninstallProgram,Open-Sankoré}"; Filename: "{uninstallexe}" diff --git a/resources/windows/xpdfrc b/resources/windows/xpdfrc new file mode 100644 index 00000000..3762132c --- /dev/null +++ b/resources/windows/xpdfrc @@ -0,0 +1,14 @@ +fontFile Times-Roman fonts/n021003l.pfb +fontFile Times-Italic fonts/n021023l.pfb +fontFile Times-Bold fonts/n021004l.pfb +fontFile Times-BoldItalic fonts/n021024l.pfb +fontFile Helvetica fonts/n019003l.pfb +fontFile Helvetica-Oblique fonts/n019023l.pfb +fontFile Helvetica-Bold fonts/n019004l.pfb +fontFile Helvetica-BoldOblique fonts/n019024l.pfb +fontFile Courier fonts/n022003l.pfb +fontFile Courier-Oblique fonts/n022023l.pfb +fontFile Courier-Bold fonts/n022004l.pfb +fontFile Courier-BoldOblique fonts/n022024l.pfb +fontFile Symbol fonts/s050000l.pfb +fontFile ZapfDingbats fonts/d050000l.pfb \ No newline at end of file