#include "mainwin.h"
#include "aboutdlg.h"
-#include "chatwidget.h"
#include "bufferview.h"
#include "bufferviewconfig.h"
#include "bufferviewfilter.h"
#include "bufferviewmanager.h"
#include "channellistdlg.h"
+#include "chatmonitorfilter.h"
+#include "chatview.h"
#include "client.h"
#include "clientbacklogmanager.h"
#include "coreinfodlg.h"
{
UiSettings uiSettings;
loadTranslation(uiSettings.value("Locale", QLocale::system()).value<QLocale>());
-
+
QString style = uiSettings.value("Style", QString("")).toString();
if(style != "") {
QApplication::setStyle(style);
}
-
+
ui.setupUi(this);
setWindowTitle("Quassel IRC");
setWindowIcon(offlineTrayIcon);
// restore mainwin state
restoreState(s.value("MainWinState").toByteArray());
- // restore locked state of docks
+ // restore locked state of docks
ui.actionLockDockPositions->setChecked(s.value("LockDocks", false).toBool());
-
+
setDisconnectedState(); // Disable menus and stuff
showCoreConnectionDlg(true); // autoconnect if appropriate
view->show();
connect(&view->showChannelList, SIGNAL(triggered()), this, SLOT(showChannelList()));
-
+
Client::bufferModel()->synchronizeView(view);
dock->setWidget(view);
}
void MainWin::setupChatMonitor() {
-#ifndef SPUTDEV
VerticalDock *dock = new VerticalDock(tr("Chat Monitor"), this);
dock->setObjectName("ChatMonitorDock");
- ChatWidget *chatWidget = new ChatWidget(0, this);
- chatWidget->show();
- dock->setWidget(chatWidget);
+ ChatMonitorFilter *filter = new ChatMonitorFilter(Client::messageModel(), this);
+ ChatView *chatView = new ChatView(filter, this);
+ chatView->show();
+ dock->setWidget(chatView);
dock->show();
- Buffer *buf = Client::monitorBuffer();
- if(!buf)
- return;
-
- chatWidget->setContents(buf->contents());
- connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));
- connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), chatWidget, SLOT(prependMsg(AbstractUiMsg *)));
-
addDockWidget(Qt::TopDockWidgetArea, dock, Qt::Vertical);
ui.menuViews->addAction(dock->toggleViewAction());
-#endif /* SPUTDEV */
}
void MainWin::setupInputWidget() {
UiSettings uiSettings;
-#ifndef SPUTDEV
bool displayBubble = uiSettings.value("NotificationBubble", QVariant(true)).toBool();
bool displayDesktop = uiSettings.value("NotificationDesktop", QVariant(true)).toBool();
if(displayBubble || displayDesktop) {
- // FIXME don't invoke style engine for this!
- QString text = QtUi::style()->styleString(Message::mircToInternal(msg.contents())).plainText;
- if(displayBubble) displayTrayIconMessage(title, text);
+ if(uiSettings.value("DisplayPopupMessages", QVariant(true)).toBool()) {
+ // FIXME don't invoke style engine for this!
+ QString text = QtUi::style()->styleString(msg.contents()).plainText;
+ if(displayBubble) displayTrayIconMessage(title, text);
# ifdef HAVE_DBUS
- if(displayDesktop) sendDesktopNotification(title, text);
+ if(displayDesktop) sendDesktopNotification(title, text);
# endif
- }
-#endif
- if(uiSettings.value("AnimateTrayIcon", QVariant(true)).toBool()) {
- QApplication::alert(this);
- setTrayIconActivity(true);
+ }
+ if(uiSettings.value("AnimateTrayIcon", QVariant(true)).toBool()) {
+ QApplication::alert(this);
+ setTrayIconActivity(true);
+ }
}
}
}
QAction *action = findChild<QAction *>(QString("NetworkAction-%1").arg(id.toInt()));
if(!action)
return;
-
+
action->deleteLater();
}
else net->requestDisconnect();
}
+
+
+void MainWin::on_actionDebugNetworkModel_triggered(bool) {
+ QTreeView *view = new QTreeView;
+ view->setAttribute(Qt::WA_DeleteOnClose);
+ view->setWindowTitle("Debug NetworkModel View");
+ view->setModel(Client::networkModel());
+ view->setColumnWidth(0, 250);
+ view->setColumnWidth(1, 250);
+ view->setColumnWidth(2, 80);
+ view->resize(610, 300);
+ view->show();
+}