[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [vidalia/alpha] Warn at first run if panic is enabled
commit ffe98b13072e0b7a4f831ccdc50e32b088c8ae21
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date: Sun Mar 18 15:38:49 2012 -0300
Warn at first run if panic is enabled
---
src/vidalia/MainWindow.cpp | 12 +++++++++++-
src/vidalia/config/VidaliaSettings.cpp | 14 ++++++++++++++
src/vidalia/config/VidaliaSettings.h | 5 +++++
3 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/src/vidalia/MainWindow.cpp b/src/vidalia/MainWindow.cpp
index c568c80..20959fc 100644
--- a/src/vidalia/MainWindow.cpp
+++ b/src/vidalia/MainWindow.cpp
@@ -124,8 +124,9 @@ MainWindow::MainWindow()
_isVidaliaRunningTor = false;
updateTorStatus(Stopped);
-#if defined(Q_WS_MAC)
VidaliaSettings settings;
+
+#if defined(Q_WS_MAC)
/* Display OSX dock icon if icon preference is not set to "Tray Only" */
if (settings.getIconPref() != VidaliaSettings::Tray) {
ProcessSerialNumber psn = { 0, kCurrentProcess };
@@ -134,6 +135,15 @@ MainWindow::MainWindow()
/* Vidalia launched in background (LSUIElement=true). Bring to foreground. */
VidaliaWindow::setVisible(settings.showMainWindowAtStart());
#endif
+
+ if(settings.firstRun()) {
+ if(settings.allowPanic())
+ VMessageBox::warning(this, tr("Panic is enabled"),
+ tr("<b>WARNING:</b> The Panic button is enabled. Use "
+ "it carefully because it will remove Tor completely."),
+ VMessageBox::Ok|VMessageBox::Default);
+ settings.setFirstRun(false);
+ }
}
/** Destructor */
diff --git a/src/vidalia/config/VidaliaSettings.cpp b/src/vidalia/config/VidaliaSettings.cpp
index 913b0b1..41f0a32 100644
--- a/src/vidalia/config/VidaliaSettings.cpp
+++ b/src/vidalia/config/VidaliaSettings.cpp
@@ -40,6 +40,7 @@
#define SETTING_SKIP_VERSION_CHECK "SkipVersionCheck"
#define SETTING_ALLOW_PANIC "AllowPanic"
#define SETTING_PANIC_PATH "PanicPath"
+#define SETTING_FIRST_RUN "FirstRun"
#if defined(Q_OS_WIN32)
#define STARTUP_REG_KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Run"
@@ -88,6 +89,7 @@ VidaliaSettings::VidaliaSettings()
setDefault(SETTING_REMEMBER_SHUTDOWN, false);
setDefault(SETTING_ALLOW_PANIC, false);
setDefault(SETTING_PANIC_PATH, "");
+ setDefault(SETTING_FIRST_RUN, true);
}
/** Gets the currently preferred language code for Vidalia. */
@@ -366,3 +368,15 @@ VidaliaSettings::setPanicPath(const QString &path)
{
setValue(SETTING_PANIC_PATH, path);
}
+
+bool
+VidaliaSettings::firstRun() const
+{
+ return value(SETTING_FIRST_RUN).toBool();
+}
+
+void
+VidaliaSettings::setFirstRun(bool val)
+{
+ setValue(SETTING_FIRST_RUN, val);
+}
diff --git a/src/vidalia/config/VidaliaSettings.h b/src/vidalia/config/VidaliaSettings.h
index 6f5efb1..d088ac0 100644
--- a/src/vidalia/config/VidaliaSettings.h
+++ b/src/vidalia/config/VidaliaSettings.h
@@ -146,6 +146,11 @@ public:
QString panicPath() const;
/** Sets the path for panic */
void setPanicPath(const QString &path);
+
+ /** Returns true if it's Vidalia's first run */
+ bool firstRun() const;
+ /** Sets Vidalia's first run option */
+ void setFirstRun(bool val);
};
#endif
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits