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 | |
parent | 190efa67c6f141b4707facdc2a176bce023323f4 (diff) | |
download | swift-contrib-ba81a3d454db0abd0b8e00a34a9da3b720af454f.zip swift-contrib-ba81a3d454db0abd0b8e00a34a9da3b720af454f.tar.bz2 |
Remove Edit entry from MUC roster context menu.
Resolves: #766
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 1 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.cpp | 5 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.h | 3 |
3 files changed, 8 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index 3e314e5..f056a1d 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -48,6 +48,7 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt logRosterSplitter->addWidget(messageLog_); treeWidget_ = new QtTreeWidget(eventStream_); + treeWidget_->setEditable(false); treeWidget_->hide(); logRosterSplitter->addWidget(treeWidget_); logRosterSplitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 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_; }; } |