[tor-commits] [vidalia/alpha] Modifies when to change the torrc setting
chiiph at torproject.org
chiiph at torproject.org
Sun Jun 12 18:26:00 UTC 2011
commit 3548c24b095e458251692ae2b053504898a025c2
Author: Tomas Touceda <chiiph at gentoo.org>
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 | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/vidalia/config/AdvancedPage.cpp b/src/vidalia/config/AdvancedPage.cpp
index 1fda8ad..a879ecc 100644
--- a/src/vidalia/config/AdvancedPage.cpp
+++ b/src/vidalia/config/AdvancedPage.cpp
@@ -165,16 +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() or
- not Vidalia::torControl()->isRunning()) {
+ 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();
More information about the tor-commits
mailing list