[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1522: If we think there is already another Vidalia process running (in trunk: doc src src/gui/common)
Author: edmanm
Date: 2006-12-15 01:57:51 -0500 (Fri, 15 Dec 2006)
New Revision: 1522
Modified:
trunk/doc/TODO
trunk/src/gui/common/vmessagebox.cpp
trunk/src/gui/common/vmessagebox.h
trunk/src/main.cpp
Log:
If we think there is already another Vidalia process running, give people a
button they can click to continue anyway since we could be wrong.
Modified: trunk/doc/TODO
===================================================================
--- trunk/doc/TODO 2006-12-14 09:27:26 UTC (rev 1521)
+++ trunk/doc/TODO 2006-12-15 06:57:51 UTC (rev 1522)
@@ -15,8 +15,6 @@
or responses.
* Add a checkbox for disabling the alpha-blended integrals on the bandwidth
graph; the extra cpu usage makes some people sad.
- * Add a button to delete the existing pidfile and start anyway when we think
- there is already another Vidalia running.
Features planned for 0.1.x:
Modified: trunk/src/gui/common/vmessagebox.cpp
===================================================================
--- trunk/src/gui/common/vmessagebox.cpp 2006-12-14 09:27:26 UTC (rev 1521)
+++ trunk/src/gui/common/vmessagebox.cpp 2006-12-15 06:57:51 UTC (rev 1522)
@@ -93,6 +93,8 @@
case Retry: text = tr("Retry"); break;
case ShowLog: text = tr("Show Log"); break;
case ShowSettings: text = tr("Show Settings"); break;
+ case Continue: text = tr("Continue"); break;
+ case Quit: text = tr("Quit"); break;
default: break;
}
return text;
Modified: trunk/src/gui/common/vmessagebox.h
===================================================================
--- trunk/src/gui/common/vmessagebox.h 2006-12-14 09:27:26 UTC (rev 1521)
+++ trunk/src/gui/common/vmessagebox.h 2006-12-15 06:57:51 UTC (rev 1522)
@@ -46,7 +46,9 @@
Help,
Retry,
ShowLog,
- ShowSettings
+ ShowSettings,
+ Continue,
+ Quit
};
/** Default constructor. */
Modified: trunk/src/main.cpp
===================================================================
--- trunk/src/main.cpp 2006-12-14 09:27:26 UTC (rev 1521)
+++ trunk/src/main.cpp 2006-12-15 06:57:51 UTC (rev 1522)
@@ -73,24 +73,20 @@
if (is_vidalia_running(pidfile)) {
/* Let the user know another Vidalia is running and we are going to exit
* now. */
- VMessageBox::critical(0,
- qApp->translate("Vidalia",
- QT_TRANSLATE_NOOP("Vidalia", "Vidalia is already running")),
-#if defined(Q_OS_WIN32)
- vApp->translate("Vidalia",
- QT_TRANSLATE_NOOP("Vidalia",
- "Another Vidalia process is already running. \n\n"
- "This Vidalia process will now exit.")),
-#else
- vApp->translate("Vidalia",
- QT_TRANSLATE_NOOP("Vidalia",
- "Another Vidalia process is already running. \n\n"
- "This Vidalia process will now exit. \n\n"
- "(If there really is not another Vidalia process running, "
- "you can delete %1 before starting Vidalia again.)")).arg(pidfile),
-#endif
- VMessageBox::Ok);
- return 0;
+ int ret = VMessageBox::critical(0,
+ vApp->translate("Vidalia",
+ QT_TRANSLATE_NOOP("Vidalia", "Vidalia is already running")),
+ vApp->translate("Vidalia",
+ QT_TRANSLATE_NOOP("Vidalia",
+ "Another Vidalia process is possibly already running. "
+ "If there really is not another Vidalia process running, "
+ "you can choose to continue anyway.\n\n"
+ "Would you like to continue starting Vidalia?")),
+ VMessageBox::Continue, VMessageBox::Quit|VMessageBox::Default);
+ if (ret != VMessageBox::Continue) {
+ /* Don't start a second instance of Vidalia */
+ return 0;
+ }
}
write_pidfile(pidfile);