/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "chatitem.h"
#include "chatscene.h"
#include "client.h"
+#include "iconloader.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)));
}
void ChatMonitorView::addActionsToMenu(QMenu *menu, const QPointF &pos) {
showBufferAction->setChecked(_filter->showFields() & ChatMonitorFilter::BufferField);
showBufferAction->setData(ChatMonitorFilter::BufferField);
}
+
+ menu->addSeparator();
+ menu->addAction(SmallIcon("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
}
void ChatMonitorView::mouseDoubleClickEvent(QMouseEvent *event) {
return;
}
- ChatItem *chatItem = dynamic_cast<ChatItem *>(itemAt(event->pos()));
+ ChatItem *chatItem = scene()->chatItemAt(mapToScene(event->pos()));
if(!chatItem) {
event->ignore();
return;
else
_filter->removeShowField(showAction->data().toInt());
}
+
+void ChatMonitorView::showSettingsPage() {
+ SettingsPageDlg dlg(new ChatMonitorSettingsPage(), this);
+ dlg.exec();
+}
+
+// connect only after client is synced to core since ChatMonitorView is created before
+// the ignoreListManager
+void ChatMonitorView::coreConnectionStateChanged(bool connected) {
+ if(connected)
+ connect(Client::ignoreListManager(), SIGNAL(ignoreListChanged()), _filter, SLOT(invalidateFilter()));
+}