commit 78ad28354fd28494f77b9dd89cb5dde093042579 Author: Tomás Touceda chiiph@torproject.org Date: Sat Jun 9 13:04:50 2012 -0300
Add a way to set and retrieve if we should warn the user when setting ExitNodes --- src/vidalia/config/VidaliaSettings.cpp | 13 +++++++++++++ src/vidalia/config/VidaliaSettings.h | 10 +++++++++- 2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/vidalia/config/VidaliaSettings.cpp b/src/vidalia/config/VidaliaSettings.cpp index ff9bc6d..8386d64 100644 --- a/src/vidalia/config/VidaliaSettings.cpp +++ b/src/vidalia/config/VidaliaSettings.cpp @@ -90,6 +90,7 @@ VidaliaSettings::VidaliaSettings() setDefault(SETTING_ALLOW_PANIC, false); setDefault(SETTING_PANIC_PATH, ""); setDefault(SETTING_FIRST_RUN, true); + setDefault(SETTING_REMEMBER_DONTWARNEXIT, true); }
/** Gets the currently preferred language code for Vidalia. */ @@ -380,3 +381,15 @@ VidaliaSettings::setFirstRun(bool val) { setValue(SETTING_FIRST_RUN, val); } + +bool +VidaliaSettings::dontWarnExitNodes() const +{ + return value(SETTING_REMEMBER_DONTWARNEXIT).toBool(); +} + +void +VidaliaSettings::setDontWarnExitNodes(bool val) +{ + setValue(SETTING_REMEMBER_DONTWARNEXIT, val); +} diff --git a/src/vidalia/config/VidaliaSettings.h b/src/vidalia/config/VidaliaSettings.h index d088ac0..68cbd3b 100644 --- a/src/vidalia/config/VidaliaSettings.h +++ b/src/vidalia/config/VidaliaSettings.h @@ -21,7 +21,8 @@ #include <QDateTime>
/** Public setting keys */ -#define SETTING_REMEMBER_SHUTDOWN "RememberShutdown" +#define SETTING_REMEMBER_SHUTDOWN "RememberShutdown" +#define SETTING_REMEMBER_DONTWARNEXIT "DontWarnExitNodes"
/** Handles saving and restoring Vidalia's settings, such as the * location of Tor, the control port, etc. @@ -151,6 +152,13 @@ public: bool firstRun() const; /** Sets Vidalia's first run option */ void setFirstRun(bool val); + + /** Returns true if Vidalia should warn the user when setting Exit + * nodes by hand */ + bool dontWarnExitNodes() const; + /** Sets wether Vidalia should warn the user when setting Exit nodes + * by hand */ + void setDontWarnExitNodes(bool val); };
#endif
tor-commits@lists.torproject.org