comparison src/uncommitteditem.h @ 370:b9c153e00e84

Move source files to src/
author Chris Cannam
date Thu, 24 Mar 2011 10:27:51 +0000
parents uncommitteditem.h@4811eb34e819
children b1f0fa991c49
comparison
equal deleted inserted replaced
369:19cce6d2c470 370:b9c153e00e84
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 EasyMercurial
5
6 Based on HgExplorer by Jari Korhonen
7 Copyright (c) 2010 Jari Korhonen
8 Copyright (c) 2011 Chris Cannam
9 Copyright (c) 2011 Queen Mary, University of London
10
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version. See the file
15 COPYING included with this distribution for more information.
16 */
17
18 #ifndef UNCOMMITTEDITEM_H
19 #define UNCOMMITTEDITEM_H
20
21 #include <QGraphicsObject>
22 #include <QFont>
23
24 class UncommittedItem : public QGraphicsObject
25 {
26 Q_OBJECT
27
28 public:
29 UncommittedItem();
30
31 virtual QRectF boundingRect() const;
32 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
33
34 QString branch() const { return m_branch; }
35 void setBranch(QString b) { m_branch = b; }
36
37 bool showBranch() const { return m_showBranch; }
38 void setShowBranch(bool s) { m_showBranch = s; }
39
40 bool isNewBranch() const { return m_isNewBranch; }
41 void setIsNewBranch(bool s) { m_isNewBranch = s; }
42
43 int column() const { return m_column; }
44 int row() const { return m_row; }
45 void setColumn(int c) { m_column = c; setX(c * 100); }
46 void setRow(int r) { m_row = r; setY(r * 90); }
47
48 bool isWide() const { return m_wide; }
49 void setWide(bool w) { m_wide = w; }
50
51 signals:
52 void commit();
53 void revert();
54 void diff();
55 void showSummary();
56 void showWork();
57 void newBranch();
58 void noBranch();
59
60 protected:
61 virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
62 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
63
64 private:
65 void activateMenu();
66
67 QString m_branch;
68 bool m_showBranch;
69 bool m_isNewBranch;
70 QFont m_font;
71 int m_column;
72 int m_row;
73 bool m_wide;
74 };
75
76 #endif // UNCOMMITTEDITEM_H