fixed issue SANKORE-574 and font manager is now translated depending on the system lanaguage (linux only but other will be fixed soon too) and some script build issues fixed on linux

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent a95472cdab
commit 3ad8f5c448
  1. 36
      buildDebianPackage
  2. 33
      release.linux.sh
  3. 37
      src/core/UBApplication.cpp
  4. 2
      src/core/UBApplication.h
  5. 1
      src/core/UBDisplayManager.cpp
  6. 18
      src/desktop/UBDesktopAnnotationController.cpp
  7. 2
      src/frameworks/UBPlatformUtils.h
  8. 4
      src/frameworks/UBPlatformUtils_linux.cpp
  9. 4
      src/frameworks/UBPlatformUtils_mac.mm
  10. BIN
      src/frameworks/UBPlatformUtils_win.cpp

@ -26,6 +26,9 @@ rm -rf install
QT_PATH="/usr/local/Trolltech/Qt-4.7.3" QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
PLUGINS_PATH="$QT_PATH/plugins" PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake" 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 if [ ! -e "$QMAKE_PATH" ]; then
notifyError "qmake command not found at $QMAKE_PATH" notifyError "qmake command not found at $QMAKE_PATH"
@ -36,10 +39,14 @@ if [ ! -e "$PLUGINS_PATH" ]; then
fi fi
notify-send "Open-Sankore" "Building Open-Sankore ..." notify-send "Open-Sankore" "Building Open-Sankore ..."
$QMAKE_PATH -spec linux-g++
make -j 4 release-install 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" notify-send "Git Hub" "Make a tag of the delivered version"
VERSION=`cat build/linux/release/version` VERSION=`cat build/linux/release/version`
@ -49,8 +56,8 @@ else
LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`"
if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then
echo creating a tag with the version $VERSION echo creating a tag with the version $VERSION
# git tag -a "v$VERSION" -m "Generating setup for v$VERSION" git tag -a "v$VERSION" -m "Generating setup for v$VERSION"
# git push origin --tags git push origin --tags
fi fi
fi fi
@ -92,15 +99,31 @@ else
cp "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4.4.0" "$QT_LIBRARY_DEST_PATH/" cp "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4.4.0" "$QT_LIBRARY_DEST_PATH/"
fi 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 rm -rf install/linux
mkdir -p install/linux mkdir -p install/linux
#mv build/linux/release/product build/linux/release/Sankore.$VERSION
cd build/linux/release/product cd build/linux/release/product
#Removing .svn directories ... #Removing .svn directories ...
find . -name .svn -exec rm -rf {} \; 2> /dev/null find . -name .svn -exec rm -rf {} \; 2> /dev/null
#tar cvzf ../../../install/linux/Sankore\ 3.1.tar.gz Sankore_3.1.$VERSION -C .
cd - cd -
notify-send "Building Sankore" "Finished to build Sankore building the package" notify-send "Building Sankore" "Finished to build Sankore building the package"
@ -191,7 +214,6 @@ CHANGE_LOG_FILE="$BASE_WORKING_DIR/DEBIAN/changelog-sankore-$VERSION.txt"
CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control" CONTROL_FILE="$BASE_WORKING_DIR/DEBIAN/control"
CHANGE_LOG_TEXT="changelog.txt" CHANGE_LOG_TEXT="changelog.txt"
ARCHITECTURE=`uname -m`
if [ "$ARCHITECTURE" == "x86_64" ]; then if [ "$ARCHITECTURE" == "x86_64" ]; then
ARCHITECTURE="amd64" ARCHITECTURE="amd64"
fi fi

@ -23,6 +23,7 @@ QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
PLUGINS_PATH="$QT_PATH/plugins" PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake" QMAKE_PATH="$QT_PATH/bin/qmake"
LRELEASES="/usr/local/Trolltech/Qt-4.7.3/bin/lrelease" LRELEASES="/usr/local/Trolltech/Qt-4.7.3/bin/lrelease"
GUI_TRANSLATIONS_DIRECTORY_PATH="../Qt-sankore3.1/translations"
if [ ! -e "$QMAKE_PATH" ]; then if [ ! -e "$QMAKE_PATH" ]; then
echo "qmake command not found at $QMAKE_PATH" echo "qmake command not found at $QMAKE_PATH"
@ -35,11 +36,15 @@ if [ ! -e "$PLUGINS_PATH" ]; then
exit 1 exit 1
fi fi
$QMAKE_PATH -spec linux-g++ ARCHITECTURE=`uname -m`
if [ "$ARCHITECTURE" == "x86_64" ]; then
$QMAKE_PATH -spec linux-g++-64
else
$QMAKE_PATH -spec linux-g++
fi
make -j 4 release-install make -j 4 release-install
$LRELEASES "Sankore_3.1.pro"
VERSION=`cat build/linux/release/version` VERSION=`cat build/linux/release/version`
if [ ! -f build/linux/release/version ]; then if [ ! -f build/linux/release/version ]; then
@ -79,9 +84,6 @@ copyQtLibrary(){
} }
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 libQtWebKit
copyQtLibrary libQtDBus copyQtLibrary libQtDBus
copyQtLibrary libQtScript copyQtLibrary libQtScript
@ -92,8 +94,25 @@ copyQtLibrary libQtXml
copyQtLibrary libQtGui copyQtLibrary libQtGui
copyQtLibrary libQtCore copyQtLibrary libQtCore
cp "$QT_LIBRARY_SOURCE_PATH/phonon.so.4" "$QT_LIBRARY_DEST_PATH/" cp "$QT_LIBRARY_SOURCE_PATH/libphonon.so.4" "$QT_LIBRARY_DEST_PATH/"
cp "$QT_LIBRARY_SOURCE_PATH/phonon.so.4.4.0" "$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"
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 rm -rf install/linux
mkdir -p install/linux mkdir -p install/linux

@ -101,8 +101,10 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event,
#endif #endif
UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv), UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv)
mPreferencesController(NULL) , mPreferencesController(NULL)
, mApplicationTranslator(NULL)
, mQtGuiTranslator(NULL)
{ {
staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor
@ -136,22 +138,20 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
undoStack = new QUndoStack(staticMemoryCleaner); undoStack = new QUndoStack(staticMemoryCleaner);
} }
QTranslator *translator = new QTranslator(this); mApplicationTranslator = new QTranslator(this);
mApplicationTranslator->load(UBPlatformUtils::preferredTranslation(QString("sankore_")));
translator->load(UBPlatformUtils::preferredTranslation()); installTranslator(mApplicationTranslator);
installTranslator(translator);
QString localString; QString localString;
if (!mApplicationTranslator->isEmpty())
if (!translator->isEmpty())
{
localString = UBPlatformUtils::preferredLanguage(); localString = UBPlatformUtils::preferredLanguage();
}
else else
{
localString = "en_US"; localString = "en_US";
}
mQtGuiTranslator = new QTranslator(this);
mQtGuiTranslator->load(UBPlatformUtils::preferredTranslation(QString("qt_")));
installTranslator(mQtGuiTranslator);
QLocale::setDefault(QLocale(localString)); QLocale::setDefault(QLocale(localString));
qDebug() << "Running application in:" << localString; qDebug() << "Running application in:" << localString;
@ -203,6 +203,15 @@ UBApplication::~UBApplication()
UBToolsManager::destroy(); UBToolsManager::destroy();
if(mApplicationTranslator != NULL){
delete mApplicationTranslator;
mApplicationTranslator = NULL;
}
if(mQtGuiTranslator!=NULL){
delete mQtGuiTranslator;
mQtGuiTranslator = NULL;
}
delete staticMemoryCleaner; delete staticMemoryCleaner;
staticMemoryCleaner = 0; staticMemoryCleaner = 0;
} }
@ -252,7 +261,7 @@ int UBApplication::exec(const QString& pFileToImport)
boardController->paletteManager()->connectToDocumentController(); boardController->paletteManager()->connectToDocumentController();
UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Selector); UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Pen);
applicationController = new UBApplicationController(boardController->controlView(), boardController->displayView(), mainWindow, staticMemoryCleaner); applicationController = new UBApplicationController(boardController->controlView(), boardController->displayView(), mainWindow, staticMemoryCleaner);

@ -132,6 +132,8 @@ class UBApplication : public QtSingleApplication
#endif #endif
UBPreferencesController* mPreferencesController; UBPreferencesController* mPreferencesController;
QTranslator* mApplicationTranslator;
QTranslator* mQtGuiTranslator;
}; };

@ -142,7 +142,6 @@ void UBDisplayManager::setAsDesktop(QWidget* pControlWidget )
mDesktopWidget = pControlWidget; mDesktopWidget = pControlWidget;
mDesktopWidget->hide(); mDesktopWidget->hide();
mDesktopWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex)); mDesktopWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex));
// mDisplayWidget->showFullScreen();
// !!!! Should be included into Windows after QT recompilation // !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
// mControlWidget->setAttribute(Qt::WA_MacNoShadow); // mControlWidget->setAttribute(Qt::WA_MacNoShadow);

@ -52,11 +52,9 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mTransparentDrawingView(0) , mTransparentDrawingView(0)
, mTransparentDrawingScene(0) , mTransparentDrawingScene(0)
, mDesktopPalette(NULL) , mDesktopPalette(NULL)
// , mKeyboardPalette(0)
, mDesktopPenPalette(NULL) , mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL) , mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL) , mDesktopEraserPalette(NULL)
// , mRightPalette(NULL)
, mWindowPositionInitialized(0) , mWindowPositionInitialized(0)
, mIsFullyTransparent(false) , mIsFullyTransparent(false)
, mDesktopToolsPalettePositioned(false) , mDesktopToolsPalettePositioned(false)
@ -89,27 +87,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingScene = new UBGraphicsScene(0); mTransparentDrawingScene = new UBGraphicsScene(0);
mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingView->setScene(mTransparentDrawingScene);
// mRightPalette = UBApplication::boardController->paletteManager()->createDesktopRightPalette(mTransparentDrawingView);
//mRightPalette = new UBRightPalette(mTransparentDrawingView);
mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView); mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView);
if (UBPlatformUtils::hasVirtualKeyboard()) 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)), connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)),
mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)),
// mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_WS_X11 #ifdef Q_WS_X11
connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask())); connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask()));
@ -123,8 +107,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture()));
connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized()));
connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); 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())); connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized()));

@ -103,7 +103,7 @@ class UBPlatformUtils
static void setFileType(const QString &filePath, unsigned long fileType); static void setFileType(const QString &filePath, unsigned long fileType);
static void fadeDisplayOut(); static void fadeDisplayOut();
static void fadeDisplayIn(); static void fadeDisplayIn();
static QString preferredTranslation(); static QString preferredTranslation(QString pFilePrefix);
static QString preferredLanguage(); static QString preferredLanguage();
static bool hasVirtualKeyboard(); static bool hasVirtualKeyboard();
//static void showVirtualKeyboard(); //static void showVirtualKeyboard();

@ -55,9 +55,9 @@ void UBPlatformUtils::fadeDisplayIn()
// NOOP // 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; return qmPath;
} }

@ -182,7 +182,7 @@ void UBPlatformUtils::fadeDisplayIn()
} }
} }
QString UBPlatformUtils::preferredTranslation() QString UBPlatformUtils::preferredTranslation(QString pFilePrefix)
{ {
QString qmPath; QString qmPath;
@ -202,7 +202,7 @@ QString UBPlatformUtils::preferredTranslation()
QString UBPlatformUtils::preferredLanguage() QString UBPlatformUtils::preferredLanguage()
{ {
QFileInfo qmFileInfo = QFileInfo(preferredTranslation()); QFileInfo qmFileInfo = QFileInfo(applicationPreferredTranslation());
QDir lprojPath = qmFileInfo.dir(); QDir lprojPath = qmFileInfo.dir();
QFileInfo lprojFileInfo = QFileInfo(lprojPath.absolutePath()); QFileInfo lprojFileInfo = QFileInfo(lprojPath.absolutePath());
return lprojFileInfo.baseName(); return lprojFileInfo.baseName();

Loading…
Cancel
Save