[or-cvs] r12746: Display an error message when Vidalia couldn't start the web (torpedo/trunk/build-scripts)

sjm217 at seul.org sjm217 at seul.org
Sun Dec 9 18:26:27 UTC 2007


Author: sjm217
Date: 2007-12-09 13:26:27 -0500 (Sun, 09 Dec 2007)
New Revision: 12746

Modified:
   torpedo/trunk/build-scripts/vidalia-startbrowser.patch
Log:
Display an error message when Vidalia couldn't start the web browser

Modified: torpedo/trunk/build-scripts/vidalia-startbrowser.patch
===================================================================
--- torpedo/trunk/build-scripts/vidalia-startbrowser.patch	2007-12-09 18:07:57 UTC (rev 12745)
+++ torpedo/trunk/build-scripts/vidalia-startbrowser.patch	2007-12-09 18:26:27 UTC (rev 12746)
@@ -153,7 +153,7 @@
 ===================================================================
 --- src/vidalia/mainwindow.cpp	(revision 2205)
 +++ src/vidalia/mainwindow.cpp	(working copy)
-@@ -152,6 +152,11 @@
+@@ -152,6 +152,13 @@
    _torControl->setEvent(TorEvents::ClientStatus,  this, true);
    _torControl->setEvent(TorEvents::GeneralStatus, this, true);
  
@@ -161,11 +161,13 @@
 +  _browserProcess = new BrowserProcess(this);
 +  connect(_browserProcess, SIGNAL(finished(int, QProcess::ExitStatus)),
 +	         this, SLOT(onBrowserFinished(int, QProcess::ExitStatus)));
++  connect(_browserProcess, SIGNAL(startFailed(QString)),
++	         this, SLOT(onBrowserFailed(QString)));
 +
    /* Catch signals when the application is running or shutting down */
    connect(vApp, SIGNAL(running()), this, SLOT(running()));
    connect(vApp, SIGNAL(shutdown()), this, SLOT(shutdown()));
-@@ -427,6 +432,22 @@
+@@ -427,6 +434,35 @@
  #endif
  }
  
@@ -185,10 +187,23 @@
 +  shutdown();
 +}
 +
++/** Called when the web browser, for example, because the path
++ * specified to the web browser executable didn't lead to an executable. */
++void
++MainWindow::onBrowserFailed(QString errmsg)
++{
++  Q_UNUSED(errmsg);
++ 
++  /* Display an error message and see if the user wants some help */
++  int response = VMessageBox::warning(this, tr("Error starting web browser"),
++				      tr("Vidalia was unable to start the configured web browser"),
++				      VMessageBox::Ok|VMessageBox::Default|VMessageBox::Escape);
++}
++
  /** Updates the UI to reflect Tor's current <b>status</b>. Returns the
   * previously set TorStatus value.*/
  MainWindow::TorStatus
-@@ -1006,6 +1027,7 @@
+@@ -1006,6 +1042,7 @@
  MainWindow::circuitEstablished()
  {
    updateTorStatus(CircuitEstablished);
@@ -208,16 +223,18 @@
  
  
  class MainWindow : public VidaliaWindow
-@@ -116,6 +117,8 @@
+@@ -116,6 +117,10 @@
    void showServerConfigDialog();
    /** Called when the "show on startup" checkbox is toggled. */
    void toggleShowOnStartup(bool checked);
 +  /** Called when the web browser has stopped */
 +  void onBrowserFinished(int exitCode, QProcess::ExitStatus exitStatus);
++  /** Called web the web browser failed to start */
++  void onBrowserFailed(QString errmsg);
    
  #if QT_VERSION >= 0x040200 && !defined(Q_WS_MAC)
    /** Displays the main window if <b>reason</b> is DoubleClick. */
-@@ -147,6 +150,8 @@
+@@ -147,6 +152,8 @@
    /** Updates the UI to reflect Tor's current <b>status</b>. Returns the
     * previously set TorStatus value. */
    TorStatus updateTorStatus(TorStatus status);
@@ -226,7 +243,7 @@
    /** Converts a TorStatus enum value to a string for debug logging purposes. */
    QString toString(TorStatus status);
    /** Authenticates Vidalia to Tor's control port. */
-@@ -184,6 +189,8 @@
+@@ -184,6 +191,8 @@
    ConfigDialog* _configDialog;
    /** A TorControl object that handles communication with Tor */
    TorControl* _torControl;



More information about the tor-commits mailing list