mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Make it possible to set user interface language from options dialog
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user