aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsmodel.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-05-08 23:03:41 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2012-05-09 07:45:47 +0200
commit5ac114c7566b7d3aa32b93124ccb5e5e364edc25 (patch)
tree2ef59f40ec0827a957255efb1eaa7fa1e05a12aa /src/qt/optionsmodel.cpp
parent6ddf861078e465dcb89e14e8cad6229c7abf64bb (diff)
Make it possible to set user interface language from options dialog
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r--src/qt/optionsmodel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 5bba308cf2..78448d3ee1 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -21,6 +21,7 @@ void OptionsModel::Init()
fMinimizeToTray = settings.value("fMinimizeToTray", false).toBool();
fMinimizeOnClose = settings.value("fMinimizeOnClose", false).toBool();
nTransactionFee = settings.value("nTransactionFee").toLongLong();
+ language = settings.value("language", "").toString();
// These are shared with core bitcoin; we want
// command-line options to override the GUI settings:
@@ -30,6 +31,8 @@ void OptionsModel::Init()
SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString());
if (settings.contains("detachDB"))
SoftSetBoolArg("-detachdb", settings.value("detachDB").toBool());
+ if (!language.isEmpty())
+ SoftSetArg("-lang", language.toStdString());
}
bool OptionsModel::Upgrade()
@@ -125,6 +128,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return QVariant(bDisplayAddresses);
case DetachDatabases:
return QVariant(fDetachDB);
+ case Language:
+ return settings.value("language", "");
default:
return QVariant();
}
@@ -213,6 +218,10 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
settings.setValue("detachDB", fDetachDB);
}
break;
+ case Language: {
+ settings.setValue("language", value);
+ }
+ break;
default:
break;
}