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

[vidalia-svn] r1911: Don't start Tor or test for a running Tor with an open contr (in trunk: . src/gui)



Author: edmanm
Date: 2007-09-05 23:51:14 -0400 (Wed, 05 Sep 2007)
New Revision: 1911

Modified:
   trunk/
   trunk/src/gui/mainwindow.cpp
   trunk/src/gui/mainwindow.h
Log:
 r2128@adrastea:  edmanm | 2007-09-04 22:18:20 -0400
 Don't start Tor or test for a running Tor with an open control port until the
 main event loop is running.



Property changes on: trunk
___________________________________________________________________
 svk:merge ticket from /vidalia/local/trunk [r2128] on 54b3572a-7227-0410-958f-53ecd705b71a

Modified: trunk/src/gui/mainwindow.cpp
===================================================================
--- trunk/src/gui/mainwindow.cpp	2007-09-06 03:51:07 UTC (rev 1910)
+++ trunk/src/gui/mainwindow.cpp	2007-09-06 03:51:14 UTC (rev 1911)
@@ -142,20 +142,10 @@
   connect(_torControl, SIGNAL(authenticationFailed(QString)),
                  this,   SLOT(authenticationFailed(QString)));
 
-  /* Make sure we shut down when the operating system is restarting */
+  /* Catch signals when the application is running or shutting down */
+  connect(vApp, SIGNAL(running()), this, SLOT(running()));
   connect(vApp, SIGNAL(shutdown()), this, SLOT(shutdown()));
-
-  if (_torControl->isRunning()) {
-    /* Tor may be already running, but we still need to connect to it. So,
-     * update our status now. */ 
-    updateTorStatus(Starting);
-    /* Tor was already running */
-    started();
-  } else if (settings.runTorAtStart()) {
-    /* If we're supposed to start Tor when Vidalia starts, then do it now */
-    start();
-  }
-  
+ 
   if (isTrayIconSupported()) {
     /* Make the tray icon visible */
     _trayIcon.show();
@@ -199,6 +189,24 @@
 #endif
 }
 
+/** Called when the application has started and the main event loop is
+ * running. */
+void
+MainWindow::running()
+{
+  VidaliaSettings settings;
+  if (_torControl->isRunning()) {
+    /* Tor may be already running, but we still need to connect to it. So,
+     * update our status now. */ 
+    updateTorStatus(Starting);
+    /* Tor was already running */
+    started();
+  } else if (settings.runTorAtStart()) {
+    /* If we're supposed to start Tor when Vidalia starts, then do it now */
+    start();
+  }
+}
+
 /** Terminate the Tor process if it is being run under Vidalia, disconnect all
  * TorControl signals, and exit Vidalia. */
 void

Modified: trunk/src/gui/mainwindow.h
===================================================================
--- trunk/src/gui/mainwindow.h	2007-09-06 03:51:07 UTC (rev 1910)
+++ trunk/src/gui/mainwindow.h	2007-09-06 03:51:14 UTC (rev 1911)
@@ -93,6 +93,9 @@
   void newIdentity();
   /** Called when the user exits Vidalia. */
   void close();
+  /** Called when the application has started and the main event loop is
+   * running. */
+  void running();
   /** Terminate the Tor process if it is being run under Vidalia, disconnect
    * all TorControl signals, and exit Vidalia. */
   void shutdown();