Commit 6ab23ce4 authored by shibakaneki's avatar shibakaneki

Merge branch 'master' of github.com:Sankore/Sankore-3.1

parents 75a7c9ea 0eed7eef
......@@ -42,9 +42,10 @@ Thumbs.db
*.pdb
*.sln
*.suo
*.vcproj
*.vcproj*
*.ncb
*.pro.user
*.idb
# Build files #
###############
......@@ -54,6 +55,14 @@ Makefile
Makefile.Debug
Makefile.Release
# plugins #
###########
plugins/cffadaptor/lib
plugins/cffadaptor/moc
plugins/cffadaptor/objects
# Translation files #
#####################
*.qm
......
......@@ -84,10 +84,9 @@ Source: "..\Qt-sankore3.1\plugins\phonon_backend\phonon_ds94.dll"; DestDir: "{ap
[Icons]
Name: "{group}\Open-Sankore"; Filename: "{app}\Open-Sankore.exe"
Name: "{group}\{cm:UninstallProgram,Sankore 3.1}"; Filename: "{uninstallexe}"
Name: "{group}\{cm:UninstallProgram,Open-Sankore}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Open-Sankore"; Filename: "{app}\Open-Sankore.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Open-Sankore"; Filename: "{app}\Open-Sankore.exe"; Tasks: quicklaunchicon
;Name: "{group}\Printing Preferences"; Filename: "{app}\properties.exe"; WorkingDir: {app}
[Registry]
Root: HKCR; Subkey: ".ubz"; ValueType: string; ValueName: ""; ValueData: "SankoreFile"; Flags: uninsdeletevalue
......@@ -114,7 +113,7 @@ Root: HKLM64; Subkey: "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Low Righ
Root: HKLM64; Subkey: "SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Low Rights\DragDrop\{{E63D17F8-D9DA-479D-B9B5-0D101A03703B}"; ValueType: string; ValueName: "AppPath"; ValueData: "{app}"; Flags: uninsdeletevalue; Check: isProcessorX64
[Run]
Filename: "{tmp}\vcredist_x86.exe";WorkingDir:"{tmp}"
Filename: "{tmp}\vcredist_x86.exe";WorkingDir:"{tmp}"; Parameters: "/q:a/c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""""""; StatusMsg: Installing CRT ...
Filename: "{app}\Open-Sankore.exe"; Description: "{cm:LaunchProgram,Open-Sankore}"; Flags: nowait postinstall
[UninstallDelete]
......
......@@ -309,6 +309,13 @@ macx {
QMAKE_BUNDLE_DATA += TRANSLATION_pt
}
exists(resources/i18n/sankore_sk.qm) {
TRANSLATION_pt.files = resources/i18n/sankore_sk.qm \
resources/i18n/Localizable.strings
TRANSLATION_pt.path = "$$RESOURCES_DIR/sk.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_sk
}
QMAKE_BUNDLE_DATA += UB_ETC \
UB_LIBRARY \
UB_FONTS \
......@@ -397,12 +404,11 @@ TRANSLATIONS = resources/i18n/sankore_en.ts \
resources/i18n/sankore_ro.ts \
resources/i18n/sankore_ar.ts \
resources/i18n/sankore_iw.ts \
resources/i18n/sankore_pt.ts
resources/i18n/sankore_pt.ts \
resources/i18n/sankore_sk.ts
INSTALLS = UB_ETC \
UB_I18N \
UB_LIBRARY \
UB_THIRDPARTY_INTERACTIVE
OTHER_FILES +=
#!/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
}
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"
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 ..."
$QMAKE_PATH -spec linux-g++
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
rm -rf install/linux
mkdir -p install/linux
#mv build/linux/release/product build/linux/release/Sankore.$VERSION
cd build/linux/release/product
#Removing .svn directories ...
find . -name .svn -exec rm -rf {} \; 2> /dev/null
#tar cvzf ../../../install/linux/Sankore\ 3.1.tar.gz Sankore_3.1.$VERSION -C .
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"
ARCHITECTURE=`uname -m`
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"
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
......@@ -15,73 +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"
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
ARCHITECTURE=`uname -m`
#######################################################################
# initials checks #
#######################################################################
checkExecutable $QMAKE_PATH
checkExecutable $LRELEASE
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/
if [ ! -e "$PLUGINS_PATH" ]; then
echo "plugins path not found at $PLUGINS_PATH"
exit 1
$LRELEASE Sankore_3.1.pro
#######################################################################
# building #
#######################################################################
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
$QMAKE_PATH -spec linux-g++
checkDirectory $BUILD_DIR
make -j 4 release-install
$LRELEASES "Sankore_3.1.pro"
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_DIR
cp -R resources/linux/qtlinux/* build/linux/release/product/
cp -R resources/customizations $BUILD_DIR
#copying plugins
cp -R $PLUGINS_PATH build/linux/release/product/
#removing debug version
find build/linux/release/product/ -name *.debug -exec rm {} \;
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/"
}
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/"
copyQtLibrary libQtWebKit
copyQtLibrary libQtDBus
copyQtLibrary libQtScript
......@@ -92,16 +151,206 @@ copyQtLibrary libQtXml
copyQtLibrary libQtGui
copyQtLibrary libQtCore
cp "$QT_LIBRARY_SOURCE_PATH/phonon.so.4" "$QT_LIBRARY_DEST_PATH/"
cp "$QT_LIBRARY_SOURCE_PATH/phonon.so.4.4.0" "$QT_LIBRARY_DEST_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
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
rm -rf install/linux
mkdir -p install/linux
mv build/linux/release/product build/linux/release/Open-Sankore.$VERSION
cd build/linux/release
#######################################################################
# Removing unwanted files #
#######################################################################
cd $BUILD_DIR
# "Removing .svn directories ..."
#Removing .svn directories ...
find . -name .svn -exec rm -rf {} \; 2> /dev/null
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 <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_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 <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"
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
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
......@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ---------------------------------------------------------------------
BASE_TROLLTECH_DIRECTORY=/usr/local/Trolltech/Qt-4.7.3
# Executables
QMAKE=$BASE_TROLLTECH_DIRECTORY/bin/qmake
......@@ -28,6 +29,7 @@ LRELEASE=$BASE_TROLLTECH_DIRECTORY/bin/lrelease
# Directories
BUILD_DIR="build/macx/release"
PRODUCT_DIR="$BUILD_DIR/product"
BASE_QT_TRANSLATIONS_DIRECTORY=../Qt-sankore3.1/translations
function notify {
GROWLNOTIFY=`which growlnotify`
......@@ -52,6 +54,31 @@ function checkExecutable {
fi
}
function addQtTranslations {
for eachTranslation in `ls $BASE_QT_TRANSLATIONS_DIRECTORY/qt_??.qm`
do
# looking fo the language code for each qt translation file
languageCode=`echo $eachTranslation | sed 's/.*qt_\(.*\).qm/\1/'`
basicDir=$PRODUCT_DIR/Open-Sankore.app/Contents/Resources/
for eachDirectory in `ls $basicDir`
do
# looping through the Sankore availables languages
directoryLanguageCode=`echo $eachDirectory | sed 's/\(.*\)\.lproj/\1/'`
if [ ! -z $directoryLanguageCode ]; then
if [[ $eachDirectory == *".lproj"* && $eachDirectory != "empty.lproj" && $directoryLanguageCode == *$languageCode* ]]; then
# sankore translation found for qt translation file
cp $eachTranslation $basicDir/$eachDirectory
if [ $directoryLanguageCode != $languageCode ]; then
# handling fr and fr_CH code.
mv $basicDir/$eachDirectory/qt_$languageCode.qm $basicDir/$eachDirectory/qt_$directoryLanguageCode.qm
fi
fi
fi
done
done
}
trap "defaults write com.mnemis.Uniboard.release Running -bool NO" EXIT
notify "Running Uniboard release script (`date`)"
......@@ -77,6 +104,9 @@ checkExecutable "$LRELEASE"
notify "Cleaning ..."
rm -rf "$BUILD_DIR"
notify "Translations ..."
$LRELEASE "Sankore_3.1.pro"
# generate Makefiles
notify "Generating Makefile ..."
......@@ -88,8 +118,11 @@ $QMAKE_CMD
notify "Compiling ..."
make -j4 release
$LRELEASE "Sankore_3.1.pro"
addQtTranslations
cp -R resources/customizations $PRODUCT_DIR/Open-Sankore.app/Contents/Resources
notify "Tagging ..."
VERSION=`cat "$BUILD_DIR/version"`
if [ ! -f "$BUILD_DIR/version" ]; then
echo "version not found"
......@@ -98,8 +131,8 @@ 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 "Generated setup for v$VERSION"
git push origin --tags
# git tag -a "v$VERSION" -m "Generated setup for v$VERSION"
# git push origin --tags
fi
fi
......
......@@ -24,6 +24,7 @@ set WIN_SDK_BIN=%PROGRAMS_FILE_PATH%\Microsoft SDKs\Windows\v6.0A\Bin
set INNO_EXE=%PROGRAMS_FILE_PATH%\Inno Setup 5\iscc.exe
set BUILD_DIR=build\win32\release
set LRELEASE=%QT_DIR%\bin\lrelease
set BASE_QT_TRANSLATIONS_DIRECTORY=%QT_DIR%\translations
set PATH=%QT_BIN%;%PATH%;%WIN_SDK_BIN%;%GIT_BIN%
......@@ -58,6 +59,8 @@ echo %LAST_TAG_VERSION%
REM if not v%VERSION%==%LAST_TAG_VERSION% GOTO EXIT_WITH_ERROR
nmake release-install
copy %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm build\win32\release\product\i18n\
del build\win32\release\product\i18n\qt_help*
del ".\build\win32\release\product\Sankore.pdb"
......
......@@ -24,6 +24,7 @@ set WIN_SDK_BIN=%PROGRAMS_FILE_PATH%\Microsoft SDKs\Windows\v6.0A\Bin
set INNO_EXE=%PROGRAMS_FILE_PATH%\Inno Setup 5\iscc.exe
set BUILD_DIR=build\win32\release
set LRELEASE=%QT_DIR%\bin\lrelease
set BASE_QT_TRANSLATIONS_DIRECTORY=%QT_DIR%\translations
set PATH=%QT_BIN%;%PATH%;%WIN_SDK_BIN%;%GIT_BIN%
......@@ -36,7 +37,7 @@ REM is correct. This is important because installer
REM pick up dll from this directory
IF NOT EXIST "..\Qt-sankore3.1\lib\QtCore4.dll" GOTO EXIT_WITH_ERROR
REM rmdir /S /Q %BUILD_DIR%
rmdir /S /Q %BUILD_DIR%
set EDITION=MNEMIS_EDITION
......@@ -44,21 +45,27 @@ set EDITION=MNEMIS_EDITION
%LRELEASE% Sankore_3.1.pro
set /p VERSION= < build\win32\release\version
git rev-list --tags --max-count=1 > tmp
set /p LAST_TAG= < tmp
erase tmp
git describe %LAST_TAG% > tmp
set /p LAST_TAG_VERSION=< tmp
erase tmp
REM set /p VERSION= < build\win32\release\version
REM git rev-list --tags --max-count=1 > tmp
REM set /p LAST_TAG= < tmp
REM erase tmp
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
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"
set INSTALLER_NAME=Open-Sankore
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -53,7 +53,6 @@ UBImportCFF::~UBImportCFF()
QStringList UBImportCFF::supportedExtentions()
{
return QStringList("iwb");
// return QStringList();
}
......
......@@ -9,6 +9,3 @@ SOURCES += src/api/UBWidgetUniboardAPI.cpp \
src/api/UBW3CWidgetAPI.cpp \
src/api/UBWidgetMessageAPI.cpp
......@@ -351,7 +351,6 @@ void UBBoardController::connectToolbar()
connect(mMainWindow->actionEraseItems, SIGNAL(triggered()), this, SLOT(clearSceneItems()));
connect(mMainWindow->actionEraseAnnotations, SIGNAL(triggered()), this, SLOT(clearSceneAnnotation()));
//connect(mMainWindow->actionUndo, SIGNAL(triggered()), this, SLOT(stopScript()));
connect(mMainWindow->actionUndo, SIGNAL(triggered()), UBApplication::undoStack, SLOT(undo()));
connect(mMainWindow->actionRedo, SIGNAL(triggered()), UBApplication::undoStack, SLOT(redo()));
connect(mMainWindow->actionRedo, SIGNAL(triggered()), this, SLOT(startScript()));
......@@ -670,8 +669,6 @@ void UBBoardController::zoom(const qreal ratio, QPointF scenePoint)
void UBBoardController::handScroll(qreal dx, qreal dy)
{
// mControlView->horizontalScrollBar()->setValue(mControlView->horizontalScrollBar()->value() - dx);
// mControlView->verticalScrollBar()->setValue(mControlView->verticalScrollBar()->value() - dy);
mControlView->translate(dx, dy);
UBApplication::applicationController->adjustDisplayView();
......
......@@ -46,6 +46,9 @@
#include "domain/UBGraphicsPDFItem.h"
#include "domain/UBGraphicsPolygonItem.h"
#include "domain/UBItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsSvgItem.h"
#include "document/UBDocumentProxy.h"
......@@ -117,6 +120,7 @@ UBBoardView::init ()
mUsingTabletEraser = false;
mIsCreatingTextZone = false;
mRubberBand = 0;
mUBRubberBand = 0;
mVirtualKeyboardActive = false;
......@@ -407,10 +411,19 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
else if (currentTool == UBStylusTool::Selector)
{
QSet<QGraphicsItem*> existingTools = scene()->tools();
// QSet<QGraphicsItem*> existingTools = scene()->tools(); why do we need to get tools here?
movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint()));
if (!movingItem) {
// Rubberband selection implementation
if (!mUBRubberBand) {
mUBRubberBand = new UBRubberBand(QRubberBand::Rectangle, this);
}
mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ()));
mUBRubberBand->show();
}
if (!movingItem
|| movingItem->isSelected()
|| movingItem->type() == UBGraphicsDelegateFrame::Type
......@@ -436,6 +449,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
suspendedMousePressEvent = new QMouseEvent(event->type(), event->pos(), event->button(), event->buttons(), event->modifiers()); // удалить
}
event->accept();
}
else if (currentTool == UBStylusTool::Text)
......@@ -463,7 +477,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
if (!mRubberBand)
mRubberBand = new UBRubberBand (QRubberBand::Rectangle, this);
mRubberBand->setGeometry (QRect (mMouseDownPos, QSize ()));
mRubberBand->show ();
mIsCreatingTextZone = true;
......@@ -500,6 +513,8 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
}
QSet<QGraphicsItem*> mJustSelectedItems;
void
UBBoardView::mouseMoveEvent (QMouseEvent *event)
{
......@@ -526,6 +541,35 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
return;
}
if (mUBRubberBand && mUBRubberBand->isVisible()) {
QRect bandRect(mMouseDownPos, event->pos());
bandRect = bandRect.normalized();
mUBRubberBand->setGeometry(bandRect);
QList<QGraphicsItem *> rubberItems = items(bandRect);
foreach (QGraphicsItem *item, mJustSelectedItems) {
if (!rubberItems.contains(item)) {
item->setSelected(false);
mJustSelectedItems.remove(item);
}
}
foreach (QGraphicsItem *item, items(bandRect)) {
if (item->type() == UBGraphicsW3CWidgetItem::Type
|| item->type() == UBGraphicsPixmapItem::Type
|| item->type() == UBGraphicsVideoItem::Type
|| item->type() == UBGraphicsAudioItem::Type
|| item->type() == UBGraphicsSvgItem::Type) {
if (!mJustSelectedItems.contains(item)) {
item->setSelected(true);
mJustSelectedItems.insert(item);
}
}
}
}
if (movingItem && (mMouseButtonIsPressed || mTabletStylusIsPressed))
{
QPointF scenePos = mapToScene(event->pos());
......@@ -591,6 +635,10 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
suspendedMousePressEvent = NULL;
}
if (mUBRubberBand && mUBRubberBand->isVisible()) {
mUBRubberBand->hide();
}
QGraphicsView::mouseReleaseEvent (event);
}
else if (currentTool == UBStylusTool::Text)
......
......@@ -24,6 +24,7 @@ class UBBoardController;
class UBAppleWidget;
class UBGraphicsScene;
class UBGraphicsWidgetItem;
class UBRubberBand;
class UBBoardView : public QGraphicsView
{
......@@ -123,6 +124,8 @@ class UBBoardView : public QGraphicsView
QGraphicsItem *movingItem;
QMouseEvent *suspendedMousePressEvent;
UBRubberBand *mUBRubberBand;
private slots:
void settingChanged(QVariant newValue);
......
......@@ -18,6 +18,7 @@
#include <QtGui>
#include <QtWebKit>
#include <QtXml>
#include <QFontDatabase>
#if defined(Q_WS_MACX)
#include <Carbon/Carbon.h>
......@@ -101,8 +102,10 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event,
#endif
UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv),
mPreferencesController(NULL)
UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv)
, mPreferencesController(NULL)
, mApplicationTranslator(NULL)
, mQtGuiTranslator(NULL)
{
staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor
......@@ -136,22 +139,20 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
undoStack = new QUndoStack(staticMemoryCleaner);
}
QTranslator *translator = new QTranslator(this);
translator->load(UBPlatformUtils::preferredTranslation());
installTranslator(translator);
mApplicationTranslator = new QTranslator(this);
mApplicationTranslator->load(UBPlatformUtils::preferredTranslation(QString("sankore_")));
installTranslator(mApplicationTranslator);
QString localString;
if (!translator->isEmpty())
{
if (!mApplicationTranslator->isEmpty())
localString = UBPlatformUtils::preferredLanguage();
}
else
{
localString = "en_US";
}
mQtGuiTranslator = new QTranslator(this);
mQtGuiTranslator->load(UBPlatformUtils::preferredTranslation(QString("qt_")));
installTranslator(mQtGuiTranslator);
QLocale::setDefault(QLocale(localString));
qDebug() << "Running application in:" << localString;
......@@ -203,6 +204,15 @@ UBApplication::~UBApplication()
UBToolsManager::destroy();
if(mApplicationTranslator != NULL){
delete mApplicationTranslator;
mApplicationTranslator = NULL;
}
if(mQtGuiTranslator!=NULL){
delete mQtGuiTranslator;
mQtGuiTranslator = NULL;
}
delete staticMemoryCleaner;
staticMemoryCleaner = 0;
}
......@@ -252,7 +262,7 @@ int UBApplication::exec(const QString& pFileToImport)
boardController->paletteManager()->connectToDocumentController();
UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Selector);
UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Pen);
applicationController = new UBApplicationController(boardController->controlView(), boardController->displayView(), mainWindow, staticMemoryCleaner);
......@@ -312,7 +322,8 @@ int UBApplication::exec(const QString& pFileToImport)
#endif
if (UBSettings::settings()->appStartMode->get() == "Desktop")
applicationController->showDesktop();
else applicationController->showBoard();
else
applicationController->showBoard();
if (UBSettings::settings()->appIsInSoftwareUpdateProcess->get().toBool())
......@@ -341,8 +352,6 @@ int UBApplication::exec(const QString& pFileToImport)
}
}
return QApplication::exec();
}
......@@ -533,16 +542,16 @@ void UBApplication::updateProtoActionsState()
void UBApplication::insertSpaceToToolbarBeforeAction(QToolBar* toolbar, QAction* action, int width)
{
QWidget* spacer = new QWidget();
QHBoxLayout *layout = new QHBoxLayout();
if (width >= 0)
if (width >= 0){
QHBoxLayout *layout = new QHBoxLayout();
layout->addSpacing(width);
spacer->setLayout(layout);
}
else
layout->addStretch();
spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
spacer->setLayout(layout);
toolbar->insertWidget(action, spacer);
}
......
......@@ -118,8 +118,8 @@ class UBApplication : public QtSingleApplication
void showMinimized();
#endif
void importUniboardFiles();
private:
private:
void updateProtoActionsState();
QList<QMenu*> mProtoMenus;
bool mIsVerbose;
......@@ -131,6 +131,8 @@ class UBApplication : public QtSingleApplication
#endif
UBPreferencesController* mPreferencesController;
QTranslator* mApplicationTranslator;
QTranslator* mQtGuiTranslator;
};
......
......@@ -173,6 +173,7 @@ void UBApplicationController::screenLayoutChanged()
void UBApplicationController::adaptToolBar()
{
bool highResolution = mMainWindow->width() > 1024;
mMainWindow->actionClearPage->setVisible(Board == mMainMode && highResolution);
mMainWindow->actionBoard->setVisible(Board != mMainMode || highResolution);
mMainWindow->actionDocument->setVisible(Document != mMainMode || highResolution);
......
......@@ -286,15 +286,7 @@ void UBPreferencesController::defaultSettings()
if (mPreferencesUI->mainTabWidget->currentWidget() == mPreferencesUI->displayTab)
{
bool defaultValue = settings->webUseExternalBrowser->reset().toBool();
mPreferencesUI->useExternalBrowserCheckBox->setChecked(defaultValue);
defaultValue = settings->webShowPageImmediatelyOnMirroredScreen->reset().toBool();
mPreferencesUI->displayBrowserPageCheckBox->setChecked(defaultValue);
mPreferencesUI->webHomePage->setText(settings->webHomePage->reset().toString());
defaultValue = settings->appToolBarPositionedAtTop->reset().toBool();
bool defaultValue = settings->appToolBarPositionedAtTop->reset().toBool();
mPreferencesUI->toolbarAtTopRadioButton->setChecked(defaultValue);
mPreferencesUI->toolbarAtBottomRadioButton->setChecked(!defaultValue);
......@@ -350,6 +342,15 @@ void UBPreferencesController::defaultSettings()
bool defaultValue = settings->appEnableAutomaticSoftwareUpdates->reset().toBool();
mPreferencesUI->checkSoftwareUpdateAtLaunchCheckBox->setChecked(defaultValue);
}
else if(mPreferencesUI->mainTabWidget->currentWidget() == mPreferencesUI->networkTab){
bool defaultValue = settings->webUseExternalBrowser->reset().toBool();
mPreferencesUI->useExternalBrowserCheckBox->setChecked(defaultValue);
defaultValue = settings->webShowPageImmediatelyOnMirroredScreen->reset().toBool();
mPreferencesUI->displayBrowserPageCheckBox->setChecked(defaultValue);
mPreferencesUI->webHomePage->setText(settings->webHomePage->reset().toString());
}
}
......
......@@ -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 = "";
......
......@@ -118,6 +118,8 @@ class UBSettings : public QObject
QString applicationImageLibraryDirectory();
QString applicationApplicationsLibraryDirectory();
QString applicationInteractivesDirectory();
QString applicationCustomizationDirectory();
QString applicationCustomFontDirectory();
QNetworkProxy* httpProxy();
......
......@@ -52,11 +52,9 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mTransparentDrawingView(0)
, mTransparentDrawingScene(0)
, mDesktopPalette(NULL)
// , mKeyboardPalette(0)
, mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL)
// , mRightPalette(NULL)
, mWindowPositionInitialized(0)
, mIsFullyTransparent(false)
, mDesktopToolsPalettePositioned(false)
......@@ -90,27 +88,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView->setScene(mTransparentDrawingScene);
mTransparentDrawingScene->setDrawingMode(true);
// mRightPalette = UBApplication::boardController->paletteManager()->createDesktopRightPalette(mTransparentDrawingView);
//mRightPalette = new UBRightPalette(mTransparentDrawingView);
mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView);
if (UBPlatformUtils::hasVirtualKeyboard())
{
#ifdef Q_WS_X11
// mKeyboardPalette = UBKeyboardPalette::create(0);
// connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide()));
// connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard()));
#else
// mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView);
// mKeyboardPalette->setParent(mTransparentDrawingView);
#endif
connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)),
mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)),
// mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_WS_X11
connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask()));
......@@ -124,8 +108,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture()));
connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized()));
connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize()));
// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized()));
......
......@@ -138,6 +138,21 @@ UBGraphicsItemDelegate::~UBGraphicsItemDelegate()
QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemSelectedHasChanged) {
bool ok;
bool selected = value.toUInt(&ok);
if (ok) {
UBGraphicsScene *ubScene = castUBGraphicsScene();
if (ubScene) {
if (selected) {
ubScene->setSelectedZLevel(delegated());
} else {
ubScene->setOwnZlevel(delegated());
}
}
}
}
if ((change == QGraphicsItem::ItemSelectedHasChanged
|| change == QGraphicsItem::ItemPositionHasChanged
|| change == QGraphicsItem::ItemTransformHasChanged)
......@@ -145,19 +160,6 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
{
mAntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom());
if (mDelegated->isSelected())
{
QList<QGraphicsItem*> items = mDelegated->scene()->selectedItems();
foreach(QGraphicsItem* item, items)
{
if (item != mDelegated)
{
item->setSelected(false);
}
}
}
positionHandles();
}
......@@ -247,6 +249,17 @@ bool UBGraphicsItemDelegate::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event);
//Deselect all the rest selected items if no ctrl key modifier
if (delegated()->scene()
&& delegated()->scene()->selectedItems().count()
&& event->modifiers() != Qt::ControlModifier) {
foreach (QGraphicsItem *item, delegated()->scene()->selectedItems()) {
if (item != delegated()) {
item->setSelected(false);
}
}
}
commitUndoStep();
return true;
......
......@@ -308,17 +308,6 @@ void UBGraphicsScene::selectionChangedProcessing()
if (selectedItems().count())
UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f') + "own z value is "
+ QString::number(selectedItems().first()->data(UBGraphicsItemData::ItemOwnZValue).toReal(), 'f'));
QList<QGraphicsItem *> allItemsList = items();
for( int i = 0; i < allItemsList.size(); i++ ) {
QGraphicsItem *nextItem = allItemsList.at(i);
if (nextItem->isSelected()) {
nextItem->setZValue(mZLayerController->generateZLevel(itemLayerType::SelectedItem));
} else {
nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
}
}
}
// MARK: -
......@@ -1968,17 +1957,13 @@ void UBGraphicsScene::setNominalSize(int pWidth, int pHeight)
setNominalSize(QSize(pWidth, pHeight));
}
void UBGraphicsScene::setSelectedZLevel(QList<QGraphicsItem *> itemList)
void UBGraphicsScene::setSelectedZLevel(QGraphicsItem * item)
{
foreach (QGraphicsItem *item, itemList) {
item->setZValue(mZLayerController->generateZLevel(itemLayerType::SelectedItem));
}
}
void UBGraphicsScene::setOwnZlevel(QList<QGraphicsItem *> itemList)
void UBGraphicsScene::setOwnZlevel(QGraphicsItem *item)
{
foreach (QGraphicsItem *item, itemList) {
item->setZValue(item->data(UBGraphicsItemData::ItemOwnZValue).toReal());
}
}
qreal UBGraphicsScene::changeZLevelTo(QGraphicsItem *item, UBZLayerController::moveDestination dest)
......
......@@ -285,8 +285,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
return mPreviousPoint;
}
void setSelectedZLevel(QList<QGraphicsItem *> itemList);
void setOwnZlevel(QList<QGraphicsItem *> itemList);
void setSelectedZLevel(QGraphicsItem *item);
void setOwnZlevel(QGraphicsItem *item);
public slots:
void hideEraser();
......
......@@ -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);
......
......@@ -103,7 +103,7 @@ class UBPlatformUtils
static void setFileType(const QString &filePath, unsigned long fileType);
static void fadeDisplayOut();
static void fadeDisplayIn();
static QString preferredTranslation();
static QString preferredTranslation(QString pFilePrefix);
static QString preferredLanguage();
static bool hasVirtualKeyboard();
//static void showVirtualKeyboard();
......
......@@ -55,9 +55,9 @@ void UBPlatformUtils::fadeDisplayIn()
// NOOP
}
QString UBPlatformUtils::preferredTranslation()
QString UBPlatformUtils::preferredTranslation(QString pFilePrefix)
{
QString qmPath = applicationResourcesDirectory() + "/" + "i18n" + "/" + QString("sankore_") + preferredLanguage() + ".qm";
QString qmPath = applicationResourcesDirectory() + "/" + "i18n" + "/" + pFilePrefix + preferredLanguage() + ".qm";
return qmPath;
}
......
......@@ -182,9 +182,10 @@ void UBPlatformUtils::fadeDisplayIn()
}
}
QString UBPlatformUtils::preferredTranslation()
QString UBPlatformUtils::preferredTranslation(QString pFilePrefix)
{
QString qmPath;
NSString* filePrefix = [[NSString alloc] initWithUTF8String:(const char*)(pFilePrefix.toUtf8())];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
......@@ -192,7 +193,7 @@ QString UBPlatformUtils::preferredTranslation()
if (lprojPath)
{
NSString *lang = [[lprojPath lastPathComponent] stringByDeletingPathExtension];
NSString *translationFilePath = [lprojPath stringByAppendingPathComponent:[[@"sankore_" stringByAppendingString:lang] stringByAppendingPathExtension:@"qm"]];
NSString *translationFilePath = [lprojPath stringByAppendingPathComponent:[[filePrefix stringByAppendingString:lang] stringByAppendingPathExtension:@"qm"]];
qmPath = QString::fromUtf8([translationFilePath UTF8String], strlen([translationFilePath UTF8String]));
}
......@@ -202,7 +203,7 @@ QString UBPlatformUtils::preferredTranslation()
QString UBPlatformUtils::preferredLanguage()
{
QFileInfo qmFileInfo = QFileInfo(preferredTranslation());
QFileInfo qmFileInfo = QFileInfo(preferredTranslation("sankore_"));
QDir lprojPath = qmFileInfo.dir();
QFileInfo lprojFileInfo = QFileInfo(lprojPath.absolutePath());
return lprojFileInfo.baseName();
......
......@@ -324,6 +324,7 @@ void UBDockPalette::toggleCollapseExpand()
{
// The palette must be collapsed
mLastWidth = width();
update();
resize(0, height());
}
else
......@@ -702,6 +703,7 @@ void UBTabDockPalette::mouseMoveEvent(QMouseEvent *event)
case eUBDockOrientation_Left:
p.setX(p.x() + dock->width());
if(p.x() < dock->collapseWidth() && p.x() >= dock->minimumWidth()) {
dock->update();
dock->resize(0, dock->height());
dock->mLastWidth = dock->collapseWidth() + 1;
dock->mResized = true;
......@@ -714,6 +716,7 @@ void UBTabDockPalette::mouseMoveEvent(QMouseEvent *event)
case eUBDockOrientation_Right:
p.setX(p.x() - 2 * dock->border());
if((dock->x() + p.x() > dock->parentWidget()->width() - dock->collapseWidth()) && (dock->x() + p.x() < dock->parentWidget()->width())) {
dock->update();
dock->resize(0, dock->height());
dock->mLastWidth = dock->collapseWidth() + 1;
dock->mResized = true;
......
......@@ -115,7 +115,7 @@ void UBKeyboardPalette::createCtrlButtons()
ctrlButtons[0] = new UBCntrlButton(this, "<-", XK_BackSpace);
ctrlButtons[1] = new UBCntrlButton(this, "<->", XK_Tab);
ctrlButtons[2] = new UBCntrlButton(this, "Enter", XK_Return);
ctrlButtons[2] = new UBCntrlButton(this, tr("Enter"), XK_Return);
ctrlButtons[3] = new UBCapsLockButton(this, "capslock");
ctrlButtons[4] = new UBCapsLockButton(this, "capslock");
ctrlButtons[5] = new UBLocaleButton(this);
......
......@@ -50,7 +50,7 @@ void UBKeyboardPalette::createCtrlButtons()
ctrlButtons[0] = new UBCntrlButton(this, "<-", 51);
ctrlButtons[1] = new UBCntrlButton(this, "<->", 48);
ctrlButtons[2] = new UBCntrlButton(this, "Enter", 76);
ctrlButtons[2] = new UBCntrlButton(this, tr("Enter"), 76);
ctrlButtons[3] = new UBCapsLockButton(this, "capslock");
ctrlButtons[4] = new UBCapsLockButton(this, "capslock");
ctrlButtons[5] = new UBLocaleButton(this);
......
......@@ -59,7 +59,7 @@ void UBKeyboardPalette::createCtrlButtons()
ctrlButtons[ctrlID++] = new UBCntrlButton(this, 0x09, "tab"); // Tab
// ctrlButtons[ctrlID++] = new UBKeyButton(this); // Row 2 Stub
// ctrlButtons[ctrlID++] = new UBKeyButton(this); // Row 3 Stub
ctrlButtons[ctrlID++] = new UBCntrlButton(this, "Enter", 0x0d); // Enter
ctrlButtons[ctrlID++] = new UBCntrlButton(this, tr("Enter"), 0x0d); // Enter
ctrlButtons[ctrlID++] = new UBCapsLockButton(this, "capslock"); // Caps Lock
ctrlButtons[ctrlID++] = new UBCapsLockButton(this, "capslock"); // Caps Lock
ctrlButtons[ctrlID++] = new UBLocaleButton(this); // Language Switch
......
......@@ -18,9 +18,11 @@
#include <QtGui>
#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);
}
}
......@@ -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:
......
......@@ -16,6 +16,8 @@
#include "UBRubberBand.h"
#include <QtGui>
#include <QtGui/QPlastiqueStyle>
#include <QStyleFactory>
#ifdef Q_WS_MAC
#include <QtGui/QMacStyle>
......@@ -32,10 +34,13 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p)
customStyle = new QWindowsXPStyle();
#elif defined(Q_WS_MAC)
customStyle = new QMacStyle();
#elif defined(Q_WS_X11)
// customStyle = QStyleFactory::create("oxygen");
#endif
if (customStyle)
QRubberBand::setStyle(customStyle);
}
UBRubberBand::~UBRubberBand()
......
......@@ -25,6 +25,7 @@ class UBRubberBand : public QRubberBand
public:
UBRubberBand(Shape s, QWidget * p = 0);
virtual ~UBRubberBand();
private:
QStyle* customStyle;
};
......
......@@ -128,9 +128,7 @@ void UBWebController::webBrowserInstance()
WBBrowserWindow::downloadManager()->setParent((*mCurrentWebBrowser), Qt::Tool);
UBApplication::app()->insertSpaceToToolbarBeforeAction(mMainWindow->webToolBar,
mMainWindow->actionBoard, 32);
UBApplication::app()->insertSpaceToToolbarBeforeAction(mMainWindow->webToolBar, mMainWindow->actionBoard, 32);
UBApplication::app()->decorateActionMenu(mMainWindow->actionMenu);
bool showAddBookmarkButtons = UBSettings::settings()->webShowAddBookmarkButton->get().toBool();
......@@ -151,8 +149,6 @@ void UBWebController::webBrowserInstance()
(*mCurrentWebBrowser)->tabWidget()->tabBar()->show();
(*mCurrentWebBrowser)->tabWidget()->lineEdits()->show();
// (*mCurrentWebBrowser)->tabWidget()->tabBar()->hide();
// (*mCurrentWebBrowser)->tabWidget()->lineEdits()->hide();
}
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment