diff --git a/release.macx.sh b/release.macx.sh index f285973c..1ea9576d 100755 --- a/release.macx.sh +++ b/release.macx.sh @@ -80,6 +80,22 @@ done } + +function addImporter { + importerDir="`pwd`/../OpenSankoreToOpenBoard" + importerName="OpenBoardImporter" + + if [ ! -e ${importerDir} ]; then + abort "${importerDir} not found" + fi + + cd ${importerDir} + $QMAKE ${importerName}.pro + make -j4 + $MACDEPLOYQT ${importerName}.app + cd - +} + trap "defaults write org.oe-f.OpenBoard.release Running -bool NO" EXIT notify "Running OpenBoard release script (`date`)" @@ -101,6 +117,8 @@ checkExecutable "$PLISTBUDDY" checkExecutable "$ICEBERG" checkExecutable "$LRELEASE" +addImporter + # delete the build directory notify "Cleaning ..." rm -rf "$BUILD_DIR" @@ -125,6 +143,7 @@ $LRELEASE $BASE_QT_TRANSLATIONS_DIRECTORY/translations.pro addQtTranslations cp -R resources/customizations $PRODUCT_DIR/$APPLICATION_NAME.app/Contents/Resources +cp -R $importerDir/$importerName.app $PRODUCT_DIR/$APPLICATION_NAME.app/Contents/Resources VERSION=`cat "$BUILD_DIR/version"` if [ ! -f "$BUILD_DIR/version" ]; then diff --git a/src/core/UBOpenSankoreImporter.cpp b/src/core/UBOpenSankoreImporter.cpp index 6d141c0a..669216f1 100644 --- a/src/core/UBOpenSankoreImporter.cpp +++ b/src/core/UBOpenSankoreImporter.cpp @@ -33,12 +33,19 @@ UBOpenSankoreImporter::UBOpenSankoreImporter(QObject *parent) : QObject(parent) { if(UBSettings::settings()->appLookForOpenSankoreInstall->get().toBool() && - QDir(UBSettings::userDataDirectory().replace(qApp->applicationName(),"Sankore")).exists()) + 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; +#ifdef Q_WS_X11 newProcess.startDetached(qApp->applicationDirPath()+"/Importer/OpenBoardImporter"); +#elif defined Q_WS_MACX + newProcess.startDetached(qApp->applicationDirPath()+"/../Resources/OpenBoardImporter.app/Contents/MacOS/OpenBoardImporter"); +#else + newProcess.startDetached(qApp->applicationDirPath()+"/Importer/OpenBoardImporter.exe"); +#endif qApp->exit(0); } + } }