added importer

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 6549641fe1
commit 2eae1f37c2
  1. 21
      buildDebianPackage.sh
  2. 2
      src/board/UBBoardController.cpp
  3. 9
      src/core/UBApplicationController.cpp
  4. 2
      src/core/UBApplicationController.h
  5. 44
      src/core/UBOpenSankoreImporter.cpp
  6. 40
      src/core/UBOpenSankoreImporter.h
  7. 3
      src/core/UBSettings.cpp
  8. 1
      src/core/UBSettings.h
  9. 6
      src/core/core.pri
  10. 4
      src/domain/UBGraphicsStrokesGroup.cpp

@ -127,6 +127,17 @@ buildWithStandardQt(){
fi 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 # script
#********************** #**********************
@ -156,6 +167,10 @@ checkExecutable $QMAKE_PATH
checkExecutable $LRELEASES checkExecutable $LRELEASES
checkExecutable $ZIP_PATH checkExecutable $ZIP_PATH
#build third party application
buildImporter
notifyProgress "OpenBoardImporter" "Built Importer"
# cleaning the build directory # cleaning the build directory
rm -rf "build/linux/release" rm -rf "build/linux/release"
rm -rf install rm -rf install
@ -201,12 +216,16 @@ chmod a+x $PRODUCT_PATH/run.sh
cp -R resources/linux/qtlinux/* $PRODUCT_PATH/ 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/ cp -R $PLUGINS_PATH $PRODUCT_PATH/
# copying customization # copying customization
cp -R resources/customizations $PRODUCT_PATH/ 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 if [ $STANDARD_QT_USED == false ]; then
#copying custom qt library #copying custom qt library
mkdir -p $QT_LIBRARY_DEST_PATH mkdir -p $QT_LIBRARY_DEST_PATH

@ -153,6 +153,7 @@ void UBBoardController::init()
connect(UBApplication::mainWindow->actionGroupItems, SIGNAL(triggered()), this, SLOT(groupButtonClicked())); connect(UBApplication::mainWindow->actionGroupItems, SIGNAL(triggered()), this, SLOT(groupButtonClicked()));
undoRedoStateChange(true); undoRedoStateChange(true);
} }
@ -201,7 +202,6 @@ void UBBoardController::setupViews()
mPaletteManager = new UBBoardPaletteManager(mControlContainer, this); mPaletteManager = new UBBoardPaletteManager(mControlContainer, this);
connect(this, SIGNAL(activeSceneChanged()), mPaletteManager, SLOT(activeSceneChanged())); connect(this, SIGNAL(activeSceneChanged()), mPaletteManager, SLOT(activeSceneChanged()));
} }

@ -32,6 +32,8 @@
#include "core/UBSetting.h" #include "core/UBSetting.h"
#include "core/UBDocumentManager.h" #include "core/UBDocumentManager.h"
#include "core/UBDisplayManager.h" #include "core/UBDisplayManager.h"
#include "core/UBOpenSankoreImporter.h"
#include "board/UBBoardView.h" #include "board/UBBoardView.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
@ -113,7 +115,8 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView,
, this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&))); , this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&)));
networkAccessManager = new QNetworkAccessManager (this); networkAccessManager = new QNetworkAccessManager (this);
QTimer::singleShot (1000, this, SLOT (checkUpdateAtLaunch())); QTimer::singleShot (1000, this, SLOT (checkAtLaunch()));
#ifdef Q_WS_X11 #ifdef Q_WS_X11
mMainWindow->setStyleSheet("QToolButton { font-size: 11px}"); 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()){ if(UBSettings::settings()->appEnableAutomaticSoftwareUpdates->get().toBool()){
isNoUpdateDisplayed = false; isNoUpdateDisplayed = false;
checkUpdate (); checkUpdate ();

@ -137,7 +137,7 @@ class UBApplicationController : public QObject
void actionPaste(); void actionPaste();
void checkUpdateRequest(); void checkUpdateRequest();
void checkUpdateAtLaunch(); void checkAtLaunch();
private slots: private slots:
void updateRequestFinished(int id, bool error); void updateRequestFinished(int id, bool error);

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <QProcess>
#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);
}
}

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef UBOPENSANKOREIMPORTER_H
#define UBOPENSANKOREIMPORTER_H
#include <QObject>
class UBOpenSankoreImporter : public QObject
{
Q_OBJECT
public:
explicit UBOpenSankoreImporter(QObject *parent = 0);
signals:
public slots:
};
#endif // UBOPENSANKOREIMPORTER_H

@ -226,7 +226,8 @@ void UBSettings::init()
appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false); appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false);
appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", ""); appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", "");
appLastSessionPageIndex = new UBSetting(this, "App", "LastSessionPageIndex", 0); 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", ""); appStartMode = new UBSetting(this, "App", "StartMode", "");

@ -235,6 +235,7 @@ class UBSettings : public QObject
UBSetting* appLastSessionPageIndex; UBSetting* appLastSessionPageIndex;
UBSetting* appUseMultiscreen; UBSetting* appUseMultiscreen;
UBSetting* appLookForOpenSankoreInstall;
UBSetting* boardPenFineWidth; UBSetting* boardPenFineWidth;
UBSetting* boardPenMediumWidth; UBSetting* boardPenMediumWidth;

@ -12,7 +12,8 @@ HEADERS += src/core/UB.h \
src/core/UBDocumentManager.h \ src/core/UBDocumentManager.h \
src/core/UBApplicationController.h \ src/core/UBApplicationController.h \
src/core/UBDownloadManager.h \ src/core/UBDownloadManager.h \
src/core/UBDownloadThread.h src/core/UBDownloadThread.h \
src/core/UBOpenSankoreImporter.h
SOURCES += src/core/main.cpp \ SOURCES += src/core/main.cpp \
src/core/UBApplication.cpp \ src/core/UBApplication.cpp \
@ -27,6 +28,7 @@ SOURCES += src/core/main.cpp \
src/core/UBDocumentManager.cpp \ src/core/UBDocumentManager.cpp \
src/core/UBApplicationController.cpp \ src/core/UBApplicationController.cpp \
src/core/UBDownloadManager.cpp \ src/core/UBDownloadManager.cpp \
src/core/UBDownloadThread.cpp src/core/UBDownloadThread.cpp \
src/core/UBOpenSankoreImporter.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 // Never draw the rubber band, we draw our custom selection with the DelegateFrame
QStyleOptionGraphicsItem styleOption = QStyleOptionGraphicsItem(*option); QStyleOptionGraphicsItem styleOption = QStyleOptionGraphicsItem(*option);
bool selectedState = false;
if (styleOption.state & QStyle::State_Selected) {
selectedState = true;
}
QStyle::State svState = option->state; QStyle::State svState = option->state;
styleOption.state &= ~QStyle::State_Selected; styleOption.state &= ~QStyle::State_Selected;
QGraphicsItemGroup::paint(painter, &styleOption, widget); QGraphicsItemGroup::paint(painter, &styleOption, widget);

Loading…
Cancel
Save