Commit 8a657f1b authored by Jan Möbius's avatar Jan Möbius

Moved translation settings to qsettings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11685 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 357c687a
......@@ -228,13 +228,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
if ( _ini.get_entry( viewmode, "Options" , "CurrentViewMode") )
OpenFlipper::Options::currentViewMode(viewmode);
//============================================================================
// Load the setting for the translation language
//============================================================================
QString translation = "";
if ( _ini.get_entry( translation, "Options" , "Translation") )
OpenFlipper::Options::translation(translation);
//============================================================================
// Load the setting for the gridVisibility
//============================================================================
......@@ -406,7 +399,6 @@ void Core::writeApplicationOptions(INIFile& _ini) {
if ( OpenFlipper::Options::gui() ) {
_ini.add_entry("Options","DefaultViewerLayout", OpenFlipper::Options::defaultViewerLayout() );
_ini.add_entry("Options","Translation", OpenFlipper::Options::translation() );
_ini.add_entry("Options","GridVisible", OpenFlipper::Options::gridVisible() );
_ini.add_entry("Options","ViewerCount", OpenFlipper::Options::examinerWidgets() );
......
......@@ -374,7 +374,7 @@ int main(int argc, char **argv)
return 1;
}
QString tLang = OpenFlipper::Options::translation();
QString tLang = OpenFlipperSettings().value("Core/Language/Translation","en_US").toString();
if (tLang == "locale")
tLang = QLocale::system().name();
......
......@@ -189,9 +189,6 @@ static bool doSlotDebugging_ = false;
/// last used DataType
static QString lastDataType_ = "Triangle Mesh";
/// translation
static QString translation_ = "en_US";
/// Should backups be enabled
static bool enableBackup_ = true;
......@@ -251,14 +248,6 @@ QString lang() {
return lang;
}
QString translation() {
return translation_;
}
void translation(QString _translation) {
translation_ = _translation;
}
QString dirSeparator() {
// if (windows_)
// return QString("\\");
......
......@@ -124,6 +124,9 @@
* * Core/Log/Logfile This is the location of the log file \n
* * Core/Log/logFileEnabled This controls, if logging to file is enabled(bool)\n
*
* <b>Language Settings</b>\n
* * Core/Language/Translation This is the translation to use ( default is en_US) \n
*
* <b>Update Settings</b>\n
* * Core/Update/UserName Update UserName
* * Core/Update/Pass Update Password
......@@ -381,14 +384,6 @@ QString helpDirStr();
DLLEXPORT
QString lang();
/// Returns the translation language (locale, de_DE, en_US)
DLLEXPORT
QString translation();
/// Set the translation language (locale, de_DE, en_US)
DLLEXPORT
void translation(QString _translation);
/** @} */
//===========================================================================
......
......@@ -431,9 +431,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
viewerLayout->setCurrentIndex( OpenFlipper::Options::defaultViewerLayout() );
if (OpenFlipper::Options::translation() == "en_US")
if (OpenFlipperSettings().value("Core/Language/Translation","en_US").toString() == "en_US")
translation->setCurrentIndex(0);
else if (OpenFlipper::Options::translation() == "de_DE")
else if (OpenFlipperSettings().value("Core/Language/Translation","en_US").toString() == "de_DE")
translation->setCurrentIndex(1);
else
translation->setCurrentIndex(2);
......@@ -744,9 +744,9 @@ void OptionsWidget::slotApply() {
}
switch ( translation->currentIndex() ){
case 0 : OpenFlipper::Options::translation("en_US"); break;
case 1 : OpenFlipper::Options::translation("de_DE"); break;
default: OpenFlipper::Options::translation("locale"); break;
case 0 : OpenFlipperSettings().setValue("Core/Language/Translation","en_US"); break;
case 1 : OpenFlipperSettings().setValue("Core/Language/Translation","de_DE"); break;
default: OpenFlipperSettings().setValue("Core/Language/Translation","locale"); break;
}
applyShortcuts();
......
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