[vidalia/alpha] Improve how the advance settings behave with the autoport

commit bd5b133def31530861d1bf0aa908b2c7ffced011 Author: Tomas Touceda <chiiph@torproject.org> Date: Thu Jul 28 14:12:03 2011 -0300 Improve how the advance settings behave with the autoport Tries to avoid confusion by just not displaying what host and port is being used, so that it's completely transparent to the user. --- src/vidalia/config/AdvancedPage.cpp | 16 ++++++++++------ src/vidalia/config/AdvancedPage.ui | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/vidalia/config/AdvancedPage.cpp b/src/vidalia/config/AdvancedPage.cpp index 4e7c3f6..12842bc 100644 --- a/src/vidalia/config/AdvancedPage.cpp +++ b/src/vidalia/config/AdvancedPage.cpp @@ -185,8 +185,10 @@ AdvancedPage::save(QString &errmsg) _settings->setDataDirectory(dataDir); } - _settings->setControlAddress(controlAddress); - _settings->setControlPort(ui.lineControlPort->text().toUShort()); + if(!ui.chkAuto->isChecked()) { + _settings->setControlAddress(controlAddress); + _settings->setControlPort(ui.lineControlPort->text().toUShort()); + } _settings->setSocketPath(ui.lineSocketPath->text()); _settings->setAutoControlPort(ui.chkAuto->isChecked()); @@ -394,6 +396,7 @@ AdvancedPage::toggleControl(bool) ui.lblPath->setEnabled(false); ui.lineSocketPath->setEnabled(false); ui.btnBrowseSocketPath->setEnabled(false); + ui.chkAuto->setEnabled(true); } else { #if !defined(Q_OS_WIN32) ui.lblAddress->setEnabled(false); @@ -402,6 +405,7 @@ AdvancedPage::toggleControl(bool) ui.lblPath->setEnabled(true); ui.lineSocketPath->setEnabled(true); ui.btnBrowseSocketPath->setEnabled(true); + ui.chkAuto->setEnabled(false); #endif } } @@ -409,8 +413,8 @@ AdvancedPage::toggleControl(bool) void AdvancedPage::toggleAuto(bool) { - ui.lblAddress->setEnabled(!ui.chkAuto->isChecked()); - ui.lineControlAddress->setEnabled(!ui.chkAuto->isChecked()); - ui.label->setEnabled(!ui.chkAuto->isChecked()); - ui.lineControlPort->setEnabled(!ui.chkAuto->isChecked()); + ui.lblAddress->setVisible(!ui.chkAuto->isChecked()); + ui.lineControlAddress->setVisible(!ui.chkAuto->isChecked()); + ui.label->setVisible(!ui.chkAuto->isChecked()); + ui.lineControlPort->setVisible(!ui.chkAuto->isChecked()); } diff --git a/src/vidalia/config/AdvancedPage.ui b/src/vidalia/config/AdvancedPage.ui index 3600cbc..7776a18 100644 --- a/src/vidalia/config/AdvancedPage.ui +++ b/src/vidalia/config/AdvancedPage.ui @@ -240,7 +240,7 @@ </property> </widget> </item> - <item row="3" column="2"> + <item row="2" column="2"> <widget class="QCheckBox" name="chkAuto"> <property name="text"> <string>Configure ControlPort automatically</string>
participants (1)
-
chiiph@torproject.org