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,
|
jtkorhonen@0
|
36 ACT_STAT,
|
jtkorhonen@0
|
37 ACT_HEADS,
|
jtkorhonen@0
|
38 ACT_PARENTS,
|
jtkorhonen@0
|
39 ACT_LOG,
|
jtkorhonen@0
|
40 ACT_REMOVE,
|
jtkorhonen@0
|
41 ACT_ADD,
|
jtkorhonen@0
|
42 ACT_INCOMING,
|
jtkorhonen@0
|
43 ACT_PUSH,
|
jtkorhonen@0
|
44 ACT_PULL,
|
jtkorhonen@0
|
45 ACT_CLONEFROMREMOTE,
|
jtkorhonen@0
|
46 ACT_INIT,
|
jtkorhonen@0
|
47 ACT_COMMIT,
|
jtkorhonen@0
|
48 ACT_ANNOTATE,
|
jtkorhonen@0
|
49 ACT_FILEDIFF,
|
jtkorhonen@0
|
50 ACT_FOLDERDIFF,
|
jtkorhonen@0
|
51 ACT_CHGSETDIFF,
|
jtkorhonen@0
|
52 ACT_UPDATE,
|
jtkorhonen@0
|
53 ACT_REVERT,
|
jtkorhonen@0
|
54 ACT_MERGE,
|
jtkorhonen@0
|
55 ACT_RESOLVE_LIST,
|
jtkorhonen@11
|
56 ACT_SERVE,
|
jtkorhonen@33
|
57 ACT_RESOLVE_MARK,
|
jtkorhonen@33
|
58 ACT_RETRY_MERGE,
|
jtkorhonen@34
|
59 ACT_TAG,
|
jtkorhonen@36
|
60 ACT_HG_IGNORE,
|
jtkorhonen@0
|
61 };
|
jtkorhonen@0
|
62
|
jtkorhonen@0
|
63
|
jtkorhonen@0
|
64 class MainWindow : public QMainWindow
|
jtkorhonen@0
|
65 {
|
jtkorhonen@0
|
66 Q_OBJECT
|
jtkorhonen@0
|
67
|
jtkorhonen@0
|
68 public:
|
jtkorhonen@0
|
69 MainWindow();
|
jtkorhonen@0
|
70 HgExpWidget *hgExp;
|
jtkorhonen@0
|
71 void writeSettings();
|
jtkorhonen@0
|
72 void enableDisableActions();
|
jtkorhonen@0
|
73
|
jtkorhonen@0
|
74 //Paths to remote repo & workfolder
|
jtkorhonen@0
|
75 //Local repo is directory "./hg/" under work folder
|
jtkorhonen@0
|
76 QString remoteRepoPath;
|
jtkorhonen@0
|
77 QString workFolderPath;
|
jtkorhonen@0
|
78
|
jtkorhonen@30
|
79 QString remoteRepoMruList[NUM_PATHS_IN_MRU_LIST];
|
jtkorhonen@30
|
80 QString workFolderMruList[NUM_PATHS_IN_MRU_LIST];
|
jtkorhonen@30
|
81
|
jtkorhonen@0
|
82 //User info for commits
|
jtkorhonen@0
|
83 QString userInfo;
|
jtkorhonen@0
|
84 bool firstStart;
|
jtkorhonen@0
|
85
|
jtkorhonen@0
|
86 protected:
|
jtkorhonen@0
|
87 void closeEvent(QCloseEvent *event);
|
jtkorhonen@0
|
88 void timerEvent(QTimerEvent *event);
|
jtkorhonen@0
|
89
|
jtkorhonen@0
|
90 public slots:
|
jtkorhonen@0
|
91 void hgStat();
|
jtkorhonen@0
|
92 void tabChanged(int currTab);
|
jtkorhonen@0
|
93
|
jtkorhonen@0
|
94 private slots:
|
jtkorhonen@0
|
95 void about();
|
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 settings();
|
jtkorhonen@0
|
107 void hgCloneFromRemote();
|
jtkorhonen@0
|
108 void hgInit();
|
jtkorhonen@0
|
109 void hgIncoming();
|
jtkorhonen@0
|
110 void hgPush();
|
jtkorhonen@0
|
111 void hgPull();
|
jtkorhonen@0
|
112 void hgUpdateToRev();
|
jtkorhonen@0
|
113 void hgAnnotate();
|
jtkorhonen@0
|
114 void hgResolveList();
|
jtkorhonen@0
|
115 void hgResolveMark();
|
jtkorhonen@34
|
116 void hgTag();
|
jtkorhonen@11
|
117 void hgServe();
|
jtkorhonen@34
|
118 void hgIgnore();
|
jtkorhonen@0
|
119
|
jtkorhonen@0
|
120 private:
|
jtkorhonen@0
|
121 void hgHeads();
|
jtkorhonen@0
|
122 void hgParents();
|
jtkorhonen@0
|
123 void hgLog();
|
jtkorhonen@0
|
124 void createActions();
|
jtkorhonen@0
|
125 void connectActions();
|
jtkorhonen@0
|
126 void createMenus();
|
jtkorhonen@0
|
127 void createToolBars();
|
jtkorhonen@0
|
128 void createStatusBar();
|
jtkorhonen@0
|
129 void readSettings();
|
jtkorhonen@0
|
130 void splitChangeSets(QStringList *list, QString hgLogOutput);
|
jtkorhonen@34
|
131 int getCommentOrTag(QString& commentOrTag, QString question, QString dlgTitle);
|
jtkorhonen@2
|
132 void presentLongStdoutToUser(QString stdo);
|
jtkorhonen@17
|
133 void countModifications(QListWidget *workList, int& added, int& modified, int& removed, int& notTracked,
|
jtkorhonen@17
|
134 int& selected,
|
jtkorhonen@17
|
135 int& selectedAdded, int& selectedModified, int& selectedRemoved, int& selectedNotTracked);
|
jtkorhonen@0
|
136 bool isSelectedModified(QListWidget *workList);
|
jtkorhonen@17
|
137 bool areAllSelectedUntracked(QListWidget *workList);
|
jtkorhonen@6
|
138 bool isSelectedDeletable(QListWidget *workList);
|
jtkorhonen@17
|
139 bool areAllSelectedCommitable(QListWidget *workList);
|
jtkorhonen@28
|
140 QString listAllUpIpV4Addresses();
|
jtkorhonen@34
|
141 QString filterTag(QString tag);
|
jtkorhonen@0
|
142
|
jtkorhonen@0
|
143 //Actions enabled flags
|
jtkorhonen@0
|
144 bool remoteRepoActionsEnabled;
|
jtkorhonen@0
|
145 bool localRepoActionsEnabled;
|
jtkorhonen@0
|
146
|
jtkorhonen@0
|
147 //File menu actions
|
jtkorhonen@0
|
148 QAction *hgInitAct;
|
jtkorhonen@0
|
149 QAction *hgCloneFromRemoteAct;
|
jtkorhonen@0
|
150 QAction *settingsAct;
|
jtkorhonen@0
|
151 QAction *exitAct;
|
jtkorhonen@0
|
152
|
jtkorhonen@33
|
153 //Repo actions
|
jtkorhonen@0
|
154 QAction *hgIncomingAct;
|
jtkorhonen@0
|
155 QAction *hgPushAct;
|
jtkorhonen@0
|
156 QAction *hgPullAct;
|
jtkorhonen@0
|
157 QAction *hgStatAct;
|
jtkorhonen@0
|
158 QAction *hgFileDiffAct;
|
jtkorhonen@0
|
159 QAction *hgFolderDiffAct;
|
jtkorhonen@0
|
160 QAction *hgChgSetDiffAct;
|
jtkorhonen@0
|
161 QAction *hgRevertAct;
|
jtkorhonen@0
|
162 QAction *hgAddAct;
|
jtkorhonen@0
|
163 QAction *hgRemoveAct;
|
jtkorhonen@0
|
164 QAction *hgUpdateAct;
|
jtkorhonen@0
|
165 QAction *hgCommitAct;
|
jtkorhonen@0
|
166 QAction *hgMergeAct;
|
jtkorhonen@33
|
167 QAction *hgRetryMergeAct;
|
jtkorhonen@0
|
168 QAction *hgUpdateToRevAct;
|
jtkorhonen@0
|
169 QAction *hgAnnotateAct;
|
jtkorhonen@0
|
170 QAction *hgResolveListAct;
|
jtkorhonen@0
|
171 QAction *hgResolveMarkAct;
|
jtkorhonen@34
|
172 QAction *hgTagAct;
|
jtkorhonen@34
|
173 QAction *hgIgnoreAct;
|
jtkorhonen@11
|
174 QAction *hgServeAct;
|
jtkorhonen@0
|
175
|
jtkorhonen@0
|
176 //Menus
|
jtkorhonen@0
|
177 QMenu *fileMenu;
|
jtkorhonen@0
|
178 QMenu *advancedMenu;
|
jtkorhonen@0
|
179 QMenu *helpMenu;
|
jtkorhonen@0
|
180
|
jtkorhonen@0
|
181 //Help menu actions
|
jtkorhonen@0
|
182 QAction *aboutAct;
|
jtkorhonen@0
|
183 QAction *aboutQtAct;
|
jtkorhonen@0
|
184
|
jtkorhonen@0
|
185 QToolBar *fileToolBar;
|
jtkorhonen@0
|
186 QToolBar *repoToolBar;
|
jtkorhonen@0
|
187 QToolBar *workFolderToolBar;
|
jtkorhonen@0
|
188
|
jtkorhonen@0
|
189 int timerId;
|
jtkorhonen@0
|
190 HGACTIONS runningAction;
|
jtkorhonen@0
|
191 HgRunner *runner;
|
jtkorhonen@0
|
192
|
jtkorhonen@33
|
193 int tabPage;
|
jtkorhonen@0
|
194 unsigned char initialFileTypesBits;
|
jtkorhonen@33
|
195 bool justMerged;
|
jtkorhonen@0
|
196 };
|
jtkorhonen@0
|
197
|
jtkorhonen@0
|
198 #endif
|