Chris@116
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@116
|
2
|
Chris@116
|
3 /*
|
Chris@116
|
4 EasyMercurial
|
Chris@116
|
5
|
Chris@116
|
6 Based on HgExplorer by Jari Korhonen
|
Chris@116
|
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@116
|
10
|
Chris@116
|
11 This program is free software; you can redistribute it and/or
|
Chris@116
|
12 modify it under the terms of the GNU General Public License as
|
Chris@116
|
13 published by the Free Software Foundation; either version 2 of the
|
Chris@116
|
14 License, or (at your option) any later version. See the file
|
Chris@116
|
15 COPYING included with this distribution for more information.
|
Chris@116
|
16 */
|
Chris@116
|
17
|
Chris@116
|
18 #ifndef HISTORYWIDGET_H
|
Chris@116
|
19 #define HISTORYWIDGET_H
|
Chris@116
|
20
|
Chris@116
|
21 #include "changeset.h"
|
Chris@116
|
22
|
Chris@116
|
23 #include <QWidget>
|
Chris@133
|
24 #include <QSet>
|
Chris@513
|
25 #include <QCheckBox>
|
Chris@116
|
26
|
Chris@116
|
27 class Panned;
|
Chris@116
|
28 class Panner;
|
Chris@129
|
29 class UncommittedItem;
|
Chris@145
|
30 class QGraphicsScene;
|
Chris@116
|
31
|
Chris@116
|
32 class HistoryWidget : public QWidget
|
Chris@116
|
33 {
|
Chris@116
|
34 Q_OBJECT
|
Chris@116
|
35
|
Chris@116
|
36 public:
|
Chris@116
|
37 HistoryWidget();
|
Chris@116
|
38 virtual ~HistoryWidget();
|
Chris@116
|
39
|
Chris@153
|
40 void setCurrent(QStringList ids, QString branch, bool showUncommitted);
|
Chris@505
|
41 void setShowUncommitted(bool showUncommitted);
|
Chris@128
|
42
|
Chris@506
|
43 void setClosedHeadIds(QSet<QString> closed);
|
Chris@506
|
44
|
Chris@120
|
45 void parseNewLog(QString log);
|
Chris@120
|
46 void parseIncrementalLog(QString log);
|
Chris@134
|
47
|
Chris@134
|
48 bool haveNewItems() const { return !m_newIds.empty(); }
|
Chris@141
|
49
|
Chris@154
|
50 void update();
|
Chris@154
|
51
|
Chris@141
|
52 signals:
|
Chris@141
|
53 void commit();
|
Chris@141
|
54 void revert();
|
Chris@141
|
55 void diffWorkingFolder();
|
Chris@168
|
56 void showSummary();
|
Chris@153
|
57 void showWork();
|
Chris@311
|
58 void newBranch();
|
Chris@311
|
59 void noBranch();
|
Chris@141
|
60
|
Chris@141
|
61 void updateTo(QString id);
|
Chris@148
|
62 void diffToParent(QString id, QString parent);
|
Chris@289
|
63 void showSummary(Changeset *);
|
Chris@141
|
64 void diffToCurrent(QString id);
|
Chris@141
|
65 void mergeFrom(QString id);
|
Chris@278
|
66 void newBranch(QString id);
|
Chris@514
|
67 void closeBranch(QString id);
|
Chris@141
|
68 void tag(QString id);
|
Chris@513
|
69
|
Chris@513
|
70 private slots:
|
Chris@513
|
71 void showClosedChanged(bool);
|
Chris@116
|
72
|
Chris@116
|
73 private:
|
Chris@116
|
74 Changesets m_changesets;
|
Chris@128
|
75 QStringList m_currentIds;
|
Chris@153
|
76 QString m_currentBranch;
|
Chris@133
|
77 QSet<QString> m_newIds;
|
Chris@506
|
78 QSet<QString> m_closedIds;
|
Chris@145
|
79 bool m_showUncommitted;
|
Chris@154
|
80 bool m_refreshNeeded;
|
Chris@116
|
81
|
Chris@116
|
82 Panned *m_panned;
|
Chris@116
|
83 Panner *m_panner;
|
Chris@513
|
84 QCheckBox *m_showClosedBranches;
|
Chris@116
|
85
|
Chris@145
|
86 QGraphicsScene *scene();
|
Chris@116
|
87 void clearChangesets();
|
Chris@133
|
88 void replaceChangesets(Changesets);
|
Chris@133
|
89 void addChangesets(Changesets);
|
Chris@120
|
90 void layoutAll();
|
Chris@122
|
91 void setChangesetParents();
|
Chris@133
|
92 void updateNewAndCurrentItems();
|
Chris@141
|
93 void connectSceneSignals();
|
Chris@116
|
94 };
|
Chris@116
|
95
|
Chris@116
|
96 #endif
|