Mercurial > hg > easyhg
annotate connectionitem.h @ 74:10eb97683aa9
* Show branch names even for changes with children, if those children are on a different branch
* Pick up remote repo path from local repo via hg paths
* Some work towards breaking down files into various groups based on status
* Add /usr/local/bin to path for hg (temporary hack I hope)
author | Chris Cannam |
---|---|
date | Fri, 19 Nov 2010 14:54:19 +0000 |
parents | f583e44d9d31 |
children | 644bd31e8301 |
rev | line source |
---|---|
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@57 | 8 Copyright (c) 2010 Chris Cannam |
Chris@57 | 9 Copyright (c) 2010 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@46 | 18 #ifndef CONNECTIONITEM_H |
Chris@46 | 19 #define CONNECTIONITEM_H |
Chris@46 | 20 |
Chris@46 | 21 #include <QGraphicsItem> |
Chris@46 | 22 |
Chris@46 | 23 class Connection; |
Chris@46 | 24 |
Chris@46 | 25 class ChangesetItem; |
Chris@46 | 26 |
Chris@46 | 27 class ConnectionItem : public QGraphicsItem |
Chris@46 | 28 { |
Chris@46 | 29 public: |
Chris@53 | 30 enum Type { |
Chris@53 | 31 Normal, |
Chris@53 | 32 Split, |
Chris@53 | 33 Merge |
Chris@53 | 34 }; |
Chris@53 | 35 |
Chris@53 | 36 ConnectionItem() : m_type(Normal), m_parent(0), m_child(0) { } |
Chris@46 | 37 |
Chris@46 | 38 virtual QRectF boundingRect() const; |
Chris@46 | 39 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); |
Chris@46 | 40 |
Chris@53 | 41 Type connectionType() const { return m_type; } |
Chris@53 | 42 void setConnectionType(Type t) { m_type = t; } |
Chris@53 | 43 |
Chris@46 | 44 //!!! deletion signals from parent/child |
Chris@46 | 45 |
Chris@46 | 46 ChangesetItem *parent() { return m_parent; } |
Chris@46 | 47 ChangesetItem *child() { return m_child; } |
Chris@46 | 48 |
Chris@46 | 49 void setParent(ChangesetItem *p) { m_parent = p; } |
Chris@46 | 50 void setChild(ChangesetItem *c) { m_child = c; } |
Chris@46 | 51 |
Chris@46 | 52 private: |
Chris@53 | 53 Type m_type; |
Chris@46 | 54 ChangesetItem *m_parent; |
Chris@46 | 55 ChangesetItem *m_child; |
Chris@46 | 56 }; |
Chris@46 | 57 |
Chris@46 | 58 #endif // CONNECTIONITEM_H |