X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Foptionsmodel.cpp;h=cb3b264314489bfc2f5a66c730e954cd2d780c33;hb=HEAD;hp=3d93577b080de85cfee40d3b8a389f637b15c420;hpb=803144ef34088cea11f8d507366720554bdd4d8b;p=novacoin.git diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 3d93577..cb3b264 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -5,6 +5,7 @@ #include "init.h" #include "walletdb.h" #include "guiutil.h" +#include "wallet.h" OptionsModel::OptionsModel(QObject *parent) : QAbstractListModel(parent) @@ -67,9 +68,9 @@ void OptionsModel::Init() if(fTestNet) settings.setValue("strThirdPartyTxUrls", ""); else - settings.setValue("strThirdPartyTxUrls", "https://bitinfocharts.com/novacoin/tx/%s|https://coinplorer.com/NVC/Transactions/%s|https://explorer.novaco.in/tx/%s|https://bchain.info/NVC/tx/%s"); + settings.setValue("strThirdPartyTxUrls", "https://bitinfocharts.com/novacoin/tx/%s|https://explorer.novaco.in/tx/%s|https://novacoin.ru/explorer/tx/%s|https://prohashing.com/explorer/novacoin/%s"); } - strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "https://bitinfocharts.com/novacoin/tx/%s|https://coinplorer.com/NVC/Transactions/%s|https://explorer.novaco.in/tx/%s|https://bchain.info/NVC/tx/%s").toString(); + strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "https://bitinfocharts.com/novacoin/tx/%s|https://explorer.novaco.in/tx/%s|https://novacoin.ru/explorer/tx/%s|https://prohashing.com/explorer/novacoin/%s").toString(); fMinimizeToTray = settings.value("fMinimizeToTray", false).toBool(); fMinimizeOnClose = settings.value("fMinimizeOnClose", false).toBool(); fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool(); @@ -78,8 +79,6 @@ void OptionsModel::Init() // 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()); if ( !(settings.value("fTorOnly").toBool() && settings.contains("addrTor")) ) { if (settings.contains("addrProxy") && settings.value("fUseProxy").toBool()) SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString()); @@ -101,8 +100,10 @@ void OptionsModel::Init() } } - if (settings.contains("detachDB")) - SoftSetBoolArg("-detachdb", settings.value("detachDB").toBool()); + if (!fTestNet && settings.contains("externalSeeder") && settings.value("externalSeeder").toString() != "") { + SoftSetArg("-peercollector", settings.value("externalSeeder").toString().toStdString()); + } + if (!language.isEmpty()) SoftSetArg("-lang", language.toStdString()); } @@ -123,8 +124,6 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return QVariant(GUIUtil::GetStartOnSystemStartup()); case MinimizeToTray: return QVariant(fMinimizeToTray); - case MapPortUPnP: - return settings.value("fUseUPnP", GetBoolArg("-upnp", true)); case MinimizeOnClose: return QVariant(fMinimizeOnClose); case ProxyUse: @@ -141,7 +140,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const if (GetProxy(NET_IPV4, proxy)) return QVariant(proxy.first.GetPort()); else - return QVariant(9050); + return QVariant(nSocksDefault); } case ProxySocksVersion: return settings.value("nSocksVersion", 5); @@ -159,12 +158,14 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const if (GetProxy(NET_TOR, proxy)) return QVariant(proxy.first.GetPort()); else - return QVariant(9050); + return QVariant(nSocksDefault); } case TorOnly: return settings.value("fTorOnly", false); case TorName: return settings.value("TorName", ""); + case ExternalSeeder: + return settings.value("externalSeeder", ""); case Fee: return QVariant(static_cast(nTransactionFee)); case DisplayUnit: @@ -173,8 +174,6 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return QVariant(bDisplayAddresses); case ThirdPartyTxUrls: return QVariant(strThirdPartyTxUrls); - case DetachDatabases: - return QVariant(bitdb.GetDetach()); case Language: return settings.value("language", ""); case CoinControlFeatures: @@ -201,11 +200,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in fMinimizeToTray = value.toBool(); settings.setValue("fMinimizeToTray", fMinimizeToTray); break; - case MapPortUPnP: - fUseUPnP = value.toBool(); - settings.setValue("fUseUPnP", fUseUPnP); - MapPort(); - break; case MinimizeOnClose: fMinimizeOnClose = value.toBool(); settings.setValue("fMinimizeOnClose", fMinimizeOnClose); @@ -216,7 +210,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyIP: { proxyType proxy; - proxy.first = CService("127.0.0.1", 9050); + proxy.first = CService("127.0.0.1", nSocksDefault); GetProxy(NET_IPV4, proxy); CNetAddr addr(value.toString().toStdString()); @@ -227,7 +221,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case ProxyPort: { proxyType proxy; - proxy.first = CService("127.0.0.1", 9050); + proxy.first = CService("127.0.0.1", nSocksDefault); GetProxy(NET_IPV4, proxy); proxy.first.SetPort(value.toInt()); @@ -252,7 +246,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case TorIP: { proxyType proxy; - proxy.first = CService("127.0.0.1", 9050); + proxy.first = CService("127.0.0.1", nSocksDefault); GetProxy(NET_TOR, proxy); CNetAddr addr(value.toString().toStdString()); @@ -263,10 +257,10 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in break; case TorPort: { proxyType proxy; - proxy.first = CService("127.0.0.1", 9050); + proxy.first = CService("127.0.0.1", nSocksDefault); GetProxy(NET_TOR, proxy); - proxy.first.SetPort(value.toInt()); + proxy.first.SetPort((uint16_t)value.toUInt()); settings.setValue("addrTor", proxy.first.ToStringIPPort().c_str()); successful = ApplyTorSettings(); } @@ -279,6 +273,9 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("TorName", value.toString()); } break; + case ExternalSeeder: + settings.setValue("externalSeeder", value.toString()); + break; case Fee: nTransactionFee = value.toLongLong(); settings.setValue("nTransactionFee", static_cast(nTransactionFee)); @@ -293,12 +290,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in bDisplayAddresses = value.toBool(); settings.setValue("bDisplayAddresses", bDisplayAddresses); break; - case DetachDatabases: { - bool fDetachDB = value.toBool(); - bitdb.SetDetach(fDetachDB); - settings.setValue("detachDB", fDetachDB); - } - break; case ThirdPartyTxUrls: if (strThirdPartyTxUrls != value.toString()) { strThirdPartyTxUrls = value.toString();