[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r2969: Two new features: * Display the number of HiddenServices act (in vidalia/branches/hidden-services/src/vidalia: . config)
Author: borkdomenik
Date: 2008-08-15 11:42:17 -0400 (Fri, 15 Aug 2008)
New Revision: 2969
Modified:
vidalia/branches/hidden-services/src/vidalia/config/configdialog.cpp
vidalia/branches/hidden-services/src/vidalia/config/configdialog.h
vidalia/branches/hidden-services/src/vidalia/config/servicepage.ui
vidalia/branches/hidden-services/src/vidalia/mainwindow.cpp
vidalia/branches/hidden-services/src/vidalia/mainwindow.h
Log:
Two new features:
* Display the number of HiddenServices actually running on the MainWindow(thanks to phobos for this idea!!)
* Added some Tooltipps for the new features.
Modified: vidalia/branches/hidden-services/src/vidalia/config/configdialog.cpp
===================================================================
--- vidalia/branches/hidden-services/src/vidalia/config/configdialog.cpp 2008-08-15 04:53:56 UTC (rev 2968)
+++ vidalia/branches/hidden-services/src/vidalia/config/configdialog.cpp 2008-08-15 15:42:17 UTC (rev 2969)
@@ -51,6 +51,8 @@
/* Invoke the Qt Designer generated QObject setup routine */
ui.setupUi(this);
+ /* A reference to the parnet widget */
+ //_parent = (MainWIndow)parent;
/* Override the QDialogButtonBox button text so we can use our own
* translations. */
QPushButton *button = ui.buttonBox->button(QDialogButtonBox::Ok);
@@ -222,8 +224,10 @@
}
appliedChanges = true;
}
- if (appliedChanges)
+ if (appliedChanges) {
saveConf();
+ }
+ emit saved();
close();
}
Modified: vidalia/branches/hidden-services/src/vidalia/config/configdialog.h
===================================================================
--- vidalia/branches/hidden-services/src/vidalia/config/configdialog.h 2008-08-15 04:53:56 UTC (rev 2968)
+++ vidalia/branches/hidden-services/src/vidalia/config/configdialog.h 2008-08-15 15:42:17 UTC (rev 2969)
@@ -20,6 +20,7 @@
#include <QMainWindow>
#include <QFileDialog>
#include <vidaliawindow.h>
+//#include <mainwindow.h>
#include "generalpage.h"
#include "networkpage.h"
@@ -70,6 +71,13 @@
* currently viewing. */
void help();
+public:
+
+signals:
+ /** Emitted when the user closes the ConfigDialog in order to update the
+ * number of Hidden Services that are running on the MainWindow */
+ void saved();
+
private:
/** Loads the current configuration settings */
void loadSettings();
@@ -77,6 +85,8 @@
QAction* createPageAction(QIcon img, QString text, QActionGroup *group);
/** Adds a new action to the toolbar. */
void addAction(QAction *action, const char *slot = 0);
+ /** A reference to the parent widget*/
+ //MainWindow* _parent;
/** Qt Designer generated object */
Ui::ConfigDialog ui;
Modified: vidalia/branches/hidden-services/src/vidalia/config/servicepage.ui
===================================================================
--- vidalia/branches/hidden-services/src/vidalia/config/servicepage.ui 2008-08-15 04:53:56 UTC (rev 2968)
+++ vidalia/branches/hidden-services/src/vidalia/config/servicepage.ui 2008-08-15 15:42:17 UTC (rev 2969)
@@ -106,6 +106,12 @@
<height>0</height>
</size>
</property>
+ <property name="toolTip" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">A listing of all configured Services.</p></body></html></string>
+ </property>
<property name="selectionMode" >
<enum>QAbstractItemView::SingleSelection</enum>
</property>
@@ -297,6 +303,12 @@
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QCheckBox" name="checkBox_basic" >
+ <property name="toolTip" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the basic authorization mode is more scalable but less secure.</p></body></html></string>
+ </property>
<property name="text" >
<string>basic configuration</string>
</property>
@@ -304,6 +316,12 @@
</item>
<item row="0" column="1" >
<widget class="QCheckBox" name="checkBox_stealth" >
+ <property name="toolTip" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the stealth authorization mode is more secure but less scalable.</p></body></html></string>
+ </property>
<property name="text" >
<string>stealth configuration</string>
</property>
@@ -325,6 +343,12 @@
<height>16777215</height>
</size>
</property>
+ <property name="toolTip" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">A listing of all ClientAuthorizationData configured with Vidalia.</p></body></html></string>
+ </property>
<property name="selectionMode" >
<enum>QAbstractItemView::SingleSelection</enum>
</property>
@@ -448,10 +472,24 @@
</widget>
</item>
<item row="1" column="0" >
- <widget class="QLineEdit" name="authLineAccess" />
+ <widget class="QLineEdit" name="authLineAccess" >
+ <property name="toolTip" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">only entries in the format: &lt;onion-address&gt; &lt;descriptor-cookie&gt; allowed.</p></body></html></string>
+ </property>
+ </widget>
</item>
<item row="1" column="1" >
- <widget class="QLineEdit" name="commentLineAccess" />
+ <widget class="QLineEdit" name="commentLineAccess" >
+ <property name="toolTip" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Give an optional comment or identification for each entry.</p></body></html></string>
+ </property>
+ </widget>
</item>
</layout>
</item>
@@ -465,6 +503,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">A listing of all ServiceAuthorizationData stored with Vidalia.</p></body></html></string>
+ </property>
<property name="selectionMode" >
<enum>QAbstractItemView::SingleSelection</enum>
</property>
@@ -486,7 +530,10 @@
<item row="0" column="1" >
<widget class="QToolButton" name="addServiceAuthBtn" >
<property name="toolTip" >
- <string>Add new service with authorization data</string>
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Add new service with authorization data</p></body></html></string>
</property>
<property name="text" >
<string/>
Modified: vidalia/branches/hidden-services/src/vidalia/mainwindow.cpp
===================================================================
--- vidalia/branches/hidden-services/src/vidalia/mainwindow.cpp 2008-08-15 04:53:56 UTC (rev 2968)
+++ vidalia/branches/hidden-services/src/vidalia/mainwindow.cpp 2008-08-15 15:42:17 UTC (rev 2969)
@@ -786,6 +786,7 @@
showHelpDialog("troubleshooting.torexited");
}
}
+ ui.lblTorStatus->setText(ui.lblTorStatus->text().append("\n""0 Hidden Services running."));
}
/** Called when the control socket has successfully connected to Tor. */
@@ -1021,6 +1022,7 @@
{
updateTorStatus(CircuitEstablished);
startBrowser();
+ updateHidServStatus();
}
/** Checks the status of the current version of Tor to see if it's old,
@@ -1095,6 +1097,7 @@
MainWindow::showConfigDialog(ConfigDialog::Page page)
{
_configDialog->showWindow(page);
+ connect(_configDialog, SIGNAL(saved()), this, SLOT(updateHidServStatus()));
}
/** Displays the Configuration dialog, set to the Server page. */
@@ -1168,4 +1171,22 @@
return "Unknown";
}
+/** Called to display the number of Hidden Services actually running */
+void
+MainWindow::updateHidServStatus()
+{
+ QString statustext;
+ QString conf = _torControl->getHiddenServiceConf("hiddenserviceoptions");
+ QStringList strList = conf.split("250 HiddenServiceDir");
+ int amount = strList.size()-1;
+ QString lblText = ui.lblTorStatus->text();
+ if(lblText.contains("\n")) {
+ QStringList lblList = lblText.split("\n");
+ statustext = lblList.first();
+ } else {
+ statustext = ui.lblTorStatus->text();
+ }
+ ui.lblTorStatus->setText(statustext.append("\n"+
+ QString::number(amount)+" Hidden Service(s) running."));
+}
Modified: vidalia/branches/hidden-services/src/vidalia/mainwindow.h
===================================================================
--- vidalia/branches/hidden-services/src/vidalia/mainwindow.h 2008-08-15 04:53:56 UTC (rev 2968)
+++ vidalia/branches/hidden-services/src/vidalia/mainwindow.h 2008-08-15 15:42:17 UTC (rev 2969)
@@ -103,6 +103,8 @@
void onBrowserFailed(QString errmsg);
/** Called when the proxy server fails to start */
void onProxyFailed(QString errmsg);
+ /** Called to display the number of Hidden Services actually running */
+ void updateHidServStatus();
private:
enum TorStatus {