commit 42d54925deda01e29b2c0f9c1027f0a1c55e0141 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 | 16 ++++++++-------- 2 files changed, 18 insertions(+), 14 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 9473a81..fbaac49 100644 --- a/src/vidalia/config/AdvancedPage.ui +++ b/src/vidalia/config/AdvancedPage.ui @@ -31,7 +31,7 @@ <property name="verticalSpacing"> <number>6</number> </property> - <item row="5" column="0"> + <item row="6" column="0"> <widget class="QLabel" name="lblAuth"> <property name="text"> <string>Authentication:</string> @@ -51,7 +51,7 @@ </property> </widget> </item> - <item row="5" column="2" colspan="3"> + <item row="6" column="2" colspan="3"> <layout class="QHBoxLayout"> <property name="spacing"> <number>2</number> @@ -168,7 +168,7 @@ <property name="sizeHint" stdset="0"> <size> <width>40</width> - <height>20</height> + <height>0</height> </size> </property> </spacer> @@ -185,7 +185,7 @@ </property> </widget> </item> - <item row="4" column="0"> + <item row="5" column="0"> <widget class="QLabel" name="lblPath"> <property name="enabled"> <bool>false</bool> @@ -198,21 +198,21 @@ </property> </widget> </item> - <item row="4" column="1" colspan="2"> + <item row="5" column="1" colspan="2"> <widget class="QLineEdit" name="lineSocketPath"> <property name="enabled"> <bool>false</bool> </property> </widget> </item> - <item row="2" column="2"> + <item row="3" column="2"> <widget class="QRadioButton" name="rdoControlSocket"> <property name="text"> <string>Use Unix domain socket (ControlSocket)</string> </property> </widget> </item> - <item row="4" column="3"> + <item row="5" column="3"> <widget class="QPushButton" name="btnBrowseSocketPath"> <property name="enabled"> <bool>false</bool> @@ -222,7 +222,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>
tor-commits@lists.torproject.org