Merge branch 'master' into widget_fix

preferencesAboutTextFull
Yimgo 13 years ago
commit d8d0535843
  1. 77
      Sankore_3.1.pro
  2. 33
      Subdirs.pro
  3. 257
      buildDebianPackage
  4. 345
      buildDebianPackageQmake-Qt4
  5. 6
      plugins/plugins.pri
  6. 0
      resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand noir.png
  7. 0
      resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand noir.thumbnail.png
  8. 0
      resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand vert.png
  9. 0
      resources/library/pictures/Fonds/Carroyage et lignes/quadrille grand vert.thumbnail.png
  10. 0
      resources/library/pictures/Fonds/Carroyage et lignes/quadrille petit bleu.png
  11. 0
      resources/library/pictures/Fonds/Carroyage et lignes/quadrille petit bleu.thumbnail.png
  12. 0
      resources/library/pictures/Fonds/Fonds colorees/jaune.png
  13. 0
      resources/library/pictures/Fonds/Fonds colorees/jaune.thumbnail.png
  14. 0
      resources/library/pictures/Fonds/Fonds colorees/jaune_pale.png
  15. 0
      resources/library/pictures/Fonds/Fonds colorees/jaune_pale.thumbnail.png
  16. 0
      resources/library/pictures/Fonds/Fonds colorees/rouge.png
  17. 0
      resources/library/pictures/Fonds/Fonds colorees/rouge.thumbnail.png
  18. 0
      resources/library/pictures/Fonds/Fonds colorees/rouge_pale.png
  19. 0
      resources/library/pictures/Fonds/Fonds colorees/rouge_pale.thumbnail.png
  20. 0
      resources/library/pictures/Fonds/Fonds colorees/vert.png
  21. 0
      resources/library/pictures/Fonds/Fonds colorees/vert.thumbnail.png
  22. 0
      resources/library/pictures/Fonds/Fonds colorees/vert_pale.png
  23. 0
      resources/library/pictures/Fonds/Fonds colorees/vert_pale.thumbnail.png
  24. 0
      resources/library/pictures/Fonds/Fonds colorees/violet.png
  25. 0
      resources/library/pictures/Fonds/Fonds colorees/violet.thumbnail.png
  26. 0
      resources/library/pictures/Fonds/Fonds colorees/violet_pale.png
  27. 0
      resources/library/pictures/Fonds/Fonds colorees/violet_pale.thumbnail.png
  28. 0
      resources/library/pictures/Fonds/Musique/cle de sol.png
  29. 0
      resources/library/pictures/Fonds/Musique/cle de sol.thumbnail.png
  30. 0
      resources/library/pictures/Fonds/Plateaux jeux/jeu d'echelle.jpg
  31. 0
      resources/library/pictures/Fonds/Plateaux jeux/jeu d'echelle.thumbnail.png
  32. 31
      src/domain/UBGraphicsMediaItem.cpp
  33. 64
      src/domain/UBGraphicsMediaItem.h
  34. 17
      src/domain/UBGraphicsMediaItemDelegate.cpp
  35. 28
      src/frameworks/UBPlatformUtils_mac.mm

@ -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

@ -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

@ -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 <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
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

@ -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 <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
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 <claudio@open-sankore.org> `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 <dev@open-sankore.org>" >> "$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

@ -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

@ -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<UBGraphicsMediaItem::UBAudioPresentationWidget*>(mAudioWidget);
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
borderSize = pAudioWidget->borderSize();

@ -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<UBGraphicsMediaItem::UBAudioPresentationWidget*>(mAudioWidget);
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(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:

@ -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<UBGraphicsMediaItem*>(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<UBGraphicsMediaItem::UBAudioPresentationWidget*>(delegated()->widget());
UBAudioPresentationWidget *audioWidget = dynamic_cast<UBAudioPresentationWidget*>(delegated()->widget());
if (audioWidget)
borderSize = audioWidget->borderSize();
@ -159,7 +162,7 @@ void UBGraphicsMediaItemDelegate::positionHandles()
}
toolBarMinimumWidth += mToolBarItem->boundingRect().height();
UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBGraphicsMediaItem::UBAudioPresentationWidget*>(delegated()->widget());
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(delegated()->widget());
if (pAudioWidget)
{
pAudioWidget->setMinimumSize(toolBarMinimumWidth + (int)mMediaControl->lcdAreaSize().width() + (int)mMediaControl->rect().height(),26+pAudioWidget->borderSize());

@ -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];

Loading…
Cancel
Save