comparison changesetscene.cpp @ 119:005a54380502

* Make scene remember which item has its details showing, and remove the previous one when a new one is clicked
author Chris Cannam
date Sun, 28 Nov 2010 21:52:00 +0000
parents
children 1f27f71a7034
comparison
equal deleted inserted replaced
118:9734fb0d6fff 119:005a54380502
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) 2010 Chris Cannam
9 Copyright (c) 2010 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 #include "changesetscene.h"
19 #include "changesetitem.h"
20
21 ChangesetScene::ChangesetScene()
22 : QGraphicsScene(), m_detailShown(0)
23 {
24 }
25
26 void
27 ChangesetScene::changesetDetailShown()
28 {
29 ChangesetItem *csi = qobject_cast<ChangesetItem *>(sender());
30 if (!csi) return;
31
32 if (m_detailShown) {
33 m_detailShown->hideDetail();
34 }
35 m_detailShown = csi;
36 }
37