diff mainwindow.cpp @ 200:8c8c04bdf0fa

* Separate out the hg test action into two tests, one for plain hg and one with the extension (so can report separately)
author Chris Cannam
date Tue, 04 Jan 2011 12:42:28 +0000
parents f16fe0db11f3
children 3d4291d4226c
line wrap: on
line diff
--- a/mainwindow.cpp	Mon Jan 03 22:02:08 2011 +0000
+++ b/mainwindow.cpp	Tue Jan 04 12:42:28 2011 +0000
@@ -194,6 +194,13 @@
     runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params));
 }
 
+void MainWindow::hgTestExtension()
+{
+    QStringList params;
+    params << "--version";
+    runner->requestAction(HgAction(ACT_TEST_HG_EXT, m_myDirPath, params));
+}
+
 void MainWindow::hgStat()
 {
     QStringList params;
@@ -1487,7 +1494,15 @@
         QMessageBox::warning
             (this, tr("Failed to run Mercurial"),
              format3(tr("Failed to run Mercurial"),
-                     tr("The Mercurial program either could not be found or failed to run.<br>This may indicate a problem with the Mercurial installation, or with the EasyHg interaction extension.<br><br>%1").arg(output == "" ? QString("") : tr("The test command said:")),
+                     tr("The Mercurial program either could not be found or failed to run.<br>Check that the Mercurial program path is correct in Settings.<br><br>%1").arg(output == "" ? QString("") : tr("The test command said:")),
+                     output));
+        settings();
+        return;
+    case ACT_TEST_HG_EXT:
+        QMessageBox::warning
+            (this, tr("Failed to run Mercurial"),
+             format3(tr("Failed to run Mercurial with extension enabled"),
+                     tr("The Mercurial program failed to run with the EasyMercurial interaction extension enabled.<br>This may indicate an installation problem with EasyMercurial.<br><br>You may be able to continue working if you switch off &ldquo;Use EasyHg Mercurial Extension&rdquo; in Settings.  Note that remote repositories that require authentication may not work if you do this.<br><br>%1").arg(output == "" ? QString("") : tr("The test command said:")),
                      output));
         settings();
         return;
@@ -1555,6 +1570,9 @@
     case ACT_TEST_HG:
         break;
 
+    case ACT_TEST_HG_EXT:
+        break;
+
     case ACT_QUERY_PATHS:
     {
         DEBUG << "stdout is " << output << endl;
@@ -1741,6 +1759,10 @@
     switch (action) {
 
     case ACT_TEST_HG:
+        hgTestExtension();
+        break;
+        
+    case ACT_TEST_HG_EXT:
         hgQueryPaths();
         break;