settings rework, proxy support

This commit is contained in:
tobtoht
2023-02-11 18:11:21 +01:00
parent 076903c586
commit f3c8e116c0
77 changed files with 3301 additions and 1149 deletions
+5 -9
View File
@@ -22,9 +22,9 @@
AppContext::AppContext(Wallet *wallet)
: wallet(wallet)
, nodes(new Nodes(this, this))
, nodes(new Nodes(this))
, networkType(constants::networkType)
, m_rpc(new DaemonRpc{this, getNetworkTor(), ""})
, m_rpc(new DaemonRpc{this, ""})
{
connect(this->wallet, &Wallet::moneySpent, this, &AppContext::onMoneySpent);
connect(this->wallet, &Wallet::moneyReceived, this, &AppContext::onMoneyReceived);
@@ -38,15 +38,14 @@ AppContext::AppContext(Wallet *wallet)
connect(this->wallet, &Wallet::deviceError, this, &AppContext::onDeviceError);
connect(this->wallet, &Wallet::deviceButtonRequest, this, &AppContext::onDeviceButtonRequest);
connect(this->wallet, &Wallet::deviceButtonPressed, this, &AppContext::onDeviceButtonPressed);
connect(this->wallet, &Wallet::connectionStatusChanged, [this]{
this->nodes->autoConnect();
});
connect(this->wallet, &Wallet::currentSubaddressAccountChanged, [this]{
this->updateBalance();
});
connect(this, &AppContext::createTransactionError, this, &AppContext::onCreateTransactionError);
nodes->setContext(this);
// Store the wallet every 2 minutes
m_storeTimer.start(2 * 60 * 1000);
connect(&m_storeTimer, &QTimer::timeout, [this](){
@@ -188,15 +187,12 @@ void AppContext::setSelectedInputs(const QStringList &selectedInputs) {
emit selectedInputsChanged(selectedInputs);
}
void AppContext::onTorSettingsChanged() {
void AppContext::onProxySettingsChanged() {
if (Utils::isTorsocks()) {
return;
}
this->nodes->connectToNode();
auto privacyLevel = config()->get(Config::torPrivacyLevel).toInt();
qDebug() << "Changed privacyLevel to " << privacyLevel;
}
void AppContext::stopTimers() {