[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r3901: If the user chooses to ignore further warnings for a particu (in vidalia/trunk: . src/vidalia src/vidalia/config)



Author: edmanm
Date: 2009-06-26 21:57:05 -0400 (Fri, 26 Jun 2009)
New Revision: 3901

Modified:
   vidalia/trunk/CHANGELOG
   vidalia/trunk/src/vidalia/MainWindow.cpp
   vidalia/trunk/src/vidalia/config/TorSettings.cpp
Log:

If the user chooses to ignore further warnings for a particular port,
remove it from the WarnPlaintextPorts and RejectPlaintextPorts 
settings immediately. Also remember their preferences and reapply them 
later, even if Tor is unable to writes to its torrc. Fixes the second half
of ticket #493.


Modified: vidalia/trunk/CHANGELOG
===================================================================
--- vidalia/trunk/CHANGELOG	2009-06-26 23:20:39 UTC (rev 3900)
+++ vidalia/trunk/CHANGELOG	2009-06-27 01:57:05 UTC (rev 3901)
@@ -14,6 +14,10 @@
     output, and then again to actually start Tor.
   o Add a signal handler that allows Vidalia to clean up and exit normally
     when it catches a SIGINT or SIGTERM signal. (Ticket #481)
+  o If the user chooses to ignore further warnings for a particular port,
+    remove it from the WarnPlaintextPorts and RejectPlaintextPorts
+    settings immediately. Also remember their preferences and reapply them
+    later, even if Tor is unable to writes to its torrc.(Ticket #493)
   o Don't display additional plaintext port warning message boxes until
     the first visible message box is dismissed. (Ticket #493)
   o Renamed the 'make win32-installer' CMake target to 'make dist-win32'

Modified: vidalia/trunk/src/vidalia/MainWindow.cpp
===================================================================
--- vidalia/trunk/src/vidalia/MainWindow.cpp	2009-06-26 23:20:39 UTC (rev 3900)
+++ vidalia/trunk/src/vidalia/MainWindow.cpp	2009-06-27 01:57:05 UTC (rev 3901)
@@ -1636,7 +1636,9 @@
 
   int ret = dlg->exec();
   if (ret == QMessageBox::Ignore) {
+    TorControl *tc = Vidalia::torControl();
     TorSettings settings;
+    QStringList portList;
     QList<quint16> ports;
     int idx;
 
@@ -1645,6 +1647,12 @@
     if (idx >= 0) {
       ports.removeAt(idx);
       settings.setWarnPlaintextPorts(ports);
+
+      foreach (quint16 port, ports) {
+        portList << QString::number(port);
+      }
+      tc->setConf("WarnPlaintextPorts", portList.join(","));
+      portList.clear();
     }
 
     ports = settings.getRejectPlaintextPorts();
@@ -1652,6 +1660,11 @@
     if (idx >= 0) {
       ports.removeAt(idx);
       settings.setRejectPlaintextPorts(ports);
+
+      foreach (quint16 port, ports) {
+        portList << QString::number(port);
+      }
+      tc->setConf("RejectPlaintextPorts", portList.join(","));
     }
   }
   delete dlg;

Modified: vidalia/trunk/src/vidalia/config/TorSettings.cpp
===================================================================
--- vidalia/trunk/src/vidalia/config/TorSettings.cpp	2009-06-26 23:20:39 UTC (rev 3900)
+++ vidalia/trunk/src/vidalia/config/TorSettings.cpp	2009-06-27 01:57:05 UTC (rev 3901)
@@ -116,6 +116,12 @@
       conf.insert(TOR_ARG_COOKIE_AUTH,    "0");
       conf.insert(TOR_ARG_HASHED_PASSWORD, "");
   }
+
+  conf.insert(SETTING_WARN_PLAINTEXT_PORTS,
+              localValue(SETTING_WARN_PLAINTEXT_PORTS).toStringList().join(","));
+  conf.insert(SETTING_REJECT_PLAINTEXT_PORTS,
+              localValue(SETTING_REJECT_PLAINTEXT_PORTS).toStringList().join(","));
+
   return torControl()->setConf(conf, errmsg);
 }