Mercurial > hg > easyhg
comparison src/changesetitem.cpp @ 474:8bdc8f27d19c
Use contextMenuEvent instead of right-click in mousePressEvent to call up changeset item context menu. Appears to fix #201, though I'm cautious as I don't understand the reason
author | Chris Cannam |
---|---|
date | Tue, 26 Jul 2011 13:41:56 +0100 |
parents | e43fc86506d1 |
children | 470829a21f98 |
comparison
equal
deleted
inserted
replaced
472:2d57b81671de | 474:8bdc8f27d19c |
---|---|
99 if (m_detail) { | 99 if (m_detail) { |
100 hideDetail(); | 100 hideDetail(); |
101 } else { | 101 } else { |
102 showDetail(); | 102 showDetail(); |
103 } | 103 } |
104 } else if (e->button() == Qt::RightButton) { | 104 } |
105 if (m_detail) { | 105 } |
106 hideDetail(); | 106 |
107 } | 107 void |
108 activateMenu(); | 108 ChangesetItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *) |
109 } | 109 { |
110 } | 110 if (m_detail) { |
111 | 111 hideDetail(); |
112 void | 112 } |
113 ChangesetItem::activateMenu() | 113 |
114 { | |
115 m_parentDiffActions.clear(); | 114 m_parentDiffActions.clear(); |
116 m_summaryActions.clear(); | 115 m_summaryActions.clear(); |
117 | 116 |
118 QMenu *menu = new QMenu; | 117 QMenu *menu = new QMenu; |
119 QLabel *label = new QLabel(tr("<qt><b> Revision: </b>%1</qt>") | 118 QLabel *label = new QLabel(tr("<qt><b> Revision: </b>%1</qt>") |
199 connect(branch, SIGNAL(triggered()), this, SLOT(newBranchActivated())); | 198 connect(branch, SIGNAL(triggered()), this, SLOT(newBranchActivated())); |
200 | 199 |
201 QAction *tag = menu->addAction(tr("Add tag...")); | 200 QAction *tag = menu->addAction(tr("Add tag...")); |
202 connect(tag, SIGNAL(triggered()), this, SLOT(tagActivated())); | 201 connect(tag, SIGNAL(triggered()), this, SLOT(tagActivated())); |
203 | 202 |
203 ungrabMouse(); | |
204 | |
204 menu->exec(QCursor::pos()); | 205 menu->exec(QCursor::pos()); |
205 | |
206 ungrabMouse(); | |
207 } | 206 } |
208 | 207 |
209 void | 208 void |
210 ChangesetItem::copyIdActivated() | 209 ChangesetItem::copyIdActivated() |
211 { | 210 { |