Merge pull request #1118 from RetroPooh/net_settings_antifreeze

fix freezes in network settings
This commit is contained in:
csoler 2017-12-04 16:32:37 +01:00 committed by GitHub
commit 22292fc2a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 13 deletions

View File

@ -163,10 +163,11 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.extAddress, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
connect(ui.dynDNS, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyAddress_tor, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyPort_tor, SIGNAL(valueChanged(int)),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyAddress_i2p, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyPort_i2p, SIGNAL(valueChanged(int)),this,SLOT(saveAddresses()));
connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
connect(ui.hiddenpage_proxyAddress_tor, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyPort_tor, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyAddress_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.hiddenpage_proxyPort_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses()));
connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
connect(ui.totalUploadRate, SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
@ -395,7 +396,6 @@ void ServerPage::load()
whileBlocking(ui.hiddenpage_proxyAddress_i2p) -> setText(QString::fromStdString(proxyaddr));
whileBlocking(ui.hiddenpage_proxyPort_i2p) -> setValue(proxyport);
updateOutProxyIndicator();
}
//Relay Tab
@ -843,8 +843,6 @@ void ServerPage::updateStatus()
else
ui.iconlabel_ext->setPixmap(QPixmap(":/images/ledoff1.png"));
// check for Tor
updateOutProxyIndicator();
}
void ServerPage::toggleUPnP()
@ -878,6 +876,9 @@ void ServerPage::saveAddresses()
saveCommon();
if(ui.tabWidget->currentIndex() == 2) // hidden services tab
updateOutProxyIndicator();
if (mIsHiddenNode) {
saveAddressesHiddenNode();
return;
@ -959,6 +960,12 @@ void ServerPage::saveRates()
rsConfig->SetMaxDataRates( ui.totalDownloadRate->value(), ui.totalUploadRate->value() );
}
void ServerPage::tabChanged(int page)
{
if(page == 2)
updateOutProxyIndicator();
}
/***********************************************************************************/
/***********************************************************************************/
/******* ALTERNATIVE VERSION IF HIDDEN NODE ***************************************/
@ -1099,8 +1106,6 @@ void ServerPage::loadHiddenNode()
whileBlocking(ui.hiddenpage_proxyAddress_i2p) -> setText(QString::fromStdString(proxyaddr));
whileBlocking(ui.hiddenpage_proxyPort_i2p) -> setValue(proxyport);
updateOutProxyIndicator();
QString expected = "";
switch (mHiddenType) {
case RS_HIDDEN_TYPE_I2P:
@ -1188,8 +1193,6 @@ void ServerPage::updateStatusHiddenNode()
ui.iconlabel_ext->setPixmap(QPixmap(":/images/ledoff1.png"));
#endif
updateOutProxyIndicator();
}
void ServerPage::saveAddressesHiddenNode()
@ -1522,8 +1525,6 @@ void ServerPage::loadCommon()
whileBlocking(ui.hiddenpage_proxyPort_i2p) -> setValue(proxyport);
whileBlocking(ui.hiddenpage_proxyPort_i2p_2)->setValue(proxyport); // this one is for bob tab
updateOutProxyIndicator();
// don't use whileBlocking here
ui.cb_enableBob->setChecked(mBobSettings.enableBob);

View File

@ -84,6 +84,7 @@ private slots:
void ipWhiteListContextMenu(const QPoint &point);
void removeBannedIp();
void tabChanged(int page);
// server
void saveAddresses();
void saveRates();