diff src/hgaction.h @ 571:012ba1b83328

Show cancel button with progress bar only when running an operation that it makes sense to cancel (we don't really want people cancelling e.g. initial folder scan because it would leave things in an inconsistent state)
author Chris Cannam
date Thu, 01 Mar 2012 22:53:54 +0000
parents 533519ebc0cb
children ab92f695f776
line wrap: on
line diff
--- a/src/hgaction.h	Wed Feb 29 15:24:10 2012 +0000
+++ b/src/hgaction.h	Thu Mar 01 22:53:54 2012 +0000
@@ -118,6 +118,20 @@
 	    return false;
 	}
     }
+
+    bool makesSenseToCancel() const {
+        switch (action) {
+        case ACT_INCOMING:
+        case ACT_PUSH:
+        case ACT_PULL:
+        case ACT_CLONEFROMREMOTE:
+        case ACT_FOLDERDIFF:
+        case ACT_CHGSETDIFF:
+            return true;
+        default:
+            return false;
+        }
+    }
 };
 
 #endif