X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatmonitorview.cpp;h=6e0077820d739966cb109af60f8191726e753d1e;hb=aa7841638c6537034102da959cad8c36853bf280;hp=5ab9df791709c9c383eae7807047f74082f03158;hpb=c1897d61797312f46af801c22c9ab62063d3540d;p=quassel.git diff --git a/src/qtui/chatmonitorview.cpp b/src/qtui/chatmonitorview.cpp index 5ab9df79..6e007782 100644 --- a/src/qtui/chatmonitorview.cpp +++ b/src/qtui/chatmonitorview.cpp @@ -41,32 +41,30 @@ ChatMonitorView::ChatMonitorView(ChatMonitorFilter *filter, QWidget *parent) scene()->setSenderCutoffMode(ChatScene::CutoffLeft); } -void ChatMonitorView::contextMenuEvent(QContextMenuEvent *event) { - QMenu contextMenu(this); - - QAction *showOwnNicksAction = contextMenu.addAction(tr("Show own messages"), _filter, SLOT(setShowOwnMessages(bool))); +void ChatMonitorView::addActionsToMenu(QMenu *menu, const QPointF &pos) { + ChatView::addActionsToMenu(menu, pos); + menu->addSeparator(); + QAction *showOwnNicksAction = menu->addAction(tr("Show Own Messages"), _filter, SLOT(setShowOwnMessages(bool))); showOwnNicksAction->setCheckable(true); showOwnNicksAction->setChecked(_filter->showOwnMessages()); - - if(scene()->sectionByScenePos(event->pos()) == ChatLineModel::SenderColumn) { - contextMenu.addSeparator(); - QAction *showNetworkAction = contextMenu.addAction(tr("Show network name"), this, SLOT(showFieldsChanged(bool))); + if(scene()->columnByScenePos(pos) == ChatLineModel::SenderColumn) { + menu->addSeparator(); + + QAction *showNetworkAction = menu->addAction(tr("Show Network Name"), this, SLOT(showFieldsChanged(bool))); showNetworkAction->setCheckable(true); showNetworkAction->setChecked(_filter->showFields() & ChatMonitorFilter::NetworkField); showNetworkAction->setData(ChatMonitorFilter::NetworkField); - QAction *showBufferAction = contextMenu.addAction(tr("Show buffer name"), this, SLOT(showFieldsChanged(bool))); + QAction *showBufferAction = menu->addAction(tr("Show Buffer Name"), this, SLOT(showFieldsChanged(bool))); showBufferAction->setCheckable(true); showBufferAction->setChecked(_filter->showFields() & ChatMonitorFilter::BufferField); showBufferAction->setData(ChatMonitorFilter::BufferField); } - - contextMenu.exec(QCursor::pos()); } void ChatMonitorView::mouseDoubleClickEvent(QMouseEvent *event) { - if(scene()->sectionByScenePos(event->pos()) != ChatLineModel::SenderColumn) { + if(scene()->columnByScenePos(event->pos()) != ChatLineModel::SenderColumn) { ChatView::mouseDoubleClickEvent(event); return; }