diff mainwindow.h @ 109:1721c580c10e

* Add a queueing mechanism for Hg actions, instead of refusing to start an action if something else is already happening. This is essential now that actions can be prompted by asynchronous events (e.g. filesystem watcher). * Make Revert behave sensibly
author Chris Cannam
date Fri, 26 Nov 2010 12:48:29 +0000
parents 8ae3b44c0073
children 4bd17f36d059
line wrap: on
line diff
--- a/mainwindow.h	Thu Nov 25 21:08:17 2010 +0000
+++ b/mainwindow.h	Fri Nov 26 12:48:29 2010 +0000
@@ -22,6 +22,7 @@
 #include "hgrunner.h"
 #include "common.h"
 #include "changeset.h"
+#include "hgaction.h"
 
 #include <QMainWindow>
 #include <QListWidget>
@@ -32,39 +33,6 @@
 class QMenu;
 QT_END_NAMESPACE
 
-enum HGACTIONS
-{
-    ACT_NONE,
-    ACT_PATHS,
-    ACT_BRANCH,
-    ACT_STAT,
-    ACT_HEADS,
-    ACT_PARENTS,
-    ACT_LOG,
-    ACT_REMOVE,
-    ACT_ADD,
-    ACT_INCOMING,
-    ACT_PUSH,
-    ACT_PULL,
-    ACT_CLONEFROMREMOTE,
-    ACT_INIT,
-    ACT_COMMIT,
-    ACT_ANNOTATE,
-    ACT_FILEDIFF,
-    ACT_FOLDERDIFF,
-    ACT_CHGSETDIFF,
-    ACT_UPDATE,
-    ACT_REVERT,
-    ACT_MERGE,
-    ACT_RESOLVE_LIST,
-    ACT_SERVE,
-    ACT_RESOLVE_MARK,
-    ACT_RETRY_MERGE,
-    ACT_TAG,
-    ACT_HG_IGNORE,
-};
-
-
 class MainWindow : public QMainWindow
 {
     Q_OBJECT
@@ -86,11 +54,11 @@
     void closeEvent(QCloseEvent *event);
 
 public slots:
-    void hgPaths();
+    void hgQueryPaths();
     void hgStat();
-    void tabChanged(int currTab);
-    void commandCompleted();
-    void commandFailed();
+//    void tabChanged(int currTab);
+    void commandCompleted(HgAction action, QString stdout);
+    void commandFailed(HgAction action, QString stdout);
     void enableDisableActions();
 
 private slots:
@@ -127,9 +95,9 @@
     void fsFileChanged(QString);
 
 private:
-    void hgBranch();
-    void hgHeads();
-    void hgParents();
+    void hgQueryBranch();
+    void hgQueryHeads();
+    void hgQueryParents();
     void hgLog();
     void createActions();
     void connectActions();
@@ -216,13 +184,12 @@
     QToolBar *repoToolBar;
     QToolBar *workFolderToolBar;
 
-    HGACTIONS   runningAction;
-    HgRunner    *runner;
+    HgRunner *runner;
 
     QFileSystemWatcher *fsWatcher;
 
-    int             tabPage;
-    unsigned char   initialFileTypesBits;
+//    int             tabPage;
+//    unsigned char   initialFileTypesBits;
     bool            justMerged;
 };