Chris@57
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@57
|
2
|
Chris@57
|
3 /*
|
Chris@57
|
4 EasyMercurial
|
Chris@57
|
5
|
Chris@57
|
6 Based on HgExplorer by Jari Korhonen
|
Chris@57
|
7 Copyright (c) 2010 Jari Korhonen
|
Chris@57
|
8 Copyright (c) 2010 Chris Cannam
|
Chris@57
|
9 Copyright (c) 2010 Queen Mary, University of London
|
Chris@57
|
10
|
Chris@57
|
11 This program is free software; you can redistribute it and/or
|
Chris@57
|
12 modify it under the terms of the GNU General Public License as
|
Chris@57
|
13 published by the Free Software Foundation; either version 2 of the
|
Chris@57
|
14 License, or (at your option) any later version. See the file
|
Chris@57
|
15 COPYING included with this distribution for more information.
|
Chris@57
|
16 */
|
jtkorhonen@0
|
17
|
jtkorhonen@0
|
18 #ifndef MAINWINDOW_H
|
jtkorhonen@0
|
19 #define MAINWINDOW_H
|
jtkorhonen@0
|
20
|
jtkorhonen@0
|
21 #include "hgexpwidget.h"
|
jtkorhonen@0
|
22 #include "hgrunner.h"
|
jtkorhonen@0
|
23 #include "common.h"
|
jtkorhonen@0
|
24
|
Chris@50
|
25 #include <QMainWindow>
|
Chris@50
|
26 #include <QListWidget>
|
Chris@50
|
27
|
jtkorhonen@0
|
28 QT_BEGIN_NAMESPACE
|
jtkorhonen@0
|
29 class QAction;
|
jtkorhonen@0
|
30 class QMenu;
|
jtkorhonen@0
|
31 QT_END_NAMESPACE
|
jtkorhonen@0
|
32
|
jtkorhonen@0
|
33 enum HGACTIONS
|
jtkorhonen@0
|
34 {
|
jtkorhonen@0
|
35 ACT_NONE,
|
Chris@74
|
36 ACT_PATHS,
|
jtkorhonen@0
|
37 ACT_STAT,
|
jtkorhonen@0
|
38 ACT_HEADS,
|
jtkorhonen@0
|
39 ACT_PARENTS,
|
jtkorhonen@0
|
40 ACT_LOG,
|
jtkorhonen@0
|
41 ACT_REMOVE,
|
jtkorhonen@0
|
42 ACT_ADD,
|
jtkorhonen@0
|
43 ACT_INCOMING,
|
jtkorhonen@0
|
44 ACT_PUSH,
|
jtkorhonen@0
|
45 ACT_PULL,
|
jtkorhonen@0
|
46 ACT_CLONEFROMREMOTE,
|
jtkorhonen@0
|
47 ACT_INIT,
|
jtkorhonen@0
|
48 ACT_COMMIT,
|
jtkorhonen@0
|
49 ACT_ANNOTATE,
|
jtkorhonen@0
|
50 ACT_FILEDIFF,
|
jtkorhonen@0
|
51 ACT_FOLDERDIFF,
|
jtkorhonen@0
|
52 ACT_CHGSETDIFF,
|
jtkorhonen@0
|
53 ACT_UPDATE,
|
jtkorhonen@0
|
54 ACT_REVERT,
|
jtkorhonen@0
|
55 ACT_MERGE,
|
jtkorhonen@0
|
56 ACT_RESOLVE_LIST,
|
jtkorhonen@11
|
57 ACT_SERVE,
|
jtkorhonen@33
|
58 ACT_RESOLVE_MARK,
|
jtkorhonen@33
|
59 ACT_RETRY_MERGE,
|
jtkorhonen@34
|
60 ACT_TAG,
|
jtkorhonen@36
|
61 ACT_HG_IGNORE,
|
jtkorhonen@0
|
62 };
|
jtkorhonen@0
|
63
|
jtkorhonen@0
|
64
|
jtkorhonen@0
|
65 class MainWindow : public QMainWindow
|
jtkorhonen@0
|
66 {
|
jtkorhonen@0
|
67 Q_OBJECT
|
jtkorhonen@0
|
68
|
jtkorhonen@0
|
69 public:
|
jtkorhonen@0
|
70 MainWindow();
|
jtkorhonen@0
|
71 HgExpWidget *hgExp;
|
jtkorhonen@0
|
72 void writeSettings();
|
jtkorhonen@0
|
73 void enableDisableActions();
|
jtkorhonen@0
|
74
|
jtkorhonen@0
|
75 //Paths to remote repo & workfolder
|
jtkorhonen@0
|
76 //Local repo is directory "./hg/" under work folder
|
jtkorhonen@0
|
77 QString remoteRepoPath;
|
jtkorhonen@0
|
78 QString workFolderPath;
|
jtkorhonen@0
|
79
|
jtkorhonen@0
|
80 protected:
|
jtkorhonen@0
|
81 void closeEvent(QCloseEvent *event);
|
jtkorhonen@0
|
82
|
jtkorhonen@0
|
83 public slots:
|
Chris@74
|
84 void hgPaths();
|
jtkorhonen@0
|
85 void hgStat();
|
jtkorhonen@0
|
86 void tabChanged(int currTab);
|
Chris@62
|
87 void commandCompleted();
|
Chris@62
|
88 void commandFailed();
|
jtkorhonen@0
|
89
|
jtkorhonen@0
|
90 private slots:
|
jtkorhonen@0
|
91 void about();
|
Chris@64
|
92 void settings();
|
Chris@69
|
93 void open();
|
Chris@64
|
94 void startupDialog();
|
Chris@64
|
95
|
jtkorhonen@0
|
96 void hgRemove();
|
jtkorhonen@0
|
97 void hgAdd();
|
jtkorhonen@0
|
98 void hgCommit();
|
jtkorhonen@0
|
99 void hgFileDiff();
|
jtkorhonen@0
|
100 void hgFolderDiff();
|
jtkorhonen@0
|
101 void hgChgSetDiff();
|
jtkorhonen@0
|
102 void hgUpdate();
|
jtkorhonen@0
|
103 void hgRevert();
|
jtkorhonen@0
|
104 void hgMerge();
|
jtkorhonen@33
|
105 void hgRetryMerge();
|
jtkorhonen@0
|
106 void hgCloneFromRemote();
|
jtkorhonen@0
|
107 void hgInit();
|
jtkorhonen@0
|
108 void hgIncoming();
|
jtkorhonen@0
|
109 void hgPush();
|
jtkorhonen@0
|
110 void hgPull();
|
jtkorhonen@0
|
111 void hgUpdateToRev();
|
jtkorhonen@0
|
112 void hgAnnotate();
|
jtkorhonen@0
|
113 void hgResolveList();
|
jtkorhonen@0
|
114 void hgResolveMark();
|
jtkorhonen@34
|
115 void hgTag();
|
jtkorhonen@11
|
116 void hgServe();
|
jtkorhonen@34
|
117 void hgIgnore();
|
jtkorhonen@0
|
118
|
jtkorhonen@0
|
119 private:
|
jtkorhonen@0
|
120 void hgHeads();
|
jtkorhonen@0
|
121 void hgParents();
|
jtkorhonen@0
|
122 void hgLog();
|
jtkorhonen@0
|
123 void createActions();
|
jtkorhonen@0
|
124 void connectActions();
|
jtkorhonen@0
|
125 void createMenus();
|
jtkorhonen@0
|
126 void createToolBars();
|
jtkorhonen@0
|
127 void createStatusBar();
|
jtkorhonen@0
|
128 void readSettings();
|
jtkorhonen@0
|
129 void splitChangeSets(QStringList *list, QString hgLogOutput);
|
jtkorhonen@34
|
130 int getCommentOrTag(QString& commentOrTag, QString question, QString dlgTitle);
|
jtkorhonen@2
|
131 void presentLongStdoutToUser(QString stdo);
|
jtkorhonen@17
|
132 void countModifications(QListWidget *workList, int& added, int& modified, int& removed, int& notTracked,
|
jtkorhonen@17
|
133 int& selected,
|
jtkorhonen@17
|
134 int& selectedAdded, int& selectedModified, int& selectedRemoved, int& selectedNotTracked);
|
jtkorhonen@0
|
135 bool isSelectedModified(QListWidget *workList);
|
jtkorhonen@17
|
136 bool areAllSelectedUntracked(QListWidget *workList);
|
jtkorhonen@6
|
137 bool isSelectedDeletable(QListWidget *workList);
|
jtkorhonen@17
|
138 bool areAllSelectedCommitable(QListWidget *workList);
|
jtkorhonen@28
|
139 QString listAllUpIpV4Addresses();
|
jtkorhonen@34
|
140 QString filterTag(QString tag);
|
jtkorhonen@0
|
141
|
Chris@64
|
142 QString getUserInfo() const;
|
Chris@64
|
143
|
Chris@64
|
144 bool firstStart;
|
Chris@64
|
145
|
jtkorhonen@0
|
146 //Actions enabled flags
|
jtkorhonen@0
|
147 bool remoteRepoActionsEnabled;
|
jtkorhonen@0
|
148 bool localRepoActionsEnabled;
|
jtkorhonen@0
|
149
|
jtkorhonen@0
|
150 //File menu actions
|
jtkorhonen@0
|
151 QAction *hgInitAct;
|
jtkorhonen@0
|
152 QAction *hgCloneFromRemoteAct;
|
Chris@69
|
153 QAction *openAct;
|
jtkorhonen@0
|
154 QAction *settingsAct;
|
jtkorhonen@0
|
155 QAction *exitAct;
|
jtkorhonen@0
|
156
|
jtkorhonen@33
|
157 //Repo actions
|
jtkorhonen@0
|
158 QAction *hgIncomingAct;
|
jtkorhonen@0
|
159 QAction *hgPushAct;
|
jtkorhonen@0
|
160 QAction *hgPullAct;
|
jtkorhonen@0
|
161 QAction *hgStatAct;
|
jtkorhonen@0
|
162 QAction *hgFileDiffAct;
|
jtkorhonen@0
|
163 QAction *hgFolderDiffAct;
|
jtkorhonen@0
|
164 QAction *hgChgSetDiffAct;
|
jtkorhonen@0
|
165 QAction *hgRevertAct;
|
jtkorhonen@0
|
166 QAction *hgAddAct;
|
jtkorhonen@0
|
167 QAction *hgRemoveAct;
|
jtkorhonen@0
|
168 QAction *hgUpdateAct;
|
jtkorhonen@0
|
169 QAction *hgCommitAct;
|
jtkorhonen@0
|
170 QAction *hgMergeAct;
|
jtkorhonen@33
|
171 QAction *hgRetryMergeAct;
|
jtkorhonen@0
|
172 QAction *hgUpdateToRevAct;
|
jtkorhonen@0
|
173 QAction *hgAnnotateAct;
|
jtkorhonen@0
|
174 QAction *hgResolveListAct;
|
jtkorhonen@0
|
175 QAction *hgResolveMarkAct;
|
jtkorhonen@34
|
176 QAction *hgTagAct;
|
jtkorhonen@34
|
177 QAction *hgIgnoreAct;
|
jtkorhonen@11
|
178 QAction *hgServeAct;
|
jtkorhonen@0
|
179
|
jtkorhonen@0
|
180 //Menus
|
jtkorhonen@0
|
181 QMenu *fileMenu;
|
jtkorhonen@0
|
182 QMenu *advancedMenu;
|
jtkorhonen@0
|
183 QMenu *helpMenu;
|
jtkorhonen@0
|
184
|
jtkorhonen@0
|
185 //Help menu actions
|
jtkorhonen@0
|
186 QAction *aboutAct;
|
jtkorhonen@0
|
187 QAction *aboutQtAct;
|
jtkorhonen@0
|
188
|
jtkorhonen@0
|
189 QToolBar *fileToolBar;
|
jtkorhonen@0
|
190 QToolBar *repoToolBar;
|
jtkorhonen@0
|
191 QToolBar *workFolderToolBar;
|
jtkorhonen@0
|
192
|
jtkorhonen@0
|
193 HGACTIONS runningAction;
|
jtkorhonen@0
|
194 HgRunner *runner;
|
jtkorhonen@0
|
195
|
jtkorhonen@33
|
196 int tabPage;
|
jtkorhonen@0
|
197 unsigned char initialFileTypesBits;
|
jtkorhonen@33
|
198 bool justMerged;
|
jtkorhonen@0
|
199 };
|
jtkorhonen@0
|
200
|
jtkorhonen@0
|
201 #endif
|