diff --git a/buildDebianPackage.sh b/buildDebianPackage.sh
index 31c77413..3055e8b7 100755
--- a/buildDebianPackage.sh
+++ b/buildDebianPackage.sh
@@ -127,6 +127,17 @@ buildWithStandardQt(){
fi
}
+buildImporter(){
+ IMPORTER_DIR="../OpenSankoreToOpenBoard"
+ IMPORTER_NAME="OpenBoardImporter"
+ checkDir $IMPORTER_DIR
+ cd ${IMPORTER_DIR}
+ $QMAKE_PATH ${IMPORTER_NAME}.pro
+ make -j4
+ checkExecutable $IMPORTER_NAME
+ cd -
+}
+
#**********************
# script
#**********************
@@ -156,6 +167,10 @@ checkExecutable $QMAKE_PATH
checkExecutable $LRELEASES
checkExecutable $ZIP_PATH
+#build third party application
+buildImporter
+notifyProgress "OpenBoardImporter" "Built Importer"
+
# cleaning the build directory
rm -rf "build/linux/release"
rm -rf install
@@ -201,12 +216,16 @@ chmod a+x $PRODUCT_PATH/run.sh
cp -R resources/linux/qtlinux/* $PRODUCT_PATH/
-notifyProgress "QT" "Coping plugins and library ..."
+notifyProgress "QT" "Copying plugins and library ..."
cp -R $PLUGINS_PATH $PRODUCT_PATH/
# copying customization
cp -R resources/customizations $PRODUCT_PATH/
+# copying importer
+mkdir -p $PRODUCT_PATH/Importer
+cp -R ${IMPORTER_DIR}/${IMPOTER_NAME} $PRODUCT_PATH/Importer
+
if [ $STANDARD_QT_USED == false ]; then
#copying custom qt library
mkdir -p $QT_LIBRARY_DEST_PATH
diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp
index 47d4ec08..cdd10639 100644
--- a/src/board/UBBoardController.cpp
+++ b/src/board/UBBoardController.cpp
@@ -153,6 +153,7 @@ void UBBoardController::init()
connect(UBApplication::mainWindow->actionGroupItems, SIGNAL(triggered()), this, SLOT(groupButtonClicked()));
undoRedoStateChange(true);
+
}
@@ -201,7 +202,6 @@ void UBBoardController::setupViews()
mPaletteManager = new UBBoardPaletteManager(mControlContainer, this);
connect(this, SIGNAL(activeSceneChanged()), mPaletteManager, SLOT(activeSceneChanged()));
-
}
diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp
index 2841d01b..b30326a0 100644
--- a/src/core/UBApplicationController.cpp
+++ b/src/core/UBApplicationController.cpp
@@ -32,6 +32,8 @@
#include "core/UBSetting.h"
#include "core/UBDocumentManager.h"
#include "core/UBDisplayManager.h"
+#include "core/UBOpenSankoreImporter.h"
+
#include "board/UBBoardView.h"
#include "board/UBBoardController.h"
@@ -113,7 +115,8 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView,
, this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&)));
networkAccessManager = new QNetworkAccessManager (this);
- QTimer::singleShot (1000, this, SLOT (checkUpdateAtLaunch()));
+ QTimer::singleShot (1000, this, SLOT (checkAtLaunch()));
+
#ifdef Q_WS_X11
mMainWindow->setStyleSheet("QToolButton { font-size: 11px}");
@@ -520,8 +523,10 @@ void UBApplicationController::downloadJsonFinished(QString currentJson)
}
}
-void UBApplicationController::checkUpdateAtLaunch()
+void UBApplicationController::checkAtLaunch()
{
+ UBOpenSankoreImporter();
+
if(UBSettings::settings()->appEnableAutomaticSoftwareUpdates->get().toBool()){
isNoUpdateDisplayed = false;
checkUpdate ();
diff --git a/src/core/UBApplicationController.h b/src/core/UBApplicationController.h
index 9ae6283f..6fbedc98 100644
--- a/src/core/UBApplicationController.h
+++ b/src/core/UBApplicationController.h
@@ -137,7 +137,7 @@ class UBApplicationController : public QObject
void actionPaste();
void checkUpdateRequest();
- void checkUpdateAtLaunch();
+ void checkAtLaunch();
private slots:
void updateRequestFinished(int id, bool error);
diff --git a/src/core/UBOpenSankoreImporter.cpp b/src/core/UBOpenSankoreImporter.cpp
new file mode 100644
index 00000000..6d141c0a
--- /dev/null
+++ b/src/core/UBOpenSankoreImporter.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
+ *
+ * This file is part of Open-Sankoré.
+ *
+ * Open-Sankoré is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License,
+ * with a specific linking exception for the OpenSSL project's
+ * "OpenSSL" library (or with modified versions of it that use the
+ * same license as the "OpenSSL" library).
+ *
+ * Open-Sankoré is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Open-Sankoré. If not, see .
+ */
+
+
+#include
+
+#include "UBOpenSankoreImporter.h"
+#include "UBSettings.h"
+
+#include "core/UBApplication.h"
+#include "gui/UBMainWindow.h"
+
+
+UBOpenSankoreImporter::UBOpenSankoreImporter(QObject *parent) :
+ QObject(parent)
+{
+ if(UBSettings::settings()->appLookForOpenSankoreInstall->get().toBool() &&
+ QDir(UBSettings::userDataDirectory().replace(qApp->applicationName(),"Sankore")).exists())
+ if(UBApplication::mainWindow->yesNoQuestion(tr("Open-Sankoré data detected"),tr("Open-Sankoré directory is present on the disk. It's possible to import the Open-Sankoré documents into OpenBoard as the preferences. Pushing Ok will close OpenBoard and run the importer application."))){
+ QProcess newProcess;
+ newProcess.startDetached(qApp->applicationDirPath()+"/Importer/OpenBoardImporter");
+ qApp->exit(0);
+ }
+}
+
+
diff --git a/src/core/UBOpenSankoreImporter.h b/src/core/UBOpenSankoreImporter.h
new file mode 100644
index 00000000..692ab38c
--- /dev/null
+++ b/src/core/UBOpenSankoreImporter.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
+ *
+ * This file is part of Open-Sankoré.
+ *
+ * Open-Sankoré is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License,
+ * with a specific linking exception for the OpenSSL project's
+ * "OpenSSL" library (or with modified versions of it that use the
+ * same license as the "OpenSSL" library).
+ *
+ * Open-Sankoré is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Open-Sankoré. If not, see .
+ */
+
+
+#ifndef UBOPENSANKOREIMPORTER_H
+#define UBOPENSANKOREIMPORTER_H
+
+#include
+
+class UBOpenSankoreImporter : public QObject
+{
+ Q_OBJECT
+public:
+ explicit UBOpenSankoreImporter(QObject *parent = 0);
+
+signals:
+
+public slots:
+
+};
+
+#endif // UBOPENSANKOREIMPORTER_H
diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp
index 607fb9ba..9d6d2ee8 100644
--- a/src/core/UBSettings.cpp
+++ b/src/core/UBSettings.cpp
@@ -226,7 +226,8 @@ void UBSettings::init()
appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false);
appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", "");
appLastSessionPageIndex = new UBSetting(this, "App", "LastSessionPageIndex", 0);
- appUseMultiscreen = new UBSetting(this, "App", "UseMusliscreenMode", true);
+ appUseMultiscreen = new UBSetting(this, "App", "UseMultiscreenMode", true);
+ appLookForOpenSankoreInstall = new UBSetting(this, "App", "LookForOpenSankoreInstall", true);
appStartMode = new UBSetting(this, "App", "StartMode", "");
diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h
index 55307a16..a2a50037 100644
--- a/src/core/UBSettings.h
+++ b/src/core/UBSettings.h
@@ -235,6 +235,7 @@ class UBSettings : public QObject
UBSetting* appLastSessionPageIndex;
UBSetting* appUseMultiscreen;
+ UBSetting* appLookForOpenSankoreInstall;
UBSetting* boardPenFineWidth;
UBSetting* boardPenMediumWidth;
diff --git a/src/core/core.pri b/src/core/core.pri
index c3462c83..ea545157 100644
--- a/src/core/core.pri
+++ b/src/core/core.pri
@@ -11,9 +11,10 @@ HEADERS += src/core/UB.h \
src/core/UBDisplayManager.h \
src/core/UBDocumentManager.h \
src/core/UBApplicationController.h \
- src/core/UBDownloadManager.h \
- src/core/UBDownloadThread.h
-
+ src/core/UBDownloadManager.h \
+ src/core/UBDownloadThread.h \
+ src/core/UBOpenSankoreImporter.h
+
SOURCES += src/core/main.cpp \
src/core/UBApplication.cpp \
src/core/UBSettings.cpp \
@@ -26,7 +27,8 @@ SOURCES += src/core/main.cpp \
src/core/UBDisplayManager.cpp \
src/core/UBDocumentManager.cpp \
src/core/UBApplicationController.cpp \
- src/core/UBDownloadManager.cpp \
- src/core/UBDownloadThread.cpp
-
-
+ src/core/UBDownloadManager.cpp \
+ src/core/UBDownloadThread.cpp \
+ src/core/UBOpenSankoreImporter.cpp
+
+
diff --git a/src/domain/UBGraphicsStrokesGroup.cpp b/src/domain/UBGraphicsStrokesGroup.cpp
index 4d114d65..d7590a39 100644
--- a/src/domain/UBGraphicsStrokesGroup.cpp
+++ b/src/domain/UBGraphicsStrokesGroup.cpp
@@ -181,10 +181,6 @@ void UBGraphicsStrokesGroup::paint(QPainter *painter, const QStyleOptionGraphics
{
// Never draw the rubber band, we draw our custom selection with the DelegateFrame
QStyleOptionGraphicsItem styleOption = QStyleOptionGraphicsItem(*option);
- bool selectedState = false;
- if (styleOption.state & QStyle::State_Selected) {
- selectedState = true;
- }
QStyle::State svState = option->state;
styleOption.state &= ~QStyle::State_Selected;
QGraphicsItemGroup::paint(painter, &styleOption, widget);