diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-21 20:17:56 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-21 20:17:56 (GMT) |
commit | ba81a3d454db0abd0b8e00a34a9da3b720af454f (patch) | |
tree | d6ea35f19de50ec616fb4da766112efab41243e3 /Swift/QtUI/Roster | |
parent | 190efa67c6f141b4707facdc2a176bce023323f4 (diff) | |
download | swift-ba81a3d454db0abd0b8e00a34a9da3b720af454f.zip swift-ba81a3d454db0abd0b8e00a34a9da3b720af454f.tar.bz2 |
Remove Edit entry from MUC roster context menu.
Resolves: #766
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.cpp | 5 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidget.cpp b/Swift/QtUI/Roster/QtTreeWidget.cpp index 963ce72..e88e1bb 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.cpp +++ b/Swift/QtUI/Roster/QtTreeWidget.cpp @@ -22,7 +22,7 @@ namespace Swift { -QtTreeWidget::QtTreeWidget(UIEventStream* eventStream, QWidget* parent) : QTreeView(parent) { +QtTreeWidget::QtTreeWidget(UIEventStream* eventStream, QWidget* parent) : QTreeView(parent), editable_(false) { eventStream_ = eventStream; model_ = new RosterModel(this); setModel(model_); @@ -76,6 +76,9 @@ void QtTreeWidget::handleItemActivated(const QModelIndex& index) { } void QtTreeWidget::contextMenuEvent(QContextMenuEvent* event) { + if (!editable_) { + return; + } QModelIndex index = indexAt(event->pos()); if (!index.isValid()) { return; diff --git a/Swift/QtUI/Roster/QtTreeWidget.h b/Swift/QtUI/Roster/QtTreeWidget.h index 3430f7e..ce2351b 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.h +++ b/Swift/QtUI/Roster/QtTreeWidget.h @@ -23,6 +23,8 @@ class QtTreeWidget : public QTreeView{ QtTreeWidgetItem* getRoot(); void setRosterModel(Roster* roster); Roster* getRoster() {return roster_;} + void setEditable(bool b) { editable_ = b; } + private slots: void handleItemActivated(const QModelIndex&); void handleModelItemExpanded(const QModelIndex&, bool expanded); @@ -39,6 +41,7 @@ class QtTreeWidget : public QTreeView{ RosterDelegate* delegate_; QtTreeWidgetItem* treeRoot_; UIEventStream* eventStream_; + bool editable_; }; } |