jtkorhonen@0
|
1 /****************************************************************************
|
jtkorhonen@0
|
2 **
|
jtkorhonen@0
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
jtkorhonen@0
|
4 ** All rights reserved.
|
jtkorhonen@0
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
|
jtkorhonen@0
|
6 **
|
jtkorhonen@0
|
7 ** This file is part of the examples of the Qt Toolkit.
|
jtkorhonen@0
|
8 **
|
jtkorhonen@0
|
9 ** $QT_BEGIN_LICENSE:LGPL$
|
jtkorhonen@0
|
10 ** Commercial Usage
|
jtkorhonen@0
|
11 ** Licensees holding valid Qt Commercial licenses may use this file in
|
jtkorhonen@0
|
12 ** accordance with the Qt Commercial License Agreement provided with the
|
jtkorhonen@0
|
13 ** Software or, alternatively, in accordance with the terms contained in
|
jtkorhonen@0
|
14 ** a written agreement between you and Nokia.
|
jtkorhonen@0
|
15 **
|
jtkorhonen@0
|
16 ** GNU Lesser General Public License Usage
|
jtkorhonen@0
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
|
jtkorhonen@0
|
18 ** General Public License version 2.1 as published by the Free Software
|
jtkorhonen@0
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
|
jtkorhonen@0
|
20 ** packaging of this file. Please review the following information to
|
jtkorhonen@0
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
|
jtkorhonen@0
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
jtkorhonen@0
|
23 **
|
jtkorhonen@0
|
24 ** In addition, as a special exception, Nokia gives you certain additional
|
jtkorhonen@0
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
|
jtkorhonen@0
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
jtkorhonen@0
|
27 **
|
jtkorhonen@0
|
28 ** GNU General Public License Usage
|
jtkorhonen@0
|
29 ** Alternatively, this file may be used under the terms of the GNU
|
jtkorhonen@0
|
30 ** General Public License version 3.0 as published by the Free Software
|
jtkorhonen@0
|
31 ** Foundation and appearing in the file LICENSE.GPL included in the
|
jtkorhonen@0
|
32 ** packaging of this file. Please review the following information to
|
jtkorhonen@0
|
33 ** ensure the GNU General Public License version 3.0 requirements will be
|
jtkorhonen@0
|
34 ** met: http://www.gnu.org/copyleft/gpl.html.
|
jtkorhonen@0
|
35 **
|
jtkorhonen@0
|
36 ** If you have questions regarding the use of this file, please contact
|
jtkorhonen@0
|
37 ** Nokia at qt-info@nokia.com.
|
jtkorhonen@0
|
38 ** $QT_END_LICENSE$
|
jtkorhonen@0
|
39 **
|
jtkorhonen@0
|
40 ** Copyright (C) Jari Korhonen, 2010 (HgExplorer specific parts, under lgpl)
|
jtkorhonen@0
|
41 ****************************************************************************/
|
jtkorhonen@0
|
42
|
jtkorhonen@0
|
43 #ifndef MAINWINDOW_H
|
jtkorhonen@0
|
44 #define MAINWINDOW_H
|
jtkorhonen@0
|
45
|
jtkorhonen@0
|
46 #include <QMainWindow>
|
jtkorhonen@0
|
47
|
jtkorhonen@0
|
48 #include "hgexpwidget.h"
|
jtkorhonen@0
|
49 #include "hgrunner.h"
|
jtkorhonen@0
|
50 #include "common.h"
|
jtkorhonen@0
|
51
|
jtkorhonen@0
|
52 QT_BEGIN_NAMESPACE
|
jtkorhonen@0
|
53 class QAction;
|
jtkorhonen@0
|
54 class QMenu;
|
jtkorhonen@0
|
55 QT_END_NAMESPACE
|
jtkorhonen@0
|
56
|
jtkorhonen@0
|
57 enum HGACTIONS
|
jtkorhonen@0
|
58 {
|
jtkorhonen@0
|
59 ACT_NONE,
|
jtkorhonen@0
|
60 ACT_STAT,
|
jtkorhonen@0
|
61 ACT_HEADS,
|
jtkorhonen@0
|
62 ACT_PARENTS,
|
jtkorhonen@0
|
63 ACT_LOG,
|
jtkorhonen@0
|
64 ACT_REMOVE,
|
jtkorhonen@0
|
65 ACT_ADD,
|
jtkorhonen@0
|
66 ACT_INCOMING,
|
jtkorhonen@0
|
67 ACT_PUSH,
|
jtkorhonen@0
|
68 ACT_PULL,
|
jtkorhonen@0
|
69 ACT_CLONEFROMREMOTE,
|
jtkorhonen@0
|
70 ACT_INIT,
|
jtkorhonen@0
|
71 ACT_COMMIT,
|
jtkorhonen@0
|
72 ACT_ANNOTATE,
|
jtkorhonen@0
|
73 ACT_FILEDIFF,
|
jtkorhonen@0
|
74 ACT_FOLDERDIFF,
|
jtkorhonen@0
|
75 ACT_CHGSETDIFF,
|
jtkorhonen@0
|
76 ACT_UPDATE,
|
jtkorhonen@0
|
77 ACT_REVERT,
|
jtkorhonen@0
|
78 ACT_MERGE,
|
jtkorhonen@0
|
79 ACT_RESOLVE_LIST,
|
jtkorhonen@0
|
80 ACT_RESOLVE_MARK
|
jtkorhonen@0
|
81 };
|
jtkorhonen@0
|
82
|
jtkorhonen@0
|
83
|
jtkorhonen@0
|
84 class MainWindow : public QMainWindow
|
jtkorhonen@0
|
85 {
|
jtkorhonen@0
|
86 Q_OBJECT
|
jtkorhonen@0
|
87
|
jtkorhonen@0
|
88 public:
|
jtkorhonen@0
|
89 MainWindow();
|
jtkorhonen@0
|
90 HgExpWidget *hgExp;
|
jtkorhonen@0
|
91 void writeSettings();
|
jtkorhonen@0
|
92 void enableDisableActions();
|
jtkorhonen@0
|
93
|
jtkorhonen@0
|
94 //Paths to remote repo & workfolder
|
jtkorhonen@0
|
95 //Local repo is directory "./hg/" under work folder
|
jtkorhonen@0
|
96 QString remoteRepoPath;
|
jtkorhonen@0
|
97 QString workFolderPath;
|
jtkorhonen@0
|
98
|
jtkorhonen@0
|
99 //User info for commits
|
jtkorhonen@0
|
100 QString userInfo;
|
jtkorhonen@0
|
101 bool firstStart;
|
jtkorhonen@0
|
102
|
jtkorhonen@0
|
103 protected:
|
jtkorhonen@0
|
104 void closeEvent(QCloseEvent *event);
|
jtkorhonen@0
|
105 void timerEvent(QTimerEvent *event);
|
jtkorhonen@0
|
106
|
jtkorhonen@0
|
107 public slots:
|
jtkorhonen@0
|
108 void hgStat();
|
jtkorhonen@0
|
109 void tabChanged(int currTab);
|
jtkorhonen@0
|
110
|
jtkorhonen@0
|
111 private slots:
|
jtkorhonen@0
|
112 void about();
|
jtkorhonen@0
|
113 void hgRemove();
|
jtkorhonen@0
|
114 void hgAdd();
|
jtkorhonen@0
|
115 void hgCommit();
|
jtkorhonen@0
|
116 void hgFileDiff();
|
jtkorhonen@0
|
117 void hgFolderDiff();
|
jtkorhonen@0
|
118 void hgChgSetDiff();
|
jtkorhonen@0
|
119 void hgUpdate();
|
jtkorhonen@0
|
120 void hgRevert();
|
jtkorhonen@0
|
121 void hgMerge();
|
jtkorhonen@0
|
122 void settings();
|
jtkorhonen@0
|
123 void hgCloneFromRemote();
|
jtkorhonen@0
|
124 void hgInit();
|
jtkorhonen@0
|
125 void hgIncoming();
|
jtkorhonen@0
|
126 void hgPush();
|
jtkorhonen@0
|
127 void hgPull();
|
jtkorhonen@0
|
128 void hgUpdateToRev();
|
jtkorhonen@0
|
129 void hgAnnotate();
|
jtkorhonen@0
|
130 void hgResolveList();
|
jtkorhonen@0
|
131 void hgResolveMark();
|
jtkorhonen@0
|
132
|
jtkorhonen@0
|
133 private:
|
jtkorhonen@0
|
134 void hgHeads();
|
jtkorhonen@0
|
135 void hgParents();
|
jtkorhonen@0
|
136 void hgLog();
|
jtkorhonen@0
|
137 void createActions();
|
jtkorhonen@0
|
138 void connectActions();
|
jtkorhonen@0
|
139 void createMenus();
|
jtkorhonen@0
|
140 void createToolBars();
|
jtkorhonen@0
|
141 void createStatusBar();
|
jtkorhonen@0
|
142 void readSettings();
|
jtkorhonen@0
|
143 void splitChangeSets(QStringList *list, QString hgLogOutput);
|
jtkorhonen@0
|
144 int getCommitComment(QString& comment);
|
jtkorhonen@0
|
145 void presentLongStdoutToUser(QString stdo, int w, int h);
|
jtkorhonen@0
|
146 void countAMRModifications(QListWidget *workList, int& a, int& m, int& r);
|
jtkorhonen@0
|
147 bool isSelectedModified(QListWidget *workList);
|
jtkorhonen@0
|
148 bool isSelectedUntracked(QListWidget *workList);
|
jtkorhonen@0
|
149 bool isSelectedLocallyDeleted(QListWidget *workList);
|
jtkorhonen@0
|
150
|
jtkorhonen@0
|
151
|
jtkorhonen@0
|
152 //Actions enabled flags
|
jtkorhonen@0
|
153 bool remoteRepoActionsEnabled;
|
jtkorhonen@0
|
154 bool localRepoActionsEnabled;
|
jtkorhonen@0
|
155
|
jtkorhonen@0
|
156 //File menu actions
|
jtkorhonen@0
|
157 QAction *hgInitAct;
|
jtkorhonen@0
|
158 QAction *hgCloneFromRemoteAct;
|
jtkorhonen@0
|
159 QAction *settingsAct;
|
jtkorhonen@0
|
160 QAction *exitAct;
|
jtkorhonen@0
|
161
|
jtkorhonen@0
|
162 QAction *hgIncomingAct;
|
jtkorhonen@0
|
163 QAction *hgPushAct;
|
jtkorhonen@0
|
164 QAction *hgPullAct;
|
jtkorhonen@0
|
165 QAction *hgStatAct;
|
jtkorhonen@0
|
166 QAction *hgFileDiffAct;
|
jtkorhonen@0
|
167 QAction *hgFolderDiffAct;
|
jtkorhonen@0
|
168 QAction *hgChgSetDiffAct;
|
jtkorhonen@0
|
169 QAction *hgRevertAct;
|
jtkorhonen@0
|
170 QAction *hgAddAct;
|
jtkorhonen@0
|
171 QAction *hgRemoveAct;
|
jtkorhonen@0
|
172 QAction *hgUpdateAct;
|
jtkorhonen@0
|
173 QAction *hgCommitAct;
|
jtkorhonen@0
|
174 QAction *hgMergeAct;
|
jtkorhonen@0
|
175 QAction *hgUpdateToRevAct;
|
jtkorhonen@0
|
176 QAction *hgAnnotateAct;
|
jtkorhonen@0
|
177 QAction *hgResolveListAct;
|
jtkorhonen@0
|
178 QAction *hgResolveMarkAct;
|
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 int timerId;
|
jtkorhonen@0
|
194 HGACTIONS runningAction;
|
jtkorhonen@0
|
195 HgRunner *runner;
|
jtkorhonen@0
|
196
|
jtkorhonen@0
|
197 int tabPage;
|
jtkorhonen@0
|
198 unsigned char initialFileTypesBits;
|
jtkorhonen@0
|
199 };
|
jtkorhonen@0
|
200
|
jtkorhonen@0
|
201 #endif
|