added a preference to start the application using a language different from the one of the system

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 2b8c26028c
commit 0a40c2f36c
  1. 1
      src/adaptors/UBCFFSubsetAdaptor.cpp
  2. 3
      src/adaptors/UBThumbnailAdaptor.cpp
  3. 10
      src/core/UBApplication.cpp
  4. 2
      src/core/UBSettings.cpp
  5. 1
      src/core/UBSettings.h

@ -15,6 +15,7 @@
#include <QRegExp>
#include <QSvgGenerator>
#include <QSvgRenderer>
#include <QPixmap>
#include "core/UBPersistenceManager.h"

@ -92,7 +92,8 @@ QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy)
QPixmap pix;
//Warning. Works only with modified Qt
#ifdef Q_WS_X11
pix.load(fileName, 0, Qt::AutoColor);
//pix.load(fileName, 0, Qt::AutoColor);
pix.load(fileName, 0);
#else
pix.load(fileName, 0, Qt::AutoColor, false);
#endif

@ -135,14 +135,18 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
if (!undoStack)
undoStack = new QUndoStack(staticMemoryCleaner);
UBSettings *settings = UBSettings::settings();
QString forcedLanguage("");
if(args.contains("-lang"))
forcedLanguage=args.at(args.indexOf("-lang") + 1);
else{
QString setLanguage = settings->appPreferredLanguage->get().toString();
if(!setLanguage.isEmpty())
forcedLanguage = setLanguage;
}
setupTranslator(forcedLanguage);
UBSettings *settings = UBSettings::settings();
connect(settings->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(toolBarPositionChanged(QVariant)));
connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), this, SLOT(toolBarDisplayTextChanged(QVariant)));
updateProtoActionsState();

@ -206,6 +206,8 @@ void UBSettings::init()
appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true);
appEnableSoftwareUpdates = new UBSetting(this, "App", "EnableSoftwareUpdates", true);
appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false);
appPreferredLanguage = new UBSetting(this,"App","PreferredLanguage", "");
navigPaletteWidth = new UBSetting(this, "Board", "NavigPaletteWidth", 270);
rightLibPaletteWidth = new UBSetting(this, "Board", "RightLibPaletteWidth", 270);
leftLibPaletteWidth = new UBSetting(this, "Board", "LeftLibPaletteWidth",270);

@ -214,6 +214,7 @@ class UBSettings : public QObject
UBSetting* appEnableAutomaticSoftwareUpdates;
UBSetting* appEnableSoftwareUpdates;
UBSetting* appToolBarOrientationVertical;
UBSetting* appPreferredLanguage;
UBSetting* appIsInSoftwareUpdateProcess;

Loading…
Cancel
Save