diff options
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r-- | src/qt/optionsmodel.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 5bba308cf2..9f1c6447ae 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -4,6 +4,7 @@ #include "init.h" #include "walletdb.h" +#include "guiutil.h" OptionsModel::OptionsModel(QObject *parent) : QAbstractListModel(parent) @@ -21,8 +22,9 @@ 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 + // These are shared with core Bitcoin; we want // command-line options to override the GUI settings: if (settings.contains("fUseUPnP")) SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()); @@ -30,6 +32,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() @@ -104,7 +108,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const switch(index.row()) { case StartAtStartup: - return QVariant(GetStartOnSystemStartup()); + return QVariant(GUIUtil::GetStartOnSystemStartup()); case MinimizeToTray: return QVariant(fMinimizeToTray); case MapPortUPnP: @@ -125,6 +129,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(); } @@ -141,7 +147,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in switch(index.row()) { case StartAtStartup: - successful = SetStartOnSystemStartup(value.toBool()); + successful = GUIUtil::SetStartOnSystemStartup(value.toBool()); break; case MinimizeToTray: fMinimizeToTray = value.toBool(); @@ -213,6 +219,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; } |