Changeset View
Changeset View
Standalone View
Standalone View
src/qt/optionsdialog.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include "config/bitcoin-config.h" | #include "config/bitcoin-config.h" | ||||
#endif | #endif | ||||
#include "optionsdialog.h" | #include "optionsdialog.h" | ||||
#include "ui_optionsdialog.h" | #include "ui_optionsdialog.h" | ||||
#include "bitcoinunits.h" | #include "bitcoinunits.h" | ||||
#include "guiutil.h" | #include "guiutil.h" | ||||
#include "optionsmodel.h" | #include "optionsmodel.h" | ||||
#include "interface/node.h" | |||||
#include "netbase.h" | #include "netbase.h" | ||||
#include "txdb.h" // for -dbcache defaults | #include "txdb.h" // for -dbcache defaults | ||||
#include "validation.h" // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS | #include "validation.h" // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS | ||||
#include <QDataWidgetMapper> | #include <QDataWidgetMapper> | ||||
#include <QDir> | #include <QDir> | ||||
#include <QIntValidator> | #include <QIntValidator> | ||||
#include <QLocale> | #include <QLocale> | ||||
▲ Show 20 Lines • Show All 265 Lines • ▼ Show 20 Lines | void OptionsDialog::updateProxyValidationState() { | ||||
} | } | ||||
} | } | ||||
void OptionsDialog::updateDefaultProxyNets() { | void OptionsDialog::updateDefaultProxyNets() { | ||||
proxyType proxy; | proxyType proxy; | ||||
std::string strProxy; | std::string strProxy; | ||||
QString strDefaultProxyGUI; | QString strDefaultProxyGUI; | ||||
GetProxy(NET_IPV4, proxy); | model->node().getProxy(NET_IPV4, proxy); | ||||
strProxy = proxy.proxy.ToStringIP() + ":" + proxy.proxy.ToStringPort(); | strProxy = proxy.proxy.ToStringIP() + ":" + proxy.proxy.ToStringPort(); | ||||
strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); | strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); | ||||
(strProxy == strDefaultProxyGUI.toStdString()) | (strProxy == strDefaultProxyGUI.toStdString()) | ||||
? ui->proxyReachIPv4->setChecked(true) | ? ui->proxyReachIPv4->setChecked(true) | ||||
: ui->proxyReachIPv4->setChecked(false); | : ui->proxyReachIPv4->setChecked(false); | ||||
GetProxy(NET_IPV6, proxy); | model->node().getProxy(NET_IPV6, proxy); | ||||
strProxy = proxy.proxy.ToStringIP() + ":" + proxy.proxy.ToStringPort(); | strProxy = proxy.proxy.ToStringIP() + ":" + proxy.proxy.ToStringPort(); | ||||
strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); | strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); | ||||
(strProxy == strDefaultProxyGUI.toStdString()) | (strProxy == strDefaultProxyGUI.toStdString()) | ||||
? ui->proxyReachIPv6->setChecked(true) | ? ui->proxyReachIPv6->setChecked(true) | ||||
: ui->proxyReachIPv6->setChecked(false); | : ui->proxyReachIPv6->setChecked(false); | ||||
GetProxy(NET_TOR, proxy); | model->node().getProxy(NET_TOR, proxy); | ||||
strProxy = proxy.proxy.ToStringIP() + ":" + proxy.proxy.ToStringPort(); | strProxy = proxy.proxy.ToStringIP() + ":" + proxy.proxy.ToStringPort(); | ||||
strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); | strDefaultProxyGUI = ui->proxyIp->text() + ":" + ui->proxyPort->text(); | ||||
(strProxy == strDefaultProxyGUI.toStdString()) | (strProxy == strDefaultProxyGUI.toStdString()) | ||||
? ui->proxyReachTor->setChecked(true) | ? ui->proxyReachTor->setChecked(true) | ||||
: ui->proxyReachTor->setChecked(false); | : ui->proxyReachTor->setChecked(false); | ||||
} | } | ||||
ProxyAddressValidator::ProxyAddressValidator(QObject *parent) | ProxyAddressValidator::ProxyAddressValidator(QObject *parent) | ||||
Show All 13 Lines |