diff src/mainwindow.cpp @ 564:39cac58b4f92

Add commandCancelled signal -- but don't make use of it; it didn't work out as I'd hoped
author Chris Cannam
date Tue, 28 Feb 2012 16:59:25 +0000
parents 533519ebc0cb
children c2e212ab0068
line wrap: on
line diff
--- a/src/mainwindow.cpp	Tue Feb 28 14:38:42 2012 +0000
+++ b/src/mainwindow.cpp	Tue Feb 28 16:59:25 2012 +0000
@@ -85,6 +85,8 @@
             this, SLOT(commandCompleted(HgAction, QString)));
     connect(m_runner, SIGNAL(commandFailed(HgAction, QString, QString)),
             this, SLOT(commandFailed(HgAction, QString, QString)));
+    connect(m_runner, SIGNAL(commandCancelled(HgAction)),
+            this, SLOT(commandCancelled(HgAction)));
     statusBar()->addPermanentWidget(m_runner);
 
     setWindowTitle(tr("EasyMercurial"));
@@ -2528,6 +2530,19 @@
     }
 }
 
+void MainWindow::commandCancelled(HgAction cancelledAction)
+{
+    // Originally I had this checking whether the cancelled action was
+    // a network one and, if so, calling hgQueryPaths to update the
+    // local view in case it had changed anything. But that doesn't
+    // work properly -- because at this point, although the command
+    // has been cancelled and a kill signal sent, it hasn't actually
+    // exited yet. If we request another command now, it will go on
+    // the stack and be associated with the failed exit forthcoming
+    // from the cancelled command -- giving the user a disturbing
+    // command-failed dialog
+}
+
 void MainWindow::connectActions()
 {
     connect(m_exitAct, SIGNAL(triggered()), this, SLOT(close()));