diff --git a/.gitignore b/.gitignore
index bd7d6e34..80d1bc96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,9 +42,10 @@ Thumbs.db
*.pdb
*.sln
*.suo
-*.vcproj
+*.vcproj*
*.ncb
*.pro.user
+*.idb
# Build files #
###############
diff --git a/buildDebianPackage b/buildDebianPackage
deleted file mode 100755
index 98fb8c2c..00000000
--- a/buildDebianPackage
+++ /dev/null
@@ -1,298 +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
-}
-
-rm -rf "build/linux/release"
-rm -rf install
-
-QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
-PLUGINS_PATH="$QT_PATH/plugins"
-QMAKE_PATH="$QT_PATH/bin/qmake"
-LRELEASES="/usr/local/Trolltech/Qt-4.7.3/bin/lrelease"
-GUI_TRANSLATIONS_DIRECTORY_PATH="../Qt-sankore3.1/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
-
-notify-send "Open-Sankore" "Building Open-Sankore ..."
-
-if [ "$ARCHITECTURE" == "x86_64" ]; then
- $QMAKE_PATH -spec linux-g++-64
-else
- $QMAKE_PATH -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
- git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
- git push origin --tags
- 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/lib"
-
-copyQtLibrary(){
- if [ ! -e "$QT_LIBRARY_SOURCE_PATH/$1.so.4.7.3" ]; 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.7.3" "$QT_LIBRARY_DEST_PATH/"
-}
-
-copyQtLibrary libQtWebKit
-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
-
-
-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"
-
-fakeroot chown -R root:root $BASE_WORKING_DIR
-dpkg -b "$BASE_WORKING_DIR" install/linux/Open-Sankore_${VERSION}_$ARCHITECTURE.deb
-notify-send "Open-Sankore" "Package built"
-
-#clean up mess
-fakeroot rm -rf $BASE_WORKING_DIR
-
diff --git a/release.linux.sh b/release.linux.sh
index 1b2dcd44..18ae40d6 100755
--- a/release.linux.sh
+++ b/release.linux.sh
@@ -15,83 +15,132 @@
# ---------------------------------------------------------------------
-make clean
-rm -rf build/linux/release/
-rm -rf install
+#######################################################################
+# functions #
+#######################################################################
+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
+}
+
+checkExecutable(){
+ if [ ! -x $1 ]; then
+ notify-send "$1 executable not found"
+ fi
+}
+
+checkDirectory(){
+ if [ ! -d $1 ]; then
+ notify-send "$1 directory not found"
+ fi
+}
+#######################################################################
+# path definition #
+#######################################################################
QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
PLUGINS_PATH="$QT_PATH/plugins"
+RELEASE_DIR=build/linux/release
+BUILD_DIR=$RELEASE_DIR/product
+GUI_TRANSLATIONS_DIRECTORY_PATH="../Qt-sankore3.1/translations"
+QT_LIBRARY_SOURCE_PATH="$QT_PATH/lib"
+
QMAKE_PATH="$QT_PATH/bin/qmake"
-LRELEASES="/usr/local/Trolltech/Qt-4.7.3/bin/lrelease"
-QT_GUI_TRANSLATIONS_DIRECTORY="../Qt-sankore3.1/translations"
-QT_GUI_TRANSLATIONS_PRO_FILE="$QT_GUI_TRANSLATIONS_DIRECTORY/translations.pro"
+LRELEASE="/usr/local/Trolltech/Qt-4.7.3/bin/lrelease"
-if [ ! -e "$QMAKE_PATH" ]; then
- echo "qmake command not found at $QMAKE_PATH"
- exit 1
-fi
+ARCHITECTURE=`uname -m`
+#######################################################################
+# initials checks #
+#######################################################################
+checkExecutable $QMAKE_PATH
+checkExecutable $LRELEASE
-if [ ! -e "$PLUGINS_PATH" ]; then
- echo "plugins path not found at $PLUGINS_PATH"
- exit 1
+checkDirectory $GUI_TRANSLATIONS_DIRECTORY_PATH
+checkDirectory $PLUGINS_PATH
+checkDirectory $QT_LIBRARY_SOURCE_PATH
+
+#######################################################################
+# cleaning #
+#######################################################################
+rm -rf $RELEASE_DIR
+
+
+#######################################################################
+# Internalization #
+#######################################################################
+notify-send "QT" "Internalization ..."
+
+cd $GUI_TRANSLATIONS_DIRECTORY_PATH
+$LRELEASE translations.pro
+cd -
+if [ ! -e $BUILD_DIR/i18n ]; then
+ mkdir -p $BUILD_DIR/i18n
fi
+#copying qt gui translation
+cp $GUI_TRANSLATIONS_DIRECTORY_PATH/qt_??.qm $BUILD_DIR/i18n/
+
+
+$LRELEASE Sankore_3.1.pro
+
+
+#######################################################################
+# building #
+#######################################################################
+notify-send "Open-Sankore" "Building Open-Sankore ..."
-ARCHITECTURE=`uname -m`
if [ "$ARCHITECTURE" == "x86_64" ]; then
$QMAKE_PATH -spec linux-g++-64
else
$QMAKE_PATH -spec linux-g++
fi
+checkDirectory $BUILD_DIR
+
make -j 4 release-install
-if [ ! -f $QT_GUI_TRANSLATIONS ]; then
- echo "impossible to create and integrate the qt gui translation"
- exit 1
-else
- $LRELEASES $QT_GUI_TRANSLATIONS_PRO_FILE
-elif
-
-VERSION=`cat build/linux/release/version`
-if [ ! -f build/linux/release/version ]; then
- echo "version not found"
- exit 1
+#######################################################################
+# github tag #
+#######################################################################
+notify-send "Git Hub" "Make a tag of the delivered version"
+VERSION=`cat $RELEASE_DIR/version`
+if [ ! -f $RELEASE_DIR/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
- git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
- git push origin --tags
+# git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
+# git push origin --tags
fi
fi
-cp resources/linux/run.sh build/linux/release/product
-chmod +x build/linux/release/product/run.sh
+#######################################################################
+# coping resources #
+#######################################################################
+cp resources/linux/run.sh $BUILD_DIR
+chmod +x $BUILD_DIR/run.sh
-cp -R resources/linux/qtlinux/* build/linux/release/product/
+cp -R resources/linux/qtlinux/* $BUILD_DIR
-#copying plugins
-cp -R $PLUGINS_PATH build/linux/release/product/
-#removing debug version
-find build/linux/release/product/ -name *.debug -exec rm {} \;
+cp -R resources/customizations $BUILD_DIR
+
+notify-send "QT" "Coping plugins and library ..."
+cp -R $PLUGINS_PATH $BUILD_DIR
#copying custom qt library
-QT_LIBRARY_DEST_PATH="build/linux/release/product/qtlib"
+QT_LIBRARY_DEST_PATH="$BUILD_DIR/qtlib"
mkdir $QT_LIBRARY_DEST_PATH
-QT_LIBRARY_SOURCE_PATH="$QT_PATH/lib"
copyQtLibrary(){
if [ ! -e "$QT_LIBRARY_SOURCE_PATH/$1.so.4.7.3" ]; then
- echo "library not found: $QT_LIBRARY_SOURCE_PATH"
- exit 1
+ 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.7.3" "$QT_LIBRARY_DEST_PATH/"
}
-
copyQtLibrary libQtWebKit
copyQtLibrary libQtDBus
copyQtLibrary libQtScript
@@ -102,33 +151,206 @@ copyQtLibrary libQtXml
copyQtLibrary libQtGui
copyQtLibrary libQtCore
-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/"
-
-if [ ! -e $GUI_TRANSLATIONS_DIRECTORY_PATH ]; then
- notifyError "gui translations pro file not found at: $GUI_TRANSLATIONS_DIRECTORY_PATH"
+if [ ! -e "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4.4.0" ]; then
+ notifyError "phonon library not found in path: $QT_LIBRARY_SOURCE_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/
+ 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
-$LRELEASES Sankore_3.1.pro
-cp resources/i18n/*.qm build/linux/release/product/i18n/
+#######################################################################
+# Removing unwanted files #
+#######################################################################
+cd $BUILD_DIR
-rm -rf install/linux
-mkdir -p install/linux
+#Removing .svn directories ...
+find . -name .svn -exec rm -rf {} \; 2> /dev/null
-mv build/linux/release/product build/linux/release/Open-Sankore.$VERSION
-cd build/linux/release
+cd -
+notify-send "Building Sankore" "Finished to build Sankore building the package"
+
+#######################################################################
+# build debian #
+#######################################################################
+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_DIR $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"
+
+rm install/linux/Open-Sankore_*.deb
+
+fakeroot chown -R root:root $BASE_WORKING_DIR
+dpkg -b "$BASE_WORKING_DIR" install/linux/Open-Sankore_${VERSION}_$ARCHITECTURE.deb
+notify-send "Open-Sankore" "Package built"
+
+#clean up mess
+fakeroot rm -rf $BASE_WORKING_DIR
+
+
+#######################################################################
+# tar.gz #
+#######################################################################
+echo `pwd`
+cp -R $RELEASE_DIR/product $RELEASE_DIR/Open-Sankore.$VERSION
+cd $RELEASE_DIR
+
+rm ../../../install/linux/Open-Sankore.tar.gz
-# "Removing .svn directories ..."
-find . -name .svn -exec rm -rf {} \; 2> /dev/null
tar cvzf ../../../install/linux/Open-Sankore.tar.gz Open-Sankore.$VERSION -C .
-notify-send "Open-Sankore" "Build Finished"
+notify-send "Open-Sankore" "tar.gz Build done"
\ No newline at end of file
diff --git a/release.macx.sh b/release.macx.sh
index af439109..a08dffc2 100755
--- a/release.macx.sh
+++ b/release.macx.sh
@@ -104,6 +104,9 @@ checkExecutable "$LRELEASE"
notify "Cleaning ..."
rm -rf "$BUILD_DIR"
+notify "Translations ..."
+$LRELEASE "Sankore_3.1.pro"
+
# generate Makefiles
notify "Generating Makefile ..."
@@ -115,12 +118,9 @@ $QMAKE_CMD
notify "Compiling ..."
make -j4 release
-
-notify "Translations ..."
-$LRELEASE "Sankore_3.1.pro"
-
addQtTranslations
+cp -R resources/customizations $PRODUCT_DIR/Open-Sankore.app/Contents/Resources
notify "Tagging ..."
VERSION=`cat "$BUILD_DIR/version"`
diff --git a/release.win7.vc9.bat b/release.win7.vc9.bat
index 7ebad274..51885958 100644
--- a/release.win7.vc9.bat
+++ b/release.win7.vc9.bat
@@ -53,8 +53,8 @@ REM git describe %LAST_TAG% > tmp
REM set /p LAST_TAG_VERSION=< tmp
REM erase tmp
-echo %VERSION%
-echo %LAST_TAG_VERSION%
+REM echo %VERSION%
+REM echo %LAST_TAG_VERSION%
REM if not v%VERSION%==%LAST_TAG_VERSION% GOTO EXIT_WITH_ERROR
@@ -62,6 +62,8 @@ nmake release-install
copy %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm build\win32\release\product\i18n\
+copy resources\customizations build\win32\release\product\
+
del build\win32\release\product\i18n\qt_help*
del ".\build\win32\release\product\Sankore.pdb"
diff --git a/resources/customizations/fonts/ALPHONET.TTF b/resources/customizations/fonts/ALPHONET.TTF
new file mode 100644
index 00000000..9917987f
Binary files /dev/null and b/resources/customizations/fonts/ALPHONET.TTF differ
diff --git a/resources/customizations/fonts/Andika-R.ttf b/resources/customizations/fonts/Andika-R.ttf
new file mode 100644
index 00000000..b4320f6e
Binary files /dev/null and b/resources/customizations/fonts/Andika-R.ttf differ
diff --git a/resources/customizations/fonts/SCRIPTCA.TTF b/resources/customizations/fonts/SCRIPTCA.TTF
new file mode 100644
index 00000000..b991f68f
Binary files /dev/null and b/resources/customizations/fonts/SCRIPTCA.TTF differ
diff --git a/resources/customizations/fonts/ScriptEcole2.ttf b/resources/customizations/fonts/ScriptEcole2.ttf
new file mode 100644
index 00000000..196aea5f
Binary files /dev/null and b/resources/customizations/fonts/ScriptEcole2.ttf differ
diff --git a/resources/customizations/fonts/ec.TTF b/resources/customizations/fonts/ec.TTF
new file mode 100644
index 00000000..51401f7f
Binary files /dev/null and b/resources/customizations/fonts/ec.TTF differ
diff --git a/resources/customizations/fonts/ec_co_pt.TTF b/resources/customizations/fonts/ec_co_pt.TTF
new file mode 100644
index 00000000..209ff316
Binary files /dev/null and b/resources/customizations/fonts/ec_co_pt.TTF differ
diff --git a/resources/customizations/fonts/ec_cour.TTF b/resources/customizations/fonts/ec_cour.TTF
new file mode 100644
index 00000000..69844329
Binary files /dev/null and b/resources/customizations/fonts/ec_cour.TTF differ
diff --git a/resources/customizations/fonts/ec_cp.TTF b/resources/customizations/fonts/ec_cp.TTF
new file mode 100644
index 00000000..8bb6d267
Binary files /dev/null and b/resources/customizations/fonts/ec_cp.TTF differ
diff --git a/resources/forms/preferences.ui b/resources/forms/preferences.ui
index a82fd0b3..94bbc4bb 100644
--- a/resources/forms/preferences.ui
+++ b/resources/forms/preferences.ui
@@ -21,59 +21,10 @@
- -
-
-
- QFrame::NoFrame
-
-
- QFrame::Raised
-
-
-
- 0
-
-
-
-
-
- Default Settings
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
-
-
- Close
-
-
- true
-
-
-
-
-
-
-
-
-
- 3
+ 6
@@ -1034,7 +985,7 @@ p, li { white-space: pre-wrap; }
-
-
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
@@ -1050,7 +1001,7 @@ p, li { white-space: pre-wrap; }
-
-
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
@@ -1101,6 +1052,85 @@ p, li { white-space: pre-wrap; }
+
+
+ Credits
+
+
+ -
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Ubuntu'; font-size:10pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial'; font-size:12pt; font-weight:600;">Fonts</span></p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial';">- Thanks to Henri ROGELET for Script-École 2, ScriptCase-École, Alphonetic (</span><a href="http://pointecole.free.fr/polices.html"><span style=" font-family:'Arial'; text-decoration: underline; color:#0000ff;">http://pointecole.free.fr/polices.html</span></a><span style=" font-family:'Arial';">).</span></p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial';">- Andika Copyright (c) 2004-2011, SIL International (http://www.sil.org/). Licensed under the SIL Open Font License, Version 1.1 (http://scripts.sil.org/OFL), with Reserved Font Names "Andika" and "SIL".</span></p>
+<p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Arial'; color:#000000;">- Ecolier CC BY-NC-ND 2.0 (JM Douteau)</span></p></body></html>
+
+
+ Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+
+
+ true
+
+
+ false
+
+
+
+
+
+
+
+ -
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
-
+
+
+ Default Settings
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
-
+
+
+ Close
+
+
+ true
+
+
+
+
+
+
diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp
index be5d8571..faab24bf 100644
--- a/src/core/UBApplication.cpp
+++ b/src/core/UBApplication.cpp
@@ -18,6 +18,7 @@
#include
#include
#include
+#include
#if defined(Q_WS_MACX)
#include
@@ -351,8 +352,6 @@ int UBApplication::exec(const QString& pFileToImport)
}
}
-
-
return QApplication::exec();
}
diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h
index ee85ea0b..2950005f 100644
--- a/src/core/UBApplication.h
+++ b/src/core/UBApplication.h
@@ -118,8 +118,8 @@ class UBApplication : public QtSingleApplication
void showMinimized();
#endif
void importUniboardFiles();
- private:
+ private:
void updateProtoActionsState();
QList mProtoMenus;
bool mIsVerbose;
diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp
index efea1136..28a2a8d5 100644
--- a/src/core/UBSettings.cpp
+++ b/src/core/UBSettings.cpp
@@ -895,6 +895,19 @@ QString UBSettings::applicationShapeLibraryDirectory()
}
}
+QString UBSettings::applicationCustomizationDirectory()
+{
+ QString defaultRelativePath = QString("/customizations");
+ return UBPlatformUtils::applicationResourcesDirectory() + defaultRelativePath;
+
+}
+
+QString UBSettings::applicationCustomFontDirectory()
+{
+ QString defaultFontDirectory = "/fonts";
+ return applicationCustomizationDirectory() + defaultFontDirectory;
+}
+
QString UBSettings::applicationGipLibraryDirectory()
{
static QString dirPath = "";
diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h
index caf05033..2bb7262b 100644
--- a/src/core/UBSettings.h
+++ b/src/core/UBSettings.h
@@ -118,6 +118,8 @@ class UBSettings : public QObject
QString applicationImageLibraryDirectory();
QString applicationApplicationsLibraryDirectory();
QString applicationInteractivesDirectory();
+ QString applicationCustomizationDirectory();
+ QString applicationCustomFontDirectory();
QNetworkProxy* httpProxy();
diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp
index 6c6ea66e..c567ef43 100644
--- a/src/domain/UBGraphicsTextItemDelegate.cpp
+++ b/src/domain/UBGraphicsTextItemDelegate.cpp
@@ -18,14 +18,12 @@
#include "UBGraphicsTextItemDelegate.h"
#include "UBGraphicsScene.h"
+#include "gui/UBResources.h"
+
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsDelegateFrame.h"
#include "core/UBSettings.h"
-#include "core/UBApplication.h" // TODO UB 4.x clean that dependency
-#include "core/UBApplicationController.h" // TODO UB 4.x clean that dependency
-#include "core/UBDisplayManager.h" // TODO UB 4.x clean that dependency
-
#include "core/memcheck.h"
#include "board/UBBoardController.h"
@@ -146,17 +144,17 @@ void UBGraphicsTextItemDelegate::customize(QFontDialog &fontDialog)
safeWebFontNames.append("Arial");
safeWebFontNames.append("Arial Black");
safeWebFontNames.append("Comic Sans MS");
- //safeWebFontNames.append("Century Gothic"); Not available on OSX
safeWebFontNames.append("Courier New");
safeWebFontNames.append("Georgia");
safeWebFontNames.append("Impact");
safeWebFontNames.append("Times New Roman");
safeWebFontNames.append("Trebuchet MS");
safeWebFontNames.append("Verdana");
+
+ QStringList customFontList = UBResources::resources()->customFontList();
int index = 0;
- foreach (QString dialogFontName, dialogFontNames)
- {
- if (safeWebFontNames.contains(dialogFontName, Qt::CaseInsensitive))
+ foreach (QString dialogFontName, dialogFontNames){
+ if (safeWebFontNames.contains(dialogFontName, Qt::CaseInsensitive) || customFontList.contains(dialogFontName, Qt::CaseSensitive))
index++;
else
stringListModel->removeRow(index);
diff --git a/src/gui/UBResources.cpp b/src/gui/UBResources.cpp
index f1eb64ab..1cb63742 100644
--- a/src/gui/UBResources.cpp
+++ b/src/gui/UBResources.cpp
@@ -18,9 +18,11 @@
#include
#include "core/UBApplication.h"
-
+#include "core/UBSettings.h"
+#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
+
UBResources* UBResources::sSingleton = 0;
UBResources::UBResources(QObject* pParent)
@@ -40,6 +42,7 @@ UBResources* UBResources::resources()
{
sSingleton = new UBResources(UBApplication::staticMemoryCleaner);
sSingleton->init();
+ sSingleton->buildFontList();
}
return sSingleton;
@@ -61,3 +64,13 @@ void UBResources::init()
rotateCursor = QCursor(QPixmap(":/images/cursors/rotate.png"), 16, 16);
drawLineRulerCursor = QCursor(QPixmap(":/images/cursors/drawRulerLine.png"), 3, 12);
}
+
+void UBResources::buildFontList()
+{
+ QString customFontDirectory = UBSettings::settings()->applicationCustomFontDirectory();
+ QStringList fontFiles = UBFileSystemUtils::allFiles(customFontDirectory);
+ foreach(QString fontFile, fontFiles){
+ int fontId = QFontDatabase::addApplicationFont(fontFile);
+ mCustomFontList << QFontDatabase::applicationFontFamilies(fontId);
+ }
+}
diff --git a/src/gui/UBResources.h b/src/gui/UBResources.h
index bae4eee6..34e692b4 100644
--- a/src/gui/UBResources.h
+++ b/src/gui/UBResources.h
@@ -24,6 +24,8 @@ class UBResources : public QObject
public:
static UBResources* resources();
+ QStringList customFontList() { return mCustomFontList; }
+
private:
UBResources(QObject* pParent = 0);
@@ -32,6 +34,8 @@ class UBResources : public QObject
void init();
static UBResources* sSingleton;
+ void buildFontList();
+ QStringList mCustomFontList;
public: