diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro
index 9da0c92a..b885459b 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,8 @@ 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++* {
+ CONFIG += link_prl
LIBS += -lcrypto
LIBS += -lX11
QMAKE_CFLAGS += -fopenmp
@@ -442,12 +398,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/buildDebianPackage b/buildDebianPackage
index 5835b9bf..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,
@@ -14,26 +14,56 @@
# 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
+ STANDARD_QT_USED=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
+}
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
@@ -46,30 +76,84 @@ 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
+}
+
+
+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
+ 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 -
-notify-send "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++
@@ -77,93 +161,65 @@ fi
make -j 4 release-install
-notify-send "Git Hub" "Make a tag of the delivered version"
+if [ ! -e "$PRODUCT_PATH/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
- 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/
-notify-send "QT" "Coping plugins and library ..."
-cp -R $PLUGINS_PATH build/linux/release/product/
+notifyProgress "QT" "Coping plugins and library ..."
+cp -R $PLUGINS_PATH $PRODUCT_PATH/
+if [ $STANDARD_QT_USED == false ]; then
#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/"
-}
-
-copyQtLibrary libQtDBus
-copyQtLibrary libQtScript
-copyQtLibrary libQtSvg
-copyQtLibrary libQtXmlPatterns
-copyQtLibrary libQtNetwork
-copyQtLibrary libQtXml
-copyQtLibrary libQtGui
-copyQtLibrary libQtCore
-
-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/"
-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/"
+ 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
-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/
+notifyProgress "QT" "Internalization"
+if [ ! -e $PRODUCT_PATH/i18n ]; then
+ mkdir $PRODUCT_PATH/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 -
-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"
@@ -222,7 +278,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
@@ -250,14 +306,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"
@@ -288,12 +336,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 +370,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
@@ -338,9 +380,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 -
-
- notify-send "Open-Sankore" "Build Diena zip file for distribution"
+ notifyProgress "Open-Sankore" "Build Diena zip file for distribution"
fi
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
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
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/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 e3c6b75b..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,
@@ -85,9 +60,6 @@ public:
return Type;
}
- void hasMediaChanged(bool hasMedia);
- void showOnDisplayChanged(bool shown);
-
virtual QUrl mediaFileUrl() const
{
return mMediaFileUrl;
@@ -125,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()));
@@ -138,6 +110,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..54d702a0 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)
{
@@ -135,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();
@@ -159,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());
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];