[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1666: Add a box to the Advanced settings page to change the IP add (in trunk: . src/gui/config)
Author: edmanm
Date: 2007-03-10 20:14:34 -0500 (Sat, 10 Mar 2007)
New Revision: 1666
Modified:
trunk/
trunk/src/gui/config/advancedpage.cpp
trunk/src/gui/config/advancedpage.ui
Log:
r1719@adrastea: edmanm | 2007-03-10 20:03:49 -0500
Add a box to the Advanced settings page to change the IP address on which
we will try to connect to Tor's control port.
Property changes on: trunk
___________________________________________________________________
svk:merge ticket from /vidalia/local/trunk [r1719] on 54b3572a-7227-0410-958f-53ecd705b71a
Modified: trunk/src/gui/config/advancedpage.cpp
===================================================================
--- trunk/src/gui/config/advancedpage.cpp 2007-03-11 01:14:20 UTC (rev 1665)
+++ trunk/src/gui/config/advancedpage.cpp 2007-03-11 01:14:34 UTC (rev 1666)
@@ -27,9 +27,12 @@
#include <QFile>
#include <QFileInfo>
+#include <QHostAddress>
#include <gui/common/vmessagebox.h>
#include <util/file.h>
#include <vidalia.h>
+
+#include "ipvalidator.h"
#include "advancedpage.h"
#if defined(Q_WS_WIN)
@@ -46,7 +49,11 @@
/* Create TorSettings object */
_settings = new TorSettings();
-
+
+ /* Set validators for the control port and IP address fields */
+ ui.lineControlAddress->setValidator(new IPValidator(this));
+ ui.lineControlPort->setValidator(new QIntValidator(1, 65535, this));
+
/* Bind event to actions */
connect(ui.btnBrowseTorConfig, SIGNAL(clicked()), this, SLOT(browseTorConfig()));
@@ -67,7 +74,13 @@
bool
AdvancedPage::save(QString &errmsg)
{
- Q_UNUSED(errmsg);
+ QHostAddress controlAddress(ui.lineControlAddress->text());
+ if (controlAddress.isNull()) {
+ errmsg = tr("'%1' is not a valid IP address.")
+ .arg(ui.lineControlAddress->text());
+ return false;
+ }
+ _settings->setControlAddress(controlAddress);
_settings->setControlPort(ui.lineControlPort->text().toUShort());
_settings->setTorrc(ui.lineTorConfig->text());
_settings->setUser(ui.lineUser->text());
@@ -85,6 +98,7 @@
void
AdvancedPage::load()
{
+ ui.lineControlAddress->setText(_settings->getControlAddress().toString());
ui.lineControlPort->setText(QString::number(_settings->getControlPort()));
ui.lineTorConfig->setText(_settings->getTorrc());
ui.lineUser->setText(_settings->getUser());
@@ -96,8 +110,6 @@
#endif
}
-
-
/** Open a QFileDialog to browse for Tor config file. */
void
AdvancedPage::browseTorConfig()
Modified: trunk/src/gui/config/advancedpage.ui
===================================================================
--- trunk/src/gui/config/advancedpage.ui 2007-03-11 01:14:20 UTC (rev 1665)
+++ trunk/src/gui/config/advancedpage.ui 2007-03-11 01:14:34 UTC (rev 1666)
@@ -1,7 +1,4 @@
<ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
<class>AdvancedPage</class>
<widget class="QWidget" name="AdvancedPage" >
<property name="geometry" >
@@ -15,265 +12,469 @@
<property name="palette" >
<palette>
<active>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>208</red>
- <green>208</green>
- <blue>208</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>247</red>
- <green>247</green>
- <blue>247</blue>
- </color>
- <color>
- <red>104</red>
- <green>104</green>
- <blue>104</blue>
- </color>
- <color>
- <red>139</red>
- <green>139</green>
- <blue>139</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>128</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- <color>
- <red>255</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- <color>
- <red>231</red>
- <green>231</green>
- <blue>231</blue>
- </color>
+ <colorrole role="WindowText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Button" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>208</red>
+ <green>208</green>
+ <blue>208</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Light" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Midlight" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>247</red>
+ <green>247</green>
+ <blue>247</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Dark" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>104</red>
+ <green>104</green>
+ <blue>104</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Mid" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>139</red>
+ <green>139</green>
+ <blue>139</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Text" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="BrightText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="ButtonText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Base" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Window" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Shadow" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Highlight" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="HighlightedText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Link" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="LinkVisited" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="AlternateBase" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>231</red>
+ <green>231</green>
+ <blue>231</blue>
+ </color>
+ </brush>
+ </colorrole>
</active>
<inactive>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>208</red>
- <green>208</green>
- <blue>208</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>247</red>
- <green>247</green>
- <blue>247</blue>
- </color>
- <color>
- <red>104</red>
- <green>104</green>
- <blue>104</blue>
- </color>
- <color>
- <red>139</red>
- <green>139</green>
- <blue>139</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>192</red>
- <green>192</green>
- <blue>192</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- <color>
- <red>255</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- <color>
- <red>231</red>
- <green>231</green>
- <blue>231</blue>
- </color>
+ <colorrole role="WindowText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Button" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>208</red>
+ <green>208</green>
+ <blue>208</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Light" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Midlight" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>247</red>
+ <green>247</green>
+ <blue>247</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Dark" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>104</red>
+ <green>104</green>
+ <blue>104</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Mid" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>139</red>
+ <green>139</green>
+ <blue>139</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Text" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="BrightText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="ButtonText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Base" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Window" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Shadow" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Highlight" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>192</red>
+ <green>192</green>
+ <blue>192</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="HighlightedText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Link" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="LinkVisited" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="AlternateBase" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>231</red>
+ <green>231</green>
+ <blue>231</blue>
+ </color>
+ </brush>
+ </colorrole>
</inactive>
<disabled>
- <color>
- <red>104</red>
- <green>104</green>
- <blue>104</blue>
- </color>
- <color>
- <red>208</red>
- <green>208</green>
- <blue>208</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>247</red>
- <green>247</green>
- <blue>247</blue>
- </color>
- <color>
- <red>104</red>
- <green>104</green>
- <blue>104</blue>
- </color>
- <color>
- <red>139</red>
- <green>139</green>
- <blue>139</blue>
- </color>
- <color>
- <red>104</red>
- <green>104</green>
- <blue>104</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>104</red>
- <green>104</green>
- <blue>104</blue>
- </color>
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>128</blue>
- </color>
- <color>
- <red>255</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- <color>
- <red>0</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- <color>
- <red>255</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- <color>
- <red>231</red>
- <green>231</green>
- <blue>231</blue>
- </color>
+ <colorrole role="WindowText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>104</red>
+ <green>104</green>
+ <blue>104</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Button" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>208</red>
+ <green>208</green>
+ <blue>208</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Light" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Midlight" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>247</red>
+ <green>247</green>
+ <blue>247</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Dark" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>104</red>
+ <green>104</green>
+ <blue>104</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Mid" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>139</red>
+ <green>139</green>
+ <blue>139</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Text" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>104</red>
+ <green>104</green>
+ <blue>104</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="BrightText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="ButtonText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>104</red>
+ <green>104</green>
+ <blue>104</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Base" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Window" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Shadow" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Highlight" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="HighlightedText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Link" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="LinkVisited" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="AlternateBase" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>231</red>
+ <green>231</green>
+ <blue>231</blue>
+ </color>
+ </brush>
+ </colorrole>
</disabled>
</palette>
</property>
@@ -316,6 +517,40 @@
<number>6</number>
</property>
<item>
+ <widget class="QLineEdit" name="lineControlAddress" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxLength" >
+ <number>15</number>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight</set>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>95</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip" >
+ <string>IP address on which Tor is listening for controller connections.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QLineEdit" name="lineControlPort" >
<property name="sizePolicy" >
<sizepolicy>
@@ -511,6 +746,9 @@
<property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum>
</property>
+ <property name="visible" >
+ <bool>false</bool>
+ </property>
<property name="title" >
<string>Service</string>
</property>
@@ -535,9 +773,6 @@
</widget>
</item>
</layout>
- <property name="visible" >
- <bool>false</bool>
- </property>
</widget>
</item>
<item>
@@ -555,7 +790,6 @@
</item>
</layout>
</widget>
- <pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>