From a2654f8a8f1a5f0bfd196b357e023c7f355bfc65 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 2 Aug 2012 11:30:11 +0200 Subject: [PATCH 1/8] some cosmetics --- Sankore_3.1.pro | 78 ++++++++------------------------------------- Subdirs.pro | 33 ------------------- plugins/plugins.pri | 6 ++++ 3 files changed, 19 insertions(+), 98 deletions(-) delete mode 100644 Subdirs.pro create mode 100644 plugins/plugins.pri diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index 9da0c92a..c6c5bfac 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -7,19 +7,6 @@ CONFIG -= flat CONFIG += debug_and_release \ no_include_pwd -linux-g++-64 { - CONFIG += link_prl -} - - -linux-g++-32 { - CONFIG += link_prl -} - - -linux-g++ { - CONFIG += link_prl -} VERSION_MAJ = 2 VERSION_MIN = 00 @@ -46,7 +33,6 @@ QT += script QT += xmlpatterns INCLUDEPATH += src -INCLUDEPATH += plugins/cffadaptor/src include($$THIRD_PARTY_PATH/libs.pri) include(src/adaptors/adaptors.pri) @@ -70,6 +56,13 @@ include(src/customWidgets/customWidgets.pri) DEPENDPATH += src/pdf-merger INCLUDEPATH += src/pdf-merger include(src/pdf-merger/pdfMerger.pri) + +#plugins +include(plugins/plugins.pri) +INCLUDEPATH += plugins/cffadaptor/src + + +#ThirdParty DEPENDPATH += $$THIRD_PARTY_PATH/quazip/ INCLUDEPATH += $$THIRD_PARTY_PATH/quazip/ include($$THIRD_PARTY_PATH/quazip/quazip.pri) @@ -103,9 +96,7 @@ BUILD_DIR = build macx:BUILD_DIR = $$BUILD_DIR/macx win32:BUILD_DIR = $$BUILD_DIR/win32 -linux-g++:BUILD_DIR = $$BUILD_DIR/linux -linux-g++-32:BUILD_DIR = $$BUILD_DIR/linux -linux-g++-64:BUILD_DIR = $$BUILD_DIR/linux +linux-g++*:BUILD_DIR = $$BUILD_DIR/linux CONFIG(debug, debug|release):BUILD_DIR = $$BUILD_DIR/debug CONFIG(release, debug|release) { @@ -119,16 +110,12 @@ MOC_DIR = $$BUILD_DIR/moc RCC_DIR = $$BUILD_DIR/rcc UI_DIR = $$BUILD_DIR/ui -#LIBS += "-Lplugins/cffadaptor/$$BUILD_DIR/lib" "-lCFF_Adaptor" - win32 { RC_FILE = resources/win/sankore.rc CONFIG += qaxcontainer exists(console):CONFIG += console - QMAKE_CXXFLAGS += \ - /MP - QMAKE_CXXFLAGS_RELEASE += /Od \ - /Zi + QMAKE_CXXFLAGS += /MP + QMAKE_CXXFLAGS_RELEASE += /Od /Zi QMAKE_LFLAGS_RELEASE += /DEBUG UB_LIBRARY.path = $$DESTDIR UB_I18N.path = $$DESTDIR/i18n @@ -360,39 +347,9 @@ macx { system(printf "%02x%02x%02x%02x" `printf $$VERSION_RC | cut -d ',' -f 1` `printf $$VERSION_RC | cut -d ',' -f 2` `printf $$VERSION_RC | cut -d ',' -f 3` `printf $$VERSION_RC | cut -d ',' -f 4` | xxd -r -p > "$$VERSION_RC_PATH") } -linux-g++ { - LIBS += -lcrypto - LIBS += -lX11 - QMAKE_CFLAGS += -fopenmp - QMAKE_CXXFLAGS += -fopenmp - QMAKE_LFLAGS += -fopenmp - UB_LIBRARY.path = $$DESTDIR - UB_I18N.path = $$DESTDIR/i18n - UB_ETC.path = $$DESTDIR - UB_THIRDPARTY_INTERACTIVE.path = $$DESTDIR/library - system(mkdir -p $$BUILD_DIR) - system(echo "$$VERSION" > $$BUILD_DIR/version) - system(echo "$$LONG_VERSION" > $$BUILD_DIR/longversion) - system(echo "$$SVN_VERSION" > $$BUILD_DIR/svnversion) -} - -linux-g++-32 { - LIBS += -lcrypto - LIBS += -lX11 - QMAKE_CFLAGS += -fopenmp - QMAKE_CXXFLAGS += -fopenmp - QMAKE_LFLAGS += -fopenmp - UB_LIBRARY.path = $$DESTDIR - UB_I18N.path = $$DESTDIR/i18n - UB_ETC.path = $$DESTDIR - UB_THIRDPARTY_INTERACTIVE.path = $$DESTDIR/library - system(mkdir -p $$BUILD_DIR) - system(echo "$$VERSION" > $$BUILD_DIR/version) - system(echo "$$LONG_VERSION" > $$BUILD_DIR/longversion) - system(echo "$$SVN_VERSION" > $$BUILD_DIR/svnversion) -} - -linux-g++-64 { +linux-g++* { + message(LINUX) + CONFIG += link_prl LIBS += -lcrypto LIBS += -lX11 QMAKE_CFLAGS += -fopenmp @@ -442,12 +399,3 @@ INSTALLS = UB_ETC \ UB_LIBRARY \ UB_THIRDPARTY_INTERACTIVE -HEADERS += \ - plugins/cffadaptor/src/UBGlobals.h \ - plugins/cffadaptor/src/UBCFFConstants.h \ - plugins/cffadaptor/src/UBCFFAdaptor.h \ - plugins/cffadaptor/src/UBCFFAdaptor_global.h - -SOURCES += \ - plugins/cffadaptor/src/UBCFFAdaptor.cpp - diff --git a/Subdirs.pro b/Subdirs.pro deleted file mode 100644 index 192aeaf7..00000000 --- a/Subdirs.pro +++ /dev/null @@ -1,33 +0,0 @@ -TEMPLATE = subdirs -CONFIG += ordered -CONFIG += debug_and_release - -win32: SUB_DIR = win32 -macx: SUB_DIR = macx -linux-g++: SUB_DIR = linux -linux-g++-32: SUB_DIR = linux -linux-g++-64: SUB_DIR = linux - -BUILD_DIR = build/$$SUB_DIR - -CONFIG(debug, debug|release):BUILD_DIR = $$BUILD_DIR/debug -CONFIG(release, debug|release) { - BUILD_DIR = $$BUILD_DIR/release - CONFIG += warn_off -} - -SANKORE_DIR = $$PWD -SANKORE_PRO = $$SANKORE_DIR/Sankore_3.1.pro -THIRD_PARTY_DIR = $$PWD/Sankore-ThirdParty -SANKORE_PLUGINS_DIR = $$SANKORE_DIR/plugins -PLUGIN_CFF_ADAPTOR_DIR = $$SANKORE_PLUGINS_DIR/cffadaptor -PLUGIN_CFF_ADAPTOR_PRO = $$PLUGIN_CFF_ADAPTOR_DIR/UBCFFAdaptor.pro - -#visoal studio sets first project as executable -contains(TEMPLATE, vcsubdirs):{ - SUBDIRS = $$SANKORE_PRO $$PLUGIN_CFF_ADAPTOR_PRO -} else:{ - SUBDIRS = $$PLUGIN_CFF_ADAPTOR_PRO $$SANKORE_PRO -} - -$$SANKORE_PRO.depends = $$PLUGIN_CFF_ADAPTOR_PRO diff --git a/plugins/plugins.pri b/plugins/plugins.pri new file mode 100644 index 00000000..ddf3113a --- /dev/null +++ b/plugins/plugins.pri @@ -0,0 +1,6 @@ +HEADERS += plugins/cffadaptor/src/UBCFFAdaptor_global.h \ + plugins/cffadaptor/src/UBCFFAdaptor.h \ + plugins/cffadaptor/src/UBCFFConstants.h \ + plugins/cffadaptor/src/UBGlobals.h + +SOURCES += plugins/cffadaptor/src/UBCFFAdaptor.cpp From 4027a6e7b5208e07f7f04940d50c30cb2efc8fa9 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 2 Aug 2012 13:10:19 +0200 Subject: [PATCH 2/8] some other cosmetics --- Sankore_3.1.pro | 1 - buildDebianPackage | 44 +++++++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index c6c5bfac..b885459b 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -348,7 +348,6 @@ macx { } linux-g++* { - message(LINUX) CONFIG += link_prl LIBS += -lcrypto LIBS += -lX11 diff --git a/buildDebianPackage b/buildDebianPackage index 5835b9bf..e47bf0af 100755 --- a/buildDebianPackage +++ b/buildDebianPackage @@ -29,11 +29,25 @@ do done +NOTIFY_CMD=`which notify-send` + notifyError(){ - notify-send -t 0 "Error occoured" "An error occours during the sankore build:\n\t$1" -i /usr/share/icons/oxygen/64x64/status/dialog-error.png + if [ -e "$NOTIFY_CMD" ]; then + $NOTIFY_CMD -t 0 -i "/usr/share/icons/oxygen/64x64/status/dialog-error.png" "$1" + else + printf "\033[31merror:\033[0m $1\n" + fi exit 1 } +notifyProgress(){ + if [ -e "$NOTIFY_CMD" ]; then + $NOTIFY_CMD "$1" "$2" + else + printf "\033[32m--> Achieved task:\033[0m $1:\n\t$2\n" + fi +} + alertIfPreviousVersionInstalled(){ APT_CACHE=`which apt-cache` if [ ! -e "$APT_CACHE" ]; then @@ -67,7 +81,7 @@ if [ ! -e "$PLUGINS_PATH" ]; then notifyError "plugins path not found at $PLUGINS_PATH" fi -notify-send "Open-Sankore" "Building Open-Sankore ..." +notifyProgress "Open-Sankore" "Building Open-Sankore ..." if [ "$ARCHITECTURE" == "x86_64" ]; then $QMAKE_PATH Sankore_3.1.pro -spec linux-g++-64 @@ -77,14 +91,20 @@ fi make -j 4 release-install -notify-send "Git Hub" "Make a tag of the delivered version" +if [ ! -e "build/linux/release/product/Open-Sankore" ]; then + notifyError "Open-Sankore build failed" +fi + +notifyProgress "Git Hub" "Make a tag of the delivered version" + VERSION=`cat build/linux/release/version` + if [ ! -f build/linux/release/version ]; then notifyError "version not found" else LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then - echo creating a tag with the version $VERSION + notifyProgress creating a tag with the version $VERSION if [ $MAKE_TAG == true ]; then git tag -a "v$VERSION" -m "Generating setup for v$VERSION" git push origin --tags @@ -97,7 +117,7 @@ chmod +x build/linux/release/product/run.sh cp -R resources/linux/qtlinux/* build/linux/release/product/ -notify-send "QT" "Coping plugins and library ..." +notifyProgress "QT" "Coping plugins and library ..." cp -R $PLUGINS_PATH build/linux/release/product/ #copying custom qt library @@ -136,7 +156,7 @@ else cp "$QT_LIBRARY_SOURCE_PATH/libQtWebKit.so.4.9.0" "$QT_LIBRARY_DEST_PATH/" fi -notify-send "QT" "Internalization ..." +notifyProgress "QT" "Internalization ..." if [ ! -e $GUI_TRANSLATIONS_DIRECTORY_PATH ]; then notifyError "gui translations pro file not found at: $GUI_TRANSLATIONS_DIRECTORY_PATH" else @@ -162,7 +182,7 @@ cd build/linux/release/product find . -name .svn -exec rm -rf {} \; 2> /dev/null cd - -notify-send "Building Sankore" "Finished to build Sankore building the package" +notifyProgress "Building Sankore" "Finished to build Sankore building the package" BASE_WORKING_DIR="packageBuildDir" @@ -288,12 +308,6 @@ for l in `objdump -p $SANKORE_PACKAGE_DIRECTORY/Open-Sankore | grep NEEDED | awk done; done; -#additional dependencies -#tab[$count]="gtk2-engines-pixbuf" -#((count++)) -#tab[$count]="ttf-mscorefonts-installer" -#((count++)) - for ((i=0;i<${#tab[@]};i++)); do if [ $i -ne "0" ]; then echo -n ", " >> "$CONTROL_FILE" @@ -328,7 +342,7 @@ DEBIAN_PACKAGE_NAME="Open-Sankore_${VERSION}_$ARCHITECTURE.deb" fakeroot chown -R root:root $BASE_WORKING_DIR dpkg -b "$BASE_WORKING_DIR" "install/linux/$DEBIAN_PACKAGE_NAME" -notify-send "Open-Sankore" "Package built" +notifyProgress "Open-Sankore" "Package built" #clean up mess fakeroot rm -rf $BASE_WORKING_DIR @@ -341,6 +355,6 @@ if [ $CREATE_DIENA_DISTRIBUTION_ZIP == true ]; then `which zip` -1 --junk-paths ${ZIP_NAME} ${DEBIAN_PACKAGE_NAME} ../../ReleaseNotes.pdf ../../JournalDesModifications.pdf cd - - notify-send "Open-Sankore" "Build Diena zip file for distribution" + notifyProgress "Open-Sankore" "Build Diena zip file for distribution" fi From e5b8f058e84221399fe10d3528db09a65adf627e Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 2 Aug 2012 15:41:33 +0200 Subject: [PATCH 3/8] removed accents on file name --- ...rand noir.png => quadrille grand noir.png} | Bin ...png => quadrille grand noir.thumbnail.png} | Bin ...rand vert.png => quadrille grand vert.png} | Bin ...png => quadrille grand vert.thumbnail.png} | Bin ...etit bleu.png => quadrille petit bleu.png} | Bin ...png => quadrille petit bleu.thumbnail.png} | Bin .../jaune.png | Bin .../jaune.thumbnail.png | Bin .../jaune_pale.png | Bin .../jaune_pale.thumbnail.png | Bin .../rouge.png | Bin .../rouge.thumbnail.png | Bin .../rouge_pale.png | Bin .../rouge_pale.thumbnail.png | Bin .../vert.png | Bin .../vert.thumbnail.png | Bin .../vert_pale.png | Bin .../vert_pale.thumbnail.png | Bin .../violet.png | Bin .../violet.thumbnail.png | Bin .../violet_pale.png | Bin .../violet_pale.thumbnail.png | Bin .../{clé de sol.png => cle de sol.png} | Bin ...thumbnail.png => cle de sol.thumbnail.png} | Bin .../{jeu d'échelle.jpg => jeu d'echelle.jpg} | Bin ...mbnail.png => jeu d'echelle.thumbnail.png} | Bin src/frameworks/UBPlatformUtils_mac.mm | 28 ------------------ 27 files changed, 28 deletions(-) rename resources/library/pictures/Fonds/Carroyage et lignes/{quadrillé grand noir.png => quadrille grand noir.png} (100%) rename resources/library/pictures/Fonds/Carroyage et lignes/{quadrillé grand noir.thumbnail.png => quadrille grand noir.thumbnail.png} (100%) rename resources/library/pictures/Fonds/Carroyage et lignes/{quadrillé grand vert.png => quadrille grand vert.png} (100%) rename resources/library/pictures/Fonds/Carroyage et lignes/{quadrillé grand vert.thumbnail.png => quadrille grand vert.thumbnail.png} (100%) rename resources/library/pictures/Fonds/Carroyage et lignes/{quadrillé petit bleu.png => quadrille petit bleu.png} (100%) rename resources/library/pictures/Fonds/Carroyage et lignes/{quadrillé petit bleu.thumbnail.png => quadrille petit bleu.thumbnail.png} (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/jaune.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/jaune.thumbnail.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/jaune_pale.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/jaune_pale.thumbnail.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/rouge.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/rouge.thumbnail.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/rouge_pale.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/rouge_pale.thumbnail.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/vert.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/vert.thumbnail.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/vert_pale.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/vert_pale.thumbnail.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/violet.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/violet.thumbnail.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/violet_pale.png (100%) rename resources/library/pictures/Fonds/{Fonds colorés => Fonds colorees}/violet_pale.thumbnail.png (100%) rename resources/library/pictures/Fonds/Musique/{clé de sol.png => cle de sol.png} (100%) rename resources/library/pictures/Fonds/Musique/{clé de sol.thumbnail.png => cle de sol.thumbnail.png} (100%) rename resources/library/pictures/Fonds/Plateaux jeux/{jeu d'échelle.jpg => jeu d'echelle.jpg} (100%) rename resources/library/pictures/Fonds/Plateaux jeux/{jeu d'échelle.thumbnail.png => jeu d'echelle.thumbnail.png} (100%) diff --git a/resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand noir.png b/resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand noir.png similarity index 100% rename from resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand noir.png rename to resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand noir.png diff --git a/resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand noir.thumbnail.png b/resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand noir.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand noir.thumbnail.png rename to resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand noir.thumbnail.png diff --git a/resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand vert.png b/resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand vert.png similarity index 100% rename from resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand vert.png rename to resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand vert.png diff --git a/resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand vert.thumbnail.png b/resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand vert.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Carroyage et lignes/quadrillé grand vert.thumbnail.png rename to resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand vert.thumbnail.png diff --git a/resources/library/pictures/Fonds/Carroyage et lignes/quadrillé petit bleu.png b/resources/library/pictures/Fonds/Carroyage et lignes/quadrille petit bleu.png similarity index 100% rename from resources/library/pictures/Fonds/Carroyage et lignes/quadrillé petit bleu.png rename to resources/library/pictures/Fonds/Carroyage et lignes/quadrille petit bleu.png diff --git a/resources/library/pictures/Fonds/Carroyage et lignes/quadrillé petit bleu.thumbnail.png b/resources/library/pictures/Fonds/Carroyage et lignes/quadrille petit bleu.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Carroyage et lignes/quadrillé petit bleu.thumbnail.png rename to resources/library/pictures/Fonds/Carroyage et lignes/quadrille petit bleu.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/jaune.png b/resources/library/pictures/Fonds/Fonds colorees/jaune.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/jaune.png rename to resources/library/pictures/Fonds/Fonds colorees/jaune.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/jaune.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/jaune.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/jaune.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/jaune.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/jaune_pale.png b/resources/library/pictures/Fonds/Fonds colorees/jaune_pale.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/jaune_pale.png rename to resources/library/pictures/Fonds/Fonds colorees/jaune_pale.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/jaune_pale.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/jaune_pale.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/jaune_pale.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/jaune_pale.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/rouge.png b/resources/library/pictures/Fonds/Fonds colorees/rouge.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/rouge.png rename to resources/library/pictures/Fonds/Fonds colorees/rouge.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/rouge.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/rouge.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/rouge.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/rouge.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/rouge_pale.png b/resources/library/pictures/Fonds/Fonds colorees/rouge_pale.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/rouge_pale.png rename to resources/library/pictures/Fonds/Fonds colorees/rouge_pale.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/rouge_pale.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/rouge_pale.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/rouge_pale.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/rouge_pale.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/vert.png b/resources/library/pictures/Fonds/Fonds colorees/vert.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/vert.png rename to resources/library/pictures/Fonds/Fonds colorees/vert.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/vert.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/vert.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/vert.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/vert.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/vert_pale.png b/resources/library/pictures/Fonds/Fonds colorees/vert_pale.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/vert_pale.png rename to resources/library/pictures/Fonds/Fonds colorees/vert_pale.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/vert_pale.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/vert_pale.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/vert_pale.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/vert_pale.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/violet.png b/resources/library/pictures/Fonds/Fonds colorees/violet.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/violet.png rename to resources/library/pictures/Fonds/Fonds colorees/violet.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/violet.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/violet.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/violet.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/violet.thumbnail.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/violet_pale.png b/resources/library/pictures/Fonds/Fonds colorees/violet_pale.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/violet_pale.png rename to resources/library/pictures/Fonds/Fonds colorees/violet_pale.png diff --git a/resources/library/pictures/Fonds/Fonds colorés/violet_pale.thumbnail.png b/resources/library/pictures/Fonds/Fonds colorees/violet_pale.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Fonds colorés/violet_pale.thumbnail.png rename to resources/library/pictures/Fonds/Fonds colorees/violet_pale.thumbnail.png diff --git a/resources/library/pictures/Fonds/Musique/clé de sol.png b/resources/library/pictures/Fonds/Musique/cle de sol.png similarity index 100% rename from resources/library/pictures/Fonds/Musique/clé de sol.png rename to resources/library/pictures/Fonds/Musique/cle de sol.png diff --git a/resources/library/pictures/Fonds/Musique/clé de sol.thumbnail.png b/resources/library/pictures/Fonds/Musique/cle de sol.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Musique/clé de sol.thumbnail.png rename to resources/library/pictures/Fonds/Musique/cle de sol.thumbnail.png diff --git a/resources/library/pictures/Fonds/Plateaux jeux/jeu d'échelle.jpg b/resources/library/pictures/Fonds/Plateaux jeux/jeu d'echelle.jpg similarity index 100% rename from resources/library/pictures/Fonds/Plateaux jeux/jeu d'échelle.jpg rename to resources/library/pictures/Fonds/Plateaux jeux/jeu d'echelle.jpg diff --git a/resources/library/pictures/Fonds/Plateaux jeux/jeu d'échelle.thumbnail.png b/resources/library/pictures/Fonds/Plateaux jeux/jeu d'echelle.thumbnail.png similarity index 100% rename from resources/library/pictures/Fonds/Plateaux jeux/jeu d'échelle.thumbnail.png rename to resources/library/pictures/Fonds/Plateaux jeux/jeu d'echelle.thumbnail.png diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index 7f420e8e..66191a95 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -184,34 +184,6 @@ void UBPlatformUtils::fadeDisplayIn() } } - -//QString UBPlatformUtils::preferredTranslation(QString pFilePrefix) -//{ -// QString qmPath; -// NSString* filePrefix = [[NSString alloc] initWithUTF8String:(const char*)(pFilePrefix.toUtf8())]; - -// NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - -// NSString *lprojPath = [[[NSBundle mainBundle] pathForResource:@"Localizable" ofType:@"strings"] stringByDeletingLastPathComponent]; -// if (lprojPath) -// { -// NSString *lang = [[lprojPath lastPathComponent] stringByDeletingPathExtension]; -// NSString *translationFilePath = [lprojPath stringByAppendingPathComponent:[[filePrefix stringByAppendingString:lang] stringByAppendingPathExtension:@"qm"]]; -// qmPath = QString::fromUtf8([translationFilePath UTF8String], strlen([translationFilePath UTF8String])); -// } - -// [pool drain]; -// return qmPath; -//} - -//QString UBPlatformUtils::preferredLanguage() -//{ -// QFileInfo qmFileInfo = QFileInfo(preferredTranslation("sankore_")); -// QDir lprojPath = qmFileInfo.dir(); -// QFileInfo lprojFileInfo = QFileInfo(lprojPath.absolutePath()); -// return lprojFileInfo.baseName(); -//} - QStringList UBPlatformUtils::availableTranslations() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; From 5212f4e2225847ddb310656599f763dbfdbe5715 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 2 Aug 2012 15:50:23 +0200 Subject: [PATCH 4/8] last cosmetics on this script --- buildDebianPackage | 194 ++++++++++++++++++++++++--------------------- 1 file changed, 102 insertions(+), 92 deletions(-) diff --git a/buildDebianPackage b/buildDebianPackage index e47bf0af..3eaaaef1 100755 --- a/buildDebianPackage +++ b/buildDebianPackage @@ -14,22 +14,37 @@ # along with this program. If not, see . # --------------------------------------------------------------------- -MAKE_TAG=true -CREATE_DIENA_DISTRIBUTION_ZIP=false +#********************** +# functions +#********************** + +initializeVariables() +{ + MAKE_TAG=true + CREATE_DIENA_DISTRIBUTION_ZIP=false + + PRODUCT_PATH="build/linux/release/product" + QT_PATH="/usr/local/Trolltech/Qt-4.8.0" + PLUGINS_PATH="$QT_PATH/plugins" + GUI_TRANSLATIONS_DIRECTORY_PATH="../Qt-4.8/translations" + QT_LIBRARY_DEST_PATH="$PRODUCT_PATH/qtlib" + QT_LIBRARY_SOURCE_PATH="$QT_PATH/lib" + ARCHITECTURE=`uname -m` + if [ "$ARCHITECTURE" == "x86_64" ]; then + ARCHITECTURE="amd64" + fi + if [ "$ARCHITECTURE" == "i686" ]; then + ARCHITECTURE="i386" + fi + + NOTIFY_CMD=`which notify-send` + QMAKE_PATH="$QT_PATH/bin/qmake" + LRELEASES="$QT_PATH/bin/lrelease" + ZIP_PATH=`which zip` -for var in "$@" -do - if [ $var == "notag" ]; then - MAKE_TAG=false; - fi - if [ $var == "diena" ]; then - CREATE_DIENA_DISTRIBUTION_ZIP=true; - fi -done - +} -NOTIFY_CMD=`which notify-send` notifyError(){ if [ -e "$NOTIFY_CMD" ]; then @@ -60,30 +75,70 @@ alertIfPreviousVersionInstalled(){ fi } +checkDir(){ + if [ ! -d "$1" ]; then + notifyError "Directory not found : $1" + fi +} + +checkExecutable(){ + if [ ! -e "$1" ]; then + notifyError "$1 command not found" + fi +} + +copyQtLibrary(){ + if ls "$QT_LIBRARY_SOURCE_PATH/$1.so" &> /dev/null; then + cp $QT_LIBRARY_SOURCE_PATH/$1.so.? "$QT_LIBRARY_DEST_PATH/" + cp $QT_LIBRARY_SOURCE_PATH/$1.so.?.?.? "$QT_LIBRARY_DEST_PATH/" + else + notifyError "$1 library not found in path: $QT_LIBRARY_SOURCE_PATH" + fi +} + +#********************** +# script +#********************** + + +initializeVariables + + +for var in "$@" +do + if [ $var == "notag" ]; then + MAKE_TAG=false; + fi + if [ $var == "diena" ]; then + CREATE_DIENA_DISTRIBUTION_ZIP=true; + fi +done + + alertIfPreviousVersionInstalled +#check of directories and executables +checkDir $QT_PATH +checkDir $PLUGINS_PATH +checkDir $GUI_TRANSLATIONS_DIRECTORY_PATH +checkExecutable $QMAKE_PATH +checkExecutable $LRELEASES +checkExecutable $ZIP_PATH + +# cleaning the build directory rm -rf "build/linux/release" rm -rf install -QT_PATH="/usr/local/Trolltech/Qt-4.8.0" -PLUGINS_PATH="$QT_PATH/plugins" -QMAKE_PATH="$QT_PATH/bin/qmake" -LRELEASES="$QT_PATH/bin/lrelease" -GUI_TRANSLATIONS_DIRECTORY_PATH="../Qt-4.8/translations" -ARCHITECTURE=`uname -m` - -if [ ! -e "$QMAKE_PATH" ]; then - notifyError "qmake command not found at $QMAKE_PATH" -fi - -if [ ! -e "$PLUGINS_PATH" ]; then - notifyError "plugins path not found at $PLUGINS_PATH" -fi +notifyProgress "QT" "Internalization" +$LRELEASES Sankore_3.1.pro +cd $GUI_TRANSLATIONS_DIRECTORY_PATH +$LRELEASES translations.pro +cd - -notifyProgress "Open-Sankore" "Building Open-Sankore ..." +notifyProgress "Open-Sankore" "Building Open-Sankore" -if [ "$ARCHITECTURE" == "x86_64" ]; then +if [ "$ARCHITECTURE" == "amd64" ]; then $QMAKE_PATH Sankore_3.1.pro -spec linux-g++-64 else $QMAKE_PATH Sankore_3.1.pro -spec linux-g++ @@ -91,7 +146,7 @@ fi make -j 4 release-install -if [ ! -e "build/linux/release/product/Open-Sankore" ]; then +if [ ! -e "$PRODUCT_PATH/Open-Sankore" ]; then notifyError "Open-Sankore build failed" fi @@ -104,35 +159,23 @@ if [ ! -f build/linux/release/version ]; then else LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then - notifyProgress creating a tag with the version $VERSION - if [ $MAKE_TAG == true ]; then + if [ $MAKE_TAG == true ]; then git tag -a "v$VERSION" -m "Generating setup for v$VERSION" git push origin --tags fi fi fi -cp resources/linux/run.sh build/linux/release/product -chmod +x build/linux/release/product/run.sh +cp resources/linux/run.sh $PRODUCT_PATH +chmod a+x $PRODUCT_PATH/run.sh -cp -R resources/linux/qtlinux/* build/linux/release/product/ +cp -R resources/linux/qtlinux/* $PRODUCT_PATH/ notifyProgress "QT" "Coping plugins and library ..." -cp -R $PLUGINS_PATH build/linux/release/product/ +cp -R $PLUGINS_PATH $PRODUCT_PATH/ #copying custom qt library -QT_LIBRARY_DEST_PATH="build/linux/release/product/qtlib" -mkdir $QT_LIBRARY_DEST_PATH -QT_LIBRARY_SOURCE_PATH="$QT_PATH/lib" - -copyQtLibrary(){ - if [ ! -e "$QT_LIBRARY_SOURCE_PATH/$1.so.4.8.0" ]; then - notifyError "$1 library not found in path: $QT_LIBRARY_SOURCE_PATH" - fi - cp "$QT_LIBRARY_SOURCE_PATH/$1.so.4" "$QT_LIBRARY_DEST_PATH/" - cp "$QT_LIBRARY_SOURCE_PATH/$1.so.4.8.0" "$QT_LIBRARY_DEST_PATH/" -} - +mkdir -p $QT_LIBRARY_DEST_PATH copyQtLibrary libQtDBus copyQtLibrary libQtScript copyQtLibrary libQtSvg @@ -141,49 +184,25 @@ copyQtLibrary libQtNetwork copyQtLibrary libQtXml copyQtLibrary libQtGui copyQtLibrary libQtCore +copyQtLibrary libphonon +copyQtLibrary libQtWebKit -if [ ! -e "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4.4.0" ]; then - notifyError "phonon library not found in path: $QT_LIBRARY_SOURCE_PATH" -else - cp "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4" "$QT_LIBRARY_DEST_PATH/" - cp "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4.4.0" "$QT_LIBRARY_DEST_PATH/" +notifyProgress "QT" "Internalization" +if [ ! -e $PRODUCT_PATH/i18n ]; then + mkdir $PRODUCT_PATH/i18n fi - -if [ ! -e "$QT_LIBRARY_SOURCE_PATH/libQtWebKit.so.4.9.0" ]; then - notifyError "webkit library not found in path: $QT_LIBRARY_SOURCE_PATH" -else - cp "$QT_LIBRARY_SOURCE_PATH/libQtWebKit.so.4" "$QT_LIBRARY_DEST_PATH/" - cp "$QT_LIBRARY_SOURCE_PATH/libQtWebKit.so.4.9.0" "$QT_LIBRARY_DEST_PATH/" -fi - -notifyProgress "QT" "Internalization ..." -if [ ! -e $GUI_TRANSLATIONS_DIRECTORY_PATH ]; then - notifyError "gui translations pro file not found at: $GUI_TRANSLATIONS_DIRECTORY_PATH" -else - cd $GUI_TRANSLATIONS_DIRECTORY_PATH - $LRELEASES translations.pro - cd - - if [ ! -e build/linux/release/product/i18n ]; then - mkdir build/linux/release/product/i18n - fi - #copying qt gui translation - cp $GUI_TRANSLATIONS_DIRECTORY_PATH/qt_??.qm build/linux/release/product/i18n/ -fi - -$LRELEASES Sankore_3.1.pro -cp resources/i18n/*.qm build/linux/release/product/i18n/ +#copying qt gui translation +cp $GUI_TRANSLATIONS_DIRECTORY_PATH/qt_??.qm $PRODUCT_PATH/i18n/ rm -rf install/linux mkdir -p install/linux -cd build/linux/release/product - #Removing .svn directories ... +cd $PRODUCT_PATH find . -name .svn -exec rm -rf {} \; 2> /dev/null - cd - -notifyProgress "Building Sankore" "Finished to build Sankore building the package" +notifyProgress "Building Sankore" "Finished to build Sankore building the package" BASE_WORKING_DIR="packageBuildDir" @@ -242,7 +261,7 @@ EOF SANKORE_DIRECTORY_NAME="Open-Sankore-$VERSION" SANKORE_PACKAGE_DIRECTORY="$BASE_WORKING_DIR/usr/local/$SANKORE_DIRECTORY_NAME" #move sankore build directory to packages directory -cp -R build/linux/release/product $SANKORE_PACKAGE_DIRECTORY +cp -R $PRODUCT_PATH $SANKORE_PACKAGE_DIRECTORY cat > $BASE_WORKING_DIR/usr/local/$SANKORE_DIRECTORY_NAME/run.sh << EOF @@ -270,14 +289,6 @@ CHANGE_LOG_FILE="$BASE_WORKING_DIR/DEBIAN/changelog-sankore-$VERSION.txt" CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control" CHANGE_LOG_TEXT="changelog.txt" -if [ "$ARCHITECTURE" == "x86_64" ]; then - ARCHITECTURE="amd64" -fi - -if [ "$ARCHITECTURE" == "i686" ]; then - ARCHITECTURE="i386" -fi - echo "Open-Sankore ($VERSION) $ARCHITECTURE; urgency=low" > "$CHANGE_LOG_FILE" echo >> "$CHANGE_LOG_FILE" cat $CHANGE_LOG_TEXT >> "$CHANGE_LOG_FILE" @@ -352,9 +363,8 @@ if [ $CREATE_DIENA_DISTRIBUTION_ZIP == true ]; then ZIP_NAME="Open-Sankoré_`lsb_release -is`_`lsb_release -rs`_${VERSION}_${ARCHITECTURE}.zip" cd install/linux - `which zip` -1 --junk-paths ${ZIP_NAME} ${DEBIAN_PACKAGE_NAME} ../../ReleaseNotes.pdf ../../JournalDesModifications.pdf + $ZIP_PATH -1 --junk-paths ${ZIP_NAME} ${DEBIAN_PACKAGE_NAME} ../../ReleaseNotes.pdf ../../JournalDesModifications.pdf cd - - notifyProgress "Open-Sankore" "Build Diena zip file for distribution" fi From bfbae8a835f9cf6bfec583acb7a74853cfeeff10 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 2 Aug 2012 16:25:36 +0200 Subject: [PATCH 5/8] merged the two script qt custom and qt standard build --- buildDebianPackage | 47 +++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/buildDebianPackage b/buildDebianPackage index 3eaaaef1..0306a2c9 100755 --- a/buildDebianPackage +++ b/buildDebianPackage @@ -2,7 +2,7 @@ # -------------------------------------------------------------------- # This program 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, either version 3 of the License, or +# the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -23,6 +23,7 @@ initializeVariables() { MAKE_TAG=true CREATE_DIENA_DISTRIBUTION_ZIP=false + STANDARD_QT_USED=false PRODUCT_PATH="build/linux/release/product" QT_PATH="/usr/local/Trolltech/Qt-4.8.0" @@ -96,13 +97,27 @@ copyQtLibrary(){ fi } + +buildWithStandardQt(){ + STANDARD_QT=`which qmake-qt4` + if [ $? == "0" ]; then + QT_VERSION=`$STANDARD_QT --version | grep -i "Using Qt version" | sed -e "s/Using Qt version \(.*\) in.*/\1/"` + if [ `echo $QT_VERSION | sed -e "s/\.//g"` -gt 480 ]; then + notifyProgress "Standard QT" "A recent enough qmake has been found. Using this one instead of custom one" + STANDARD_QT_USED=true + QMAKE_PATH=$STANDARD_QT + LRELEASES=`which lrelease` + QT_PATH="/usr/lib/`arch`-linux-gnu" + PLUGINS_PATH="$QT_PATH/qt4/plugins" + fi + fi +} + #********************** # script #********************** - - initializeVariables - +buildWithStandardQt for var in "$@" do @@ -174,18 +189,20 @@ cp -R resources/linux/qtlinux/* $PRODUCT_PATH/ notifyProgress "QT" "Coping plugins and library ..." cp -R $PLUGINS_PATH $PRODUCT_PATH/ +if [ $STANDARD_QT_USED == false ]; then #copying custom qt library -mkdir -p $QT_LIBRARY_DEST_PATH -copyQtLibrary libQtDBus -copyQtLibrary libQtScript -copyQtLibrary libQtSvg -copyQtLibrary libQtXmlPatterns -copyQtLibrary libQtNetwork -copyQtLibrary libQtXml -copyQtLibrary libQtGui -copyQtLibrary libQtCore -copyQtLibrary libphonon -copyQtLibrary libQtWebKit + mkdir -p $QT_LIBRARY_DEST_PATH + copyQtLibrary libQtDBus + copyQtLibrary libQtScript + copyQtLibrary libQtSvg + copyQtLibrary libQtXmlPatterns + copyQtLibrary libQtNetwork + copyQtLibrary libQtXml + copyQtLibrary libQtGui + copyQtLibrary libQtCore + copyQtLibrary libphonon + copyQtLibrary libQtWebKit +fi notifyProgress "QT" "Internalization" if [ ! -e $PRODUCT_PATH/i18n ]; then From f6585ab88406f16b49542b903a270fc4e33f067d Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 2 Aug 2012 16:25:52 +0200 Subject: [PATCH 6/8] delete old script --- buildDebianPackageQmake-Qt4 | 345 ------------------------------------ 1 file changed, 345 deletions(-) delete mode 100755 buildDebianPackageQmake-Qt4 diff --git a/buildDebianPackageQmake-Qt4 b/buildDebianPackageQmake-Qt4 deleted file mode 100755 index 83bf90c1..00000000 --- a/buildDebianPackageQmake-Qt4 +++ /dev/null @@ -1,345 +0,0 @@ -#!/bin/bash -# -------------------------------------------------------------------- -# This program 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, either version 3 of the License, or -# (at your option) any later version. -# -# This program 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 this program. If not, see . -# --------------------------------------------------------------------- - - -notifyError(){ - notify-send -t 0 "Error occoured" "An error occours during the sankore build:\n\t$1" -i /usr/share/icons/oxygen/64x64/status/dialog-error.png - exit 1 -} - -MAKE_TAG=true -CREATE_DIENA_DISTRIBUTION_ZIP=false - - -for var in "$@" -do - if [ $var == "notag" ]; then - MAKE_TAG=false; - fi - if [ $var == "diena" ]; then - CREATE_DIENA_DISTRIBUTION_ZIP=true; - fi -done - -alertIfPreviousVersionInstalled(){ - APT_CACHE=`which apt-cache` - if [ ! -e "$APT_CACHE" ]; then - notifyError "apt-cache command not found" - else - SEARCH_RESULT=`$APT_CACHE search open-sankore` - if [ `echo $SEARCH_RESULT | grep -c open-sankore` -ge 1 ]; then - notifyError "Found a previous version of Open-Sankore. Remove it to avoid to put it as dependency" - fi - fi -} - - -alertIfPreviousVersionInstalled - - - -ARCHITECTURE=`uname -m` - -rm -rf "build/linux/release" -rm -rf install - -QMAKE_PATH=`which qmake-qt4` -if [ $? == "0" ]; then - QT_VERSION=`$QMAKE_PATH --version | grep -i "Using Qt version" | sed -e "s/Using Qt version \(.*\) in.*/\1/"` - if [ `echo $QT_VERSION | sed -e "s/\.//g"` -lt 480 ]; then - notifyError "Qt library not recent enough" - fi -else - notifyError "qmake-qt4 not found" -fi - -LRELEASES=`which lrelease` -QT_PATH="/usr/lib/$ARCHITECTURE-linux-gnu" -PLUGINS_PATH="$QT_PATH/qt4/plugins" -GUI_TRANSLATIONS_DIRECTORY_PATH="../Qt-4.8/translations" - -if [ ! -e "$QMAKE_PATH" ]; then - notifyError "qmake command not found at $QMAKE_PATH" -fi - -if [ ! -e "$PLUGINS_PATH" ]; then - notifyError "plugins path not found at $PLUGINS_PATH" -fi - -notify-send "Open-Sankore" "Building Open-Sankore ..." - -if [ "$ARCHITECTURE" == "x86_64" ]; then - $QMAKE_PATH Sankore_3.1.pro -spec linux-g++-64 -else - $QMAKE_PATH Sankore_3.1.pro -spec linux-g++ -fi - -make -j 4 release-install - -notify-send "Git Hub" "Make a tag of the delivered version" -VERSION=`cat build/linux/release/version` -if [ ! -f build/linux/release/version ]; then - notifyError "version not found" -else - LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" - if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then - echo creating a tag with the version $VERSION - if [ $MAKE_TAG == true ]; then - git tag -a "v$VERSION" -m "Generating setup for v$VERSION" - git push origin --tags - fi - fi -fi - -cp resources/linux/run.sh build/linux/release/product -chmod +x build/linux/release/product/run.sh - -cp -R resources/linux/qtlinux/* build/linux/release/product/ - -notify-send "QT" "Coping plugins and library ..." -cp -R $PLUGINS_PATH build/linux/release/product/ - -#copying custom qt library -QT_LIBRARY_DEST_PATH="build/linux/release/product/qtlib" -mkdir $QT_LIBRARY_DEST_PATH -QT_LIBRARY_SOURCE_PATH="$QT_PATH" - -copyQtLibrary(){ - if ls "$QT_LIBRARY_SOURCE_PATH/$1.so" &> /dev/null; then - cp "$QT_LIBRARY_SOURCE_PATH/$1.so.?" "$QT_LIBRARY_DEST_PATH/" - cp "$QT_LIBRARY_SOURCE_PATH/$1.so.?.?.?" "$QT_LIBRARY_DEST_PATH/" - else - notifyError "$1 library not found in path: $QT_LIBRARY_SOURCE_PATH" - fi -} - -copyQtLibrary libQtDBus -copyQtLibrary libQtScript -copyQtLibrary libQtSvg -copyQtLibrary libQtXmlPatterns -copyQtLibrary libQtNetwork -copyQtLibrary libQtXml -copyQtLibrary libQtGui -copyQtLibrary libQtCore -copyQtLibrary libphonon -copyQtLibrary libQtWebKit - -notify-send "QT" "Internalization ..." -if [ ! -e $GUI_TRANSLATIONS_DIRECTORY_PATH ]; then - notifyError "gui translations pro file not found at: $GUI_TRANSLATIONS_DIRECTORY_PATH" -else - cd $GUI_TRANSLATIONS_DIRECTORY_PATH - $LRELEASES translations.pro - cd - - if [ ! -e build/linux/release/product/i18n ]; then - mkdir build/linux/release/product/i18n - fi - #copying qt gui translation - cp $GUI_TRANSLATIONS_DIRECTORY_PATH/qt_??.qm build/linux/release/product/i18n/ -fi - -$LRELEASES Sankore_3.1.pro -cp resources/i18n/*.qm build/linux/release/product/i18n/ - -rm -rf install/linux -mkdir -p install/linux - -cd build/linux/release/product - -#Removing .svn directories ... -find . -name .svn -exec rm -rf {} \; 2> /dev/null - -cd - -notify-send "Building Sankore" "Finished to build Sankore building the package" - - -BASE_WORKING_DIR="packageBuildDir" - -#creating package directory -mkdir $BASE_WORKING_DIR -mkdir "$BASE_WORKING_DIR/DEBIAN" -mkdir -p "$BASE_WORKING_DIR/usr/share/applications" -mkdir -p "$BASE_WORKING_DIR/usr/local" - - -cat > "$BASE_WORKING_DIR/DEBIAN/prerm" << EOF -#!/bin/bash -# -------------------------------------------------------------------- -# This program 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, either version 3 of the License, or -# (at your option) any later version. -# -# This program 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 this program. If not, see . -# --------------------------------------------------------------------- - -xdg-desktop-menu uninstall /usr/share/applications/Open-Sankore.desktop -exit 0 -#DEBHELPER# -EOF - -cat > "$BASE_WORKING_DIR/DEBIAN/postint" << EOF -#!/bin/bash -# -------------------------------------------------------------------- -# This program 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, either version 3 of the License, or -# (at your option) any later version. -# -# This program 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 this program. If not, see . -# --------------------------------------------------------------------- - -xdg-desktop-menu install --novendor /usr/share/applications/Open-Sankore.desktop -exit 0 -#DEBHELPER# -EOF - - -SANKORE_DIRECTORY_NAME="Open-Sankore-$VERSION" -SANKORE_PACKAGE_DIRECTORY="$BASE_WORKING_DIR/usr/local/$SANKORE_DIRECTORY_NAME" -#move sankore build directory to packages directory -cp -R build/linux/release/product $SANKORE_PACKAGE_DIRECTORY - - -cat > $BASE_WORKING_DIR/usr/local/$SANKORE_DIRECTORY_NAME/run.sh << EOF -!/bin/bash -# -------------------------------------------------------------------- -# This program 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, either version 3 of the License, or -# (at your option) any later version. -# -# This program 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 this program. If not, see . -# --------------------------------------------------------------------- - -env LD_LIBRARY_PATH=/usr/local/$SANKORE_DIRECTORY_NAME/qtlib:$LD_LIBRARY_PATH /usr/local/$SANKORE_DIRECTORY_NAME/Open-Sankore -EOF - - -CHANGE_LOG_FILE="$BASE_WORKING_DIR/DEBIAN/changelog-sankore-$VERSION.txt" -CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control" -CHANGE_LOG_TEXT="changelog.txt" - -if [ "$ARCHITECTURE" == "x86_64" ]; then - ARCHITECTURE="amd64" -fi - -if [ "$ARCHITECTURE" == "i686" ]; then - ARCHITECTURE="i386" -fi - -echo "Open-Sankore ($VERSION) $ARCHITECTURE; urgency=low" > "$CHANGE_LOG_FILE" -echo >> "$CHANGE_LOG_FILE" -cat $CHANGE_LOG_TEXT >> "$CHANGE_LOG_FILE" -echo >> "$CHANGE_LOG_FILE" -echo "-- Claudio Valerio `date`" >> "$CHANGE_LOG_FILE" - -echo "Package: open-sankore" > "$CONTROL_FILE" -echo "Version: $VERSION" >> "$CONTROL_FILE" -echo "Section: education" >> "$CONTROL_FILE" -echo "Priority: optional" >> "$CONTROL_FILE" -echo "Architecture: $ARCHITECTURE" >> "$CONTROL_FILE" -echo "Essential: no" >> "$CONTROL_FILE" -echo "Installed-Size: `du -s $SANKORE_PACKAGE_DIRECTORY | awk '{ print $1 }'`" >> "$CONTROL_FILE" -echo "Maintainer: Open-Sankoré Developers team " >> "$CONTROL_FILE" -echo "Homepage: http://dev.open-sankore.org" >> "$CONTROL_FILE" -echo -n "Depends: " >> "$CONTROL_FILE" -unset tab -declare -a tab -let count=0 -for l in `objdump -p $SANKORE_PACKAGE_DIRECTORY/Open-Sankore | grep NEEDED | awk '{ print $2 }'`; do - for lib in `dpkg -S $l | awk -F":" '{ print $1 }'`; do - #echo $lib - presence=`echo ${tab[*]} | grep -c "$lib"`; - if [ "$presence" == "0" ]; then - tab[$count]=$lib; - ((count++)); - fi; - done; -done; - -#additional dependencies -#tab[$count]="gtk2-engines-pixbuf" -#((count++)) -#tab[$count]="ttf-mscorefonts-installer" -#((count++)) - -for ((i=0;i<${#tab[@]};i++)); do - if [ $i -ne "0" ]; then - echo -n ", " >> "$CONTROL_FILE" - fi - echo -n "${tab[$i]} (>= "`dpkg -p ${tab[$i]} | grep "Version: " | awk '{ print $2 }'`") " >> "$CONTROL_FILE" -done -echo "" >> "$CONTROL_FILE" -echo "Description: This a interactive white board that uses a free standard format." >> "$CONTROL_FILE" - -find $BASE_WORKING_DIR/usr/ -exec md5sum {} > $BASE_WORKING_DIR/DEBIAN/md5sums 2>/dev/null \; -SANKORE_SHORTCUT="$BASE_WORKING_DIR/usr/share/applications/Open-Sankore.desktop" -echo "[Desktop Entry]" > $SANKORE_SHORTCUT -echo "Version=$VERSION" >> $SANKORE_SHORTCUT -echo "Encoding=UTF-8" >> $SANKORE_SHORTCUT -echo "Name=Open-Sankore ($VERSION)" >> $SANKORE_SHORTCUT -echo "GenericName=Open-Sankore" >> $SANKORE_SHORTCUT -echo "Comment=Logiciel de création de présentations pour tableau numérique interactif (TNI)" >> $SANKORE_SHORTCUT -echo "Exec=/usr/local/$SANKORE_DIRECTORY_NAME/run.sh" >> $SANKORE_SHORTCUT -echo "Icon=/usr/local/$SANKORE_DIRECTORY_NAME/sankore.png" >> $SANKORE_SHORTCUT -echo "StartupNotify=true" >> $SANKORE_SHORTCUT -echo "Terminal=false" >> $SANKORE_SHORTCUT -echo "Type=Application" >> $SANKORE_SHORTCUT -echo "Categories=Education" >> $SANKORE_SHORTCUT -echo "Name[fr_FR]=Open-Sankore ($VERSION)" >> $SANKORE_SHORTCUT -cp "resources/images/uniboard.png" "$SANKORE_PACKAGE_DIRECTORY/sankore.png" -chmod 755 "$BASE_WORKING_DIR/DEBIAN" -chmod 755 "$BASE_WORKING_DIR/DEBIAN/prerm" -chmod 755 "$BASE_WORKING_DIR/DEBIAN/postint" - -mkdir -p "install/linux" -DEBIAN_PACKAGE_NAME="Open-Sankore_${VERSION}_$ARCHITECTURE.deb" - -fakeroot chown -R root:root $BASE_WORKING_DIR -dpkg -b "$BASE_WORKING_DIR" "install/linux/$DEBIAN_PACKAGE_NAME" -notify-send "Open-Sankore" "Package built" - -#clean up mess -fakeroot rm -rf $BASE_WORKING_DIR - -if [ $CREATE_DIENA_DISTRIBUTION_ZIP == true ]; then - - ZIP_NAME="Open-Sankoré_`lsb_release -is`_`lsb_release -rs`_${VERSION}_${ARCHITECTURE}.zip" - cd install/linux - `which zip` -1 --junk-paths ${ZIP_NAME} ${DEBIAN_PACKAGE_NAME} ../../ReleaseNotes.pdf ../../JournalDesModifications.pdf - cd - - - notify-send "Open-Sankore" "Build Diena zip file for distribution" -fi \ No newline at end of file From 5b68ea125af474f632f166f2f829c0e00a41a5c5 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Fri, 3 Aug 2012 13:43:04 +0300 Subject: [PATCH 7/8] Fixed wrong connects in media item. --- src/domain/UBGraphicsMediaItem.h | 5 ++--- src/domain/UBGraphicsMediaItemDelegate.cpp | 13 ++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index e3c6b75b..b182f27c 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.h @@ -85,9 +85,6 @@ public: return Type; } - void hasMediaChanged(bool hasMedia); - void showOnDisplayChanged(bool shown); - virtual QUrl mediaFileUrl() const { return mMediaFileUrl; @@ -138,6 +135,8 @@ public slots: void toggleMute(); void activeSceneChanged(); + void hasMediaChanged(bool hasMedia); + void showOnDisplayChanged(bool shown); protected: diff --git a/src/domain/UBGraphicsMediaItemDelegate.cpp b/src/domain/UBGraphicsMediaItemDelegate.cpp index 41679aed..b88cabce 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.cpp +++ b/src/domain/UBGraphicsMediaItemDelegate.cpp @@ -74,17 +74,13 @@ void UBGraphicsMediaItemDelegate::buildButtons() { mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause())); - connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); - mStopButton = new DelegateButton(":/images/stop.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); connect(mStopButton, SIGNAL(clicked(bool)), mMedia, SLOT(stop())); - connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem); mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true); UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue()); - connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start())); if (delegated()->isMuted()) mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); @@ -93,7 +89,6 @@ void UBGraphicsMediaItemDelegate::buildButtons() connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image - connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); mButtons << mPlayPauseButton << mStopButton << mMuteButton; @@ -101,6 +96,14 @@ void UBGraphicsMediaItemDelegate::buildButtons() mToolBarItem->setVisibleOnBoard(true); mToolBarItem->setShifting(false); + if (mToolBarShowTimer) + { + connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); + connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); + connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start())); + connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); + } + UBGraphicsMediaItem *audioItem = dynamic_cast(mDelegated); if (audioItem) { From 1c2069ce735bb24ef7485985db635bed3d90d61b Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Fri, 3 Aug 2012 13:53:27 +0300 Subject: [PATCH 8/8] Nested class becomes single class. --- src/domain/UBGraphicsMediaItem.cpp | 31 +++++++++++- src/domain/UBGraphicsMediaItem.h | 59 +++++++--------------- src/domain/UBGraphicsMediaItemDelegate.cpp | 4 +- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index f5e9e6b0..222dff89 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -23,6 +23,33 @@ #include "board/UBBoardController.h" #include "core/memcheck.h" + +UBAudioPresentationWidget::UBAudioPresentationWidget(QWidget *parent) + : QWidget(parent) + , mBorderSize(10) + , mTitleSize(10) +{ + +} + +void UBAudioPresentationWidget::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + painter.fillRect(rect(), QBrush(Qt::black)); + + if (QString() != mTitle) + { + painter.setPen(QPen(Qt::white)); + QRect titleRect = rect(); + titleRect.setX(mBorderSize); + titleRect.setY(2); + titleRect.setHeight(15); + painter.drawText(titleRect, mTitle); + } + + QWidget::paintEvent(event); +} + bool UBGraphicsMediaItem::sIsMutedByDefault = false; UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent) @@ -67,9 +94,9 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); mMediaObject->setTickInterval(1000); - mAudioWidget = new UBGraphicsMediaItem::UBAudioPresentationWidget(); + mAudioWidget = new UBAudioPresentationWidget(); int borderSize = 0; - UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); + UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); if (pAudioWidget) { borderSize = pAudioWidget->borderSize(); diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index b182f27c..1fd164a4 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.h @@ -23,52 +23,27 @@ #include "board/UBBoardController.h" #include "frameworks/UBFileSystemUtils.h" +class UBAudioPresentationWidget : public QWidget +{ +public: + UBAudioPresentationWidget(QWidget *parent = NULL); + + int borderSize() {return mBorderSize;} + void setTitle(QString title = QString()){mTitle = title;} + QString getTitle(){return mTitle;} + +private: + virtual void paintEvent(QPaintEvent *event); + + int mBorderSize; + int mTitleSize; + QString mTitle; +}; class UBGraphicsMediaItem : public UBGraphicsProxyWidget { Q_OBJECT -public: - class UBAudioPresentationWidget : public QWidget - { - public: - UBAudioPresentationWidget(QWidget *parent = NULL) - :QWidget(parent) - , mBorderSize(10) - , mTitleSize(10) - {} - - int borderSize() - { - return mBorderSize; - } - void setTitle(QString title = QString()){mTitle = title;} - QString getTitle(){return mTitle;} - - private: - virtual void paintEvent(QPaintEvent *event) - { - QPainter painter(this); - painter.fillRect(rect(), QBrush(Qt::black)); - - if (QString() != mTitle) - { - painter.setPen(QPen(Qt::white)); - QRect titleRect = rect(); - titleRect.setX(mBorderSize); - titleRect.setY(2); - titleRect.setHeight(15); - painter.drawText(titleRect, mTitle); - } - - QWidget::paintEvent(event); - } - - int mBorderSize; - int mTitleSize; - QString mTitle; - }; - public: typedef enum{ mediaType_Video, @@ -122,7 +97,7 @@ public: virtual void setSourceUrl(const QUrl &pSourceUrl) { - UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); + UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); if (pAudioWidget) { pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile())); diff --git a/src/domain/UBGraphicsMediaItemDelegate.cpp b/src/domain/UBGraphicsMediaItemDelegate.cpp index b88cabce..54d702a0 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.cpp +++ b/src/domain/UBGraphicsMediaItemDelegate.cpp @@ -138,7 +138,7 @@ void UBGraphicsMediaItemDelegate::positionHandles() else if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio) { int borderSize = 0; - UBGraphicsMediaItem::UBAudioPresentationWidget *audioWidget = dynamic_cast(delegated()->widget()); + UBAudioPresentationWidget *audioWidget = dynamic_cast(delegated()->widget()); if (audioWidget) borderSize = audioWidget->borderSize(); @@ -162,7 +162,7 @@ void UBGraphicsMediaItemDelegate::positionHandles() } toolBarMinimumWidth += mToolBarItem->boundingRect().height(); - UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast(delegated()->widget()); + UBAudioPresentationWidget* pAudioWidget = dynamic_cast(delegated()->widget()); if (pAudioWidget) { pAudioWidget->setMinimumSize(toolBarMinimumWidth + (int)mMediaControl->lcdAreaSize().width() + (int)mMediaControl->rect().height(),26+pAudioWidget->borderSize());