-void ChatMonitorView::contextMenuEvent(QContextMenuEvent *event) {
- QMenu contextMenu(this);
-
- QAction *showOwnNicksAction = contextMenu.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)));
- 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)));
- showBufferAction->setCheckable(true);
- showBufferAction->setChecked(_filter->showFields() & ChatMonitorFilter::BufferField);
- showBufferAction->setData(ChatMonitorFilter::BufferField);
- }
-
- contextMenu.exec(QCursor::pos());
+void ChatMonitorView::addActionsToMenu(QMenu* menu, const QPointF& pos)
+{
+ ChatView::addActionsToMenu(menu, pos);
+ menu->addSeparator();
+ auto showOwnNicksAction = new Action(tr("Show Own Messages"), menu, _filter, &ChatMonitorFilter::setShowOwnMessages);
+ showOwnNicksAction->setCheckable(true);
+ showOwnNicksAction->setChecked(_filter->showOwnMessages());
+ menu->addAction(showOwnNicksAction);
+
+ if (scene()->columnByScenePos(pos) == ChatLineModel::SenderColumn) {
+ menu->addSeparator();
+
+ auto showNetworkAction = new Action(tr("Show Network Name"), menu, this, &ChatMonitorView::showFieldsChanged);
+ showNetworkAction->setCheckable(true);
+ showNetworkAction->setChecked(_filter->showFields() & ChatMonitorFilter::NetworkField);
+ showNetworkAction->setData(ChatMonitorFilter::NetworkField);
+ menu->addAction(showNetworkAction);
+
+ auto showBufferAction = new Action(tr("Show Buffer Name"), menu, this, &ChatMonitorView::showFieldsChanged);
+ showBufferAction->setCheckable(true);
+ showBufferAction->setChecked(_filter->showFields() & ChatMonitorFilter::BufferField);
+ showBufferAction->setData(ChatMonitorFilter::BufferField);
+ menu->addAction(showBufferAction);
+ }
+
+ menu->addSeparator();
+ menu->addAction(new Action(icon::get("configure"), tr("Configure..."), menu, this, &ChatMonitorView::showSettingsPage));