mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
Merge pull request #1899 from Diapolo/proxy_optionsmodel
make optionsmodel query real proxy state for ::data()
This commit is contained in:
commit
e74d0ab675
1 changed files with 12 additions and 5 deletions
|
@ -142,8 +142,10 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
|||
return settings.value("fUseUPnP", GetBoolArg("-upnp", true));
|
||||
case MinimizeOnClose:
|
||||
return QVariant(fMinimizeOnClose);
|
||||
case ProxyUse:
|
||||
return settings.value("fUseProxy", false);
|
||||
case ProxyUse: {
|
||||
proxyType proxy;
|
||||
return QVariant(GetProxy(NET_IPV4, proxy));
|
||||
}
|
||||
case ProxyIP: {
|
||||
proxyType proxy;
|
||||
if (GetProxy(NET_IPV4, proxy))
|
||||
|
@ -158,8 +160,13 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
|||
else
|
||||
return QVariant(9050);
|
||||
}
|
||||
case ProxySocksVersion:
|
||||
return settings.value("nSocksVersion", 5);
|
||||
case ProxySocksVersion: {
|
||||
proxyType proxy;
|
||||
if (GetProxy(NET_IPV4, proxy))
|
||||
return QVariant(proxy.second);
|
||||
else
|
||||
return QVariant(5);
|
||||
}
|
||||
case Fee:
|
||||
return QVariant(nTransactionFee);
|
||||
case DisplayUnit:
|
||||
|
@ -203,7 +210,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
|||
break;
|
||||
case ProxyUse:
|
||||
settings.setValue("fUseProxy", value.toBool());
|
||||
ApplyProxySettings();
|
||||
successful = ApplyProxySettings();
|
||||
break;
|
||||
case ProxyIP: {
|
||||
proxyType proxy;
|
||||
|
|
Loading…
Add table
Reference in a new issue