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@244
|
8 Copyright (c) 2011 Chris Cannam
|
Chris@244
|
9 Copyright (c) 2011 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 */
|
Chris@57
|
17
|
Chris@96
|
18 #ifndef HGTABWIDGET_H
|
Chris@96
|
19 #define HGTABWIDGET_H
|
jtkorhonen@0
|
20
|
Chris@43
|
21 #include "changeset.h"
|
jtkorhonen@0
|
22 #include "common.h"
|
Chris@92
|
23 #include "filestates.h"
|
jtkorhonen@0
|
24
|
Chris@50
|
25 #include <QMenu>
|
Chris@50
|
26 #include <QListWidget>
|
Chris@50
|
27 #include <QGroupBox>
|
Chris@50
|
28 #include <QVBoxLayout>
|
Chris@50
|
29 #include <QCheckBox>
|
Chris@50
|
30 #include <QLabel>
|
Chris@88
|
31 #include <QTabWidget>
|
Chris@86
|
32
|
Chris@88
|
33 class FileStatusWidget;
|
Chris@116
|
34 class HistoryWidget;
|
jtkorhonen@0
|
35
|
Chris@96
|
36 class HgTabWidget: public QTabWidget
|
jtkorhonen@0
|
37 {
|
jtkorhonen@0
|
38 Q_OBJECT
|
jtkorhonen@0
|
39
|
jtkorhonen@0
|
40 public:
|
Chris@96
|
41 HgTabWidget(QWidget *parent, QString remoteRepo, QString workFolderPath);
|
Chris@91
|
42
|
jtkorhonen@0
|
43 void updateWorkFolderFileList(QString fileList);
|
Chris@120
|
44
|
Chris@120
|
45 void setNewLog(QString hgLogList);
|
Chris@120
|
46 void addIncrementalLog(QString hgLogList);
|
Chris@120
|
47
|
jtkorhonen@0
|
48 void setWorkFolderAndRepoNames(QString workFolderPath, QString remoteRepoPath);
|
Chris@115
|
49 void setState(QString state);
|
jtkorhonen@0
|
50
|
Chris@153
|
51 void setCurrent(QStringList ids, QString branch);
|
Chris@128
|
52
|
Chris@230
|
53 void updateFileStates();
|
Chris@154
|
54 void updateHistory();
|
Chris@154
|
55
|
Chris@116
|
56 FileStates getFileStates() { return m_fileStates; }
|
Chris@90
|
57
|
Chris@163
|
58 bool canDiff() const;
|
Chris@90
|
59 bool canCommit() const;
|
Chris@109
|
60 bool canRevert() const;
|
Chris@92
|
61 bool canAdd() const;
|
Chris@92
|
62 bool canRemove() const;
|
Chris@163
|
63 bool canResolve() const;
|
Chris@172
|
64 bool haveChangesToCommit() const;
|
Chris@95
|
65
|
Chris@95
|
66 QStringList getAllSelectedFiles() const;
|
Chris@103
|
67
|
Chris@95
|
68 QStringList getSelectedCommittableFiles() const;
|
Chris@103
|
69 QStringList getAllCommittableFiles() const;
|
Chris@103
|
70
|
Chris@109
|
71 QStringList getSelectedRevertableFiles() const;
|
Chris@109
|
72 QStringList getAllRevertableFiles() const;
|
Chris@109
|
73
|
Chris@95
|
74 QStringList getSelectedAddableFiles() const;
|
Chris@103
|
75 QStringList getAllAddableFiles() const;
|
Chris@103
|
76
|
Chris@95
|
77 QStringList getSelectedRemovableFiles() const;
|
Chris@103
|
78 QStringList getAllRemovableFiles() const;
|
Chris@95
|
79
|
Chris@163
|
80 QStringList getSelectedUnresolvedFiles() const;
|
Chris@163
|
81 QStringList getAllUnresolvedFiles() const;
|
Chris@163
|
82
|
Chris@95
|
83 signals:
|
Chris@95
|
84 void selectionChanged();
|
Chris@199
|
85 void showAllChanged(bool);
|
jtkorhonen@0
|
86
|
Chris@141
|
87 void commit();
|
Chris@141
|
88 void revert();
|
Chris@141
|
89 void diffWorkingFolder();
|
Chris@168
|
90 void showSummary();
|
Chris@141
|
91
|
Chris@141
|
92 void updateTo(QString id);
|
Chris@148
|
93 void diffToParent(QString id, QString parent);
|
Chris@141
|
94 void diffToCurrent(QString id);
|
Chris@141
|
95 void mergeFrom(QString id);
|
Chris@278
|
96 void newBranch(QString id);
|
Chris@141
|
97 void tag(QString id);
|
Chris@141
|
98
|
Chris@94
|
99 public slots:
|
Chris@94
|
100 void clearSelections();
|
Chris@153
|
101 void showWorkTab();
|
Chris@153
|
102 void showHistoryTab();
|
Chris@94
|
103
|
jtkorhonen@0
|
104 private:
|
Chris@116
|
105 FileStatusWidget *m_fileStatusWidget;
|
Chris@116
|
106 HistoryWidget *m_historyWidget;
|
Chris@116
|
107 FileStates m_fileStates;
|
jtkorhonen@0
|
108
|
Chris@91
|
109 Changesets parseChangeSets(QString changeSetsStr);
|
jtkorhonen@0
|
110 };
|
jtkorhonen@0
|
111
|
Chris@96
|
112 #endif // HGTABWIDGET_H
|