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@116
|
25
|
Chris@116
|
26 class Panned;
|
Chris@116
|
27 class Panner;
|
Chris@129
|
28 class UncommittedItem;
|
Chris@145
|
29 class QGraphicsScene;
|
Chris@116
|
30
|
Chris@116
|
31 class HistoryWidget : public QWidget
|
Chris@116
|
32 {
|
Chris@116
|
33 Q_OBJECT
|
Chris@116
|
34
|
Chris@116
|
35 public:
|
Chris@116
|
36 HistoryWidget();
|
Chris@116
|
37 virtual ~HistoryWidget();
|
Chris@116
|
38
|
Chris@153
|
39 void setCurrent(QStringList ids, QString branch, bool showUncommitted);
|
Chris@128
|
40
|
Chris@120
|
41 void parseNewLog(QString log);
|
Chris@120
|
42 void parseIncrementalLog(QString log);
|
Chris@134
|
43
|
Chris@134
|
44 bool haveNewItems() const { return !m_newIds.empty(); }
|
Chris@141
|
45
|
Chris@154
|
46 void update();
|
Chris@154
|
47
|
Chris@141
|
48 signals:
|
Chris@141
|
49 void commit();
|
Chris@141
|
50 void revert();
|
Chris@141
|
51 void diffWorkingFolder();
|
Chris@168
|
52 void showSummary();
|
Chris@153
|
53 void showWork();
|
Chris@311
|
54 void newBranch();
|
Chris@311
|
55 void noBranch();
|
Chris@141
|
56
|
Chris@141
|
57 void updateTo(QString id);
|
Chris@148
|
58 void diffToParent(QString id, QString parent);
|
Chris@289
|
59 void showSummary(Changeset *);
|
Chris@141
|
60 void diffToCurrent(QString id);
|
Chris@141
|
61 void mergeFrom(QString id);
|
Chris@278
|
62 void newBranch(QString id);
|
Chris@141
|
63 void tag(QString id);
|
Chris@116
|
64
|
Chris@116
|
65 private:
|
Chris@116
|
66 Changesets m_changesets;
|
Chris@128
|
67 QStringList m_currentIds;
|
Chris@153
|
68 QString m_currentBranch;
|
Chris@133
|
69 QSet<QString> m_newIds;
|
Chris@145
|
70 bool m_showUncommitted;
|
Chris@154
|
71 bool m_refreshNeeded;
|
Chris@116
|
72
|
Chris@116
|
73 Panned *m_panned;
|
Chris@116
|
74 Panner *m_panner;
|
Chris@116
|
75
|
Chris@145
|
76 QGraphicsScene *scene();
|
Chris@116
|
77 void clearChangesets();
|
Chris@133
|
78 void replaceChangesets(Changesets);
|
Chris@133
|
79 void addChangesets(Changesets);
|
Chris@120
|
80 void layoutAll();
|
Chris@122
|
81 void setChangesetParents();
|
Chris@133
|
82 void updateNewAndCurrentItems();
|
Chris@141
|
83 void connectSceneSignals();
|
Chris@116
|
84 };
|
Chris@116
|
85
|
Chris@116
|
86 #endif
|