@@ -59,9 +59,11 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
59
59
60
60
connect (ui->connectSocks , SIGNAL (toggled (bool )), ui->proxyIp , SLOT (setEnabled (bool )));
61
61
connect (ui->connectSocks , SIGNAL (toggled (bool )), ui->proxyPort , SLOT (setEnabled (bool )));
62
+ connect (ui->connectSocks , SIGNAL (toggled (bool )), this , SLOT (updateProxyValidationState ()));
62
63
63
64
connect (ui->connectSocksTor , SIGNAL (toggled (bool )), ui->proxyIpTor , SLOT (setEnabled (bool )));
64
65
connect (ui->connectSocksTor , SIGNAL (toggled (bool )), ui->proxyPortTor , SLOT (setEnabled (bool )));
66
+ connect (ui->connectSocksTor , SIGNAL (toggled (bool )), this , SLOT (updateProxyValidationState ()));
65
67
66
68
/* Window elements init */
67
69
#ifdef Q_OS_MAC
@@ -117,8 +119,10 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
117
119
/* setup/change UI elements when proxy IPs are invalid/valid */
118
120
ui->proxyIp ->setCheckValidator (new ProxyAddressValidator (parent));
119
121
ui->proxyIpTor ->setCheckValidator (new ProxyAddressValidator (parent));
120
- connect (ui->proxyIp , SIGNAL (validationDidChange (QValidatedLineEdit *)), this , SLOT (updateProxyValidationState (QValidatedLineEdit *)));
121
- connect (ui->proxyIpTor , SIGNAL (validationDidChange (QValidatedLineEdit *)), this , SLOT (updateProxyValidationState (QValidatedLineEdit *)));
122
+ connect (ui->proxyIp , SIGNAL (validationDidChange (QValidatedLineEdit *)), this , SLOT (updateProxyValidationState ()));
123
+ connect (ui->proxyIpTor , SIGNAL (validationDidChange (QValidatedLineEdit *)), this , SLOT (updateProxyValidationState ()));
124
+ connect (ui->proxyPort , SIGNAL (textChanged (const QString&)), this , SLOT (updateProxyValidationState ()));
125
+ connect (ui->proxyPortTor , SIGNAL (textChanged (const QString&)), this , SLOT (updateProxyValidationState ()));
122
126
}
123
127
124
128
OptionsDialog::~OptionsDialog ()
@@ -256,10 +260,11 @@ void OptionsDialog::clearStatusLabel()
256
260
ui->statusLabel ->clear ();
257
261
}
258
262
259
- void OptionsDialog::updateProxyValidationState (QValidatedLineEdit *pUiProxyIp )
263
+ void OptionsDialog::updateProxyValidationState ()
260
264
{
265
+ QValidatedLineEdit *pUiProxyIp = ui->proxyIp ;
261
266
QValidatedLineEdit *otherProxyWidget = (pUiProxyIp == ui->proxyIpTor ) ? ui->proxyIp : ui->proxyIpTor ;
262
- if (pUiProxyIp->isValid ())
267
+ if (pUiProxyIp->isValid () && (!ui-> proxyPort -> isEnabled () || ui-> proxyPort -> text (). toInt () > 0 ) && (!ui-> proxyPortTor -> isEnabled () || ui-> proxyPortTor -> text (). toInt () > 0 ) )
263
268
{
264
269
setOkButtonState (otherProxyWidget->isValid ()); // only enable ok button if both proxys are valid
265
270
ui->statusLabel ->clear ();
0 commit comments