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

[tor-commits] [vidalia/master] Modifies when to change the torrc setting



commit bea1e28b50379a4adbdf455556104ca7c5328014
Author: Tomas Touceda <chiiph@xxxxxxxxxx>
Date:   Sat May 21 13:06:35 2011 -0300

    Modifies when to change the torrc setting
    
    If Vidalia is running Tor or it isn't connected yet, do it. Otherwise,
    users that start Tor manually won't be able to change this setting.
---
 src/vidalia/config/AdvancedPage.cpp |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/vidalia/config/AdvancedPage.cpp b/src/vidalia/config/AdvancedPage.cpp
index e07fc51..a879ecc 100644
--- a/src/vidalia/config/AdvancedPage.cpp
+++ b/src/vidalia/config/AdvancedPage.cpp
@@ -165,15 +165,18 @@ AdvancedPage::save(QString &errmsg)
 
   /* Only remember the torrc and datadir values if Vidalia started Tor, or
    * if the user changed the displayed values. */
-  if (Vidalia::torControl()->isVidaliaRunningTor()) {
+  if (Vidalia::torControl()->isVidaliaRunningTor() or 
+      !Vidalia::torControl()->isConnected()) {
     QString torrc = ui.lineTorConfig->text();
     if (torrc != _settings->getTorrc()) {
       _settings->setTorrc(torrc);
-      QMessageBox::StandardButtons res = QMessageBox::question(this, tr("Warning"), 
-          tr("You changed torrc path, would you like to restart Tor?"),
-          QMessageBox::Yes | QMessageBox::No);
-      if(res == QMessageBox::Yes)
-        emit restartTor();
+      if(Vidalia::torControl()->isConnected()) {
+        QMessageBox::StandardButtons res = QMessageBox::question(this, tr("Warning"), 
+            tr("You changed torrc path, would you like to restart Tor?"),
+            QMessageBox::Yes | QMessageBox::No);
+        if(res == QMessageBox::Yes)
+          emit restartTor();
+      }
     }
 
     QString dataDir = ui.lineTorDataDirectory->text();



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits