[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1988: Give ServerPage a revert() method and make it not try to app (in trunk: . src/gui/config)
Author: edmanm
Date: 2007-10-09 23:39:44 -0400 (Tue, 09 Oct 2007)
New Revision: 1988
Modified:
trunk/
trunk/src/gui/config/serverpage.cpp
trunk/src/gui/config/serverpage.h
Log:
r2020@lysithea: edmanm | 2007-10-09 23:33:18 -0400
Give ServerPage a revert() method and make it not try to apply its own
settings.
Property changes on: trunk
___________________________________________________________________
svk:merge ticket from /local/vidalia/trunk [r2020] on dc66be73-d13e-47ba-a267-8dc7cda68c65
Modified: trunk/src/gui/config/serverpage.cpp
===================================================================
--- trunk/src/gui/config/serverpage.cpp 2007-10-10 03:39:31 UTC (rev 1987)
+++ trunk/src/gui/config/serverpage.cpp 2007-10-10 03:39:44 UTC (rev 1988)
@@ -140,14 +140,7 @@
_settings->setContactInfo(ui.lineServerContact->text());
saveBandwidthLimits();
saveExitPolicies();
-
- /* If we're connected to Tor and we've changed the server settings, attempt
- * to apply the new settings now. */
- if (_torControl->isConnected() && changedSinceLastApply())
- if (!apply(errmsg)) {
- _settings->revert();
- return false;
- }
+
return true;
}
@@ -168,6 +161,14 @@
return _settings->apply(&errmsg);
}
+/** Returns true if the user has changed their server settings since the
+ * last time they were applied to Tor. */
+void
+ServerPage::revert()
+{
+ _settings->revert();
+}
+
/** Loads previously saved settings */
void
ServerPage::load()
Modified: trunk/src/gui/config/serverpage.h
===================================================================
--- trunk/src/gui/config/serverpage.h 2007-10-10 03:39:31 UTC (rev 1987)
+++ trunk/src/gui/config/serverpage.h 2007-10-10 03:39:44 UTC (rev 1988)
@@ -30,10 +30,10 @@
#include <QMessageBox>
#include <QTimer>
-#include <control/torcontrol.h>
-#include <config/serversettings.h>
-#include <config/exitpolicy.h>
-#include <gui/help/browser/helpbrowser.h>
+#include <torcontrol.h>
+#include <serversettings.h>
+#include <exitpolicy.h>
+#include <helpbrowser.h>
#include "configpage.h"
#include "ui_serverpage.h"
@@ -52,10 +52,14 @@
bool save(QString &errmsg);
/** Loads the settings for this page */
void load();
+
/** Applies the server configuration settings to Tor. Returns true if the
* settings were applied successfully. Otherwise, <b>errmsg</b> is set and
* false is returned. */
bool apply(QString &errmsg);
+ /** Reverts the server configuration settings to their values at the last
+ * time they were successfully applied to Tor. */
+ void revert();
/** Returns true if the user has changed their server settings since the
* last time they were applied to Tor. */
bool changedSinceLastApply();