X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatmonitorview.cpp;h=07facb59ae072ffd793c31d3dec1db1d0f010225;hp=a844e7372c4881555860fe789cb810339b3dbfb9;hb=f9efdde7f3a6004af8f834c409cfa6ae1d877692;hpb=1cb02004ee5973b89368bd84f234d4652794690d diff --git a/src/qtui/chatmonitorview.cpp b/src/qtui/chatmonitorview.cpp index a844e737..07facb59 100644 --- a/src/qtui/chatmonitorview.cpp +++ b/src/qtui/chatmonitorview.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,29 +21,33 @@ #include "chatmonitorview.h" #include -#include #include #include +#include "action.h" +#include "buffermodel.h" #include "chatmonitorfilter.h" #include "chatlinemodel.h" #include "chatitem.h" #include "chatscene.h" #include "client.h" +#include "clientignorelistmanager.h" +#include "icon.h" #include "networkmodel.h" -#include "buffermodel.h" #include "messagemodel.h" #include "qtuisettings.h" #include "settingspagedlg.h" #include "settingspages/chatmonitorsettingspage.h" -#include "clientignorelistmanager.h" ChatMonitorView::ChatMonitorView(ChatMonitorFilter *filter, QWidget *parent) : ChatView(filter, parent), _filter(filter) { scene()->setSenderCutoffMode(ChatScene::CutoffLeft); - connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool))); + // The normal message prefixes get replaced by the network and buffer name. Re-add brackets for + // all message types. + scene()->setAlwaysBracketSender(true); + connect(Client::instance(), &Client::coreConnectionStateChanged, this, &ChatMonitorView::coreConnectionStateChanged); } @@ -51,26 +55,29 @@ 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))); + 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(); - QAction *showNetworkAction = menu->addAction(tr("Show Network Name"), this, SLOT(showFieldsChanged(bool))); + 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); - QAction *showBufferAction = menu->addAction(tr("Show Buffer Name"), this, SLOT(showFieldsChanged(bool))); + 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(QIcon::fromTheme("configure"), tr("Configure..."), this, SLOT(showSettingsPage())); + menu->addAction(new Action(icon::get("configure"), tr("Configure..."), menu, this, &ChatMonitorView::showSettingsPage)); } @@ -98,7 +105,7 @@ void ChatMonitorView::mouseDoubleClickEvent(QMouseEvent *event) void ChatMonitorView::showFieldsChanged(bool checked) { - QAction *showAction = qobject_cast(sender()); + auto *showAction = qobject_cast(sender()); if (!showAction) return; @@ -121,5 +128,5 @@ void ChatMonitorView::showSettingsPage() void ChatMonitorView::coreConnectionStateChanged(bool connected) { if (connected) - connect(Client::ignoreListManager(), SIGNAL(ignoreListChanged()), _filter, SLOT(invalidateFilter())); + connect(Client::ignoreListManager(), &ClientIgnoreListManager::ignoreListChanged, _filter, &ChatMonitorFilter::invalidateFilter); }