Commit 0a1799a5 authored by Ivan Ilin's avatar Ivan Ilin

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

parents 26ae8fb2 f0d153fe
......@@ -54,6 +54,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 +=
......@@ -26,6 +26,9 @@ 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"
......@@ -36,10 +39,14 @@ if [ ! -e "$PLUGINS_PATH" ]; then
fi
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"
VERSION=`cat build/linux/release/version`
......@@ -49,8 +56,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 "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
......@@ -92,15 +99,31 @@ else
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
#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"
......@@ -191,7 +214,6 @@ 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
......
......@@ -23,6 +23,8 @@ 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"
QT_GUI_TRANSLATIONS_DIRECTORY="../Qt-sankore3.1/translations"
QT_GUI_TRANSLATIONS_PRO_FILE="$QT_GUI_TRANSLATIONS_DIRECTORY/translations.pro"
if [ ! -e "$QMAKE_PATH" ]; then
echo "qmake command not found at $QMAKE_PATH"
......@@ -35,11 +37,22 @@ if [ ! -e "$PLUGINS_PATH" ]; then
exit 1
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
$LRELEASES "Sankore_3.1.pro"
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
......@@ -79,9 +92,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 libQtDBus
copyQtLibrary libQtScript
......@@ -92,8 +102,25 @@ 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/"
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"
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
......
......@@ -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`)"
......@@ -88,8 +115,14 @@ $QMAKE_CMD
notify "Compiling ..."
make -j4 release
notify "Translations ..."
$LRELEASE "Sankore_3.1.pro"
addQtTranslations
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,13 +45,13 @@ 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%
......@@ -59,6 +60,10 @@ 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"
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();
}
......
......@@ -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();
......
......@@ -101,8 +101,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 +138,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 +203,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 +261,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 +321,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())
......@@ -533,16 +543,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);
}
......
......@@ -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());
}
}
......
......@@ -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()));
......
......@@ -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
......
......@@ -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