Chris@129
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@129
|
2
|
Chris@129
|
3 /*
|
Chris@129
|
4 EasyMercurial
|
Chris@129
|
5
|
Chris@129
|
6 Based on HgExplorer by Jari Korhonen
|
Chris@129
|
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@129
|
10
|
Chris@129
|
11 This program is free software; you can redistribute it and/or
|
Chris@129
|
12 modify it under the terms of the GNU General Public License as
|
Chris@129
|
13 published by the Free Software Foundation; either version 2 of the
|
Chris@129
|
14 License, or (at your option) any later version. See the file
|
Chris@129
|
15 COPYING included with this distribution for more information.
|
Chris@129
|
16 */
|
Chris@129
|
17
|
Chris@129
|
18 #ifndef UNCOMMITTEDITEM_H
|
Chris@129
|
19 #define UNCOMMITTEDITEM_H
|
Chris@129
|
20
|
Chris@168
|
21 #include <QGraphicsObject>
|
Chris@129
|
22 #include <QFont>
|
Chris@129
|
23
|
Chris@168
|
24 class UncommittedItem : public QGraphicsObject
|
Chris@129
|
25 {
|
Chris@129
|
26 Q_OBJECT
|
Chris@129
|
27
|
Chris@129
|
28 public:
|
Chris@129
|
29 UncommittedItem();
|
Chris@129
|
30
|
Chris@129
|
31 virtual QRectF boundingRect() const;
|
Chris@129
|
32 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
|
Chris@129
|
33
|
Chris@129
|
34 QString branch() const { return m_branch; }
|
Chris@129
|
35 void setBranch(QString b) { m_branch = b; }
|
Chris@153
|
36
|
Chris@153
|
37 bool showBranch() const { return m_showBranch; }
|
Chris@153
|
38 void setShowBranch(bool s) { m_showBranch = s; }
|
Chris@129
|
39
|
Chris@129
|
40 int column() const { return m_column; }
|
Chris@129
|
41 int row() const { return m_row; }
|
Chris@129
|
42 void setColumn(int c) { m_column = c; setX(c * 100); }
|
Chris@129
|
43 void setRow(int r) { m_row = r; setY(r * 90); }
|
Chris@129
|
44
|
Chris@129
|
45 bool isWide() const { return m_wide; }
|
Chris@129
|
46 void setWide(bool w) { m_wide = w; }
|
Chris@129
|
47
|
Chris@141
|
48 signals:
|
Chris@141
|
49 void commit();
|
Chris@141
|
50 void revert();
|
Chris@141
|
51 void diff();
|
Chris@168
|
52 void showSummary();
|
Chris@153
|
53 void showWork();
|
Chris@141
|
54
|
Chris@141
|
55 protected:
|
Chris@141
|
56 virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
|
Chris@153
|
57 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
|
Chris@141
|
58
|
Chris@129
|
59 private:
|
Chris@141
|
60 void activateMenu();
|
Chris@141
|
61
|
Chris@129
|
62 QString m_branch;
|
Chris@153
|
63 bool m_showBranch;
|
Chris@129
|
64 QFont m_font;
|
Chris@129
|
65 int m_column;
|
Chris@129
|
66 int m_row;
|
Chris@129
|
67 bool m_wide;
|
Chris@129
|
68 };
|
Chris@129
|
69
|
Chris@129
|
70 #endif // UNCOMMITTEDITEM_H
|