From 6bf23e48f2591fc189fdefbf31f5a224169e61f4 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sun, 3 Aug 2008 01:39:21 +0200 Subject: [PATCH] Bring back systray notifications. Another hacky solution that needs more thinking. --- src/qtui/mainwin.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index cbe3526b..027f7de0 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -82,12 +82,12 @@ MainWin::MainWin(QtUi *_gui, QWidget *parent) { UiSettings uiSettings; loadTranslation(uiSettings.value("Locale", QLocale::system()).value()); - + QString style = uiSettings.value("Style", QString("")).toString(); if(style != "") { QApplication::setStyle(style); } - + ui.setupUi(this); setWindowTitle("Quassel IRC"); setWindowIcon(offlineTrayIcon); @@ -151,9 +151,9 @@ void MainWin::init() { // 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 @@ -205,7 +205,7 @@ void MainWin::addBufferView(BufferViewConfig *config) { view->show(); connect(&view->showChannelList, SIGNAL(triggered()), this, SLOT(showChannelList())); - + Client::bufferModel()->synchronizeView(view); dock->setWidget(view); @@ -595,19 +595,18 @@ void MainWin::receiveMessage(const Message &msg) { bool displayBubble = uiSettings.value("NotificationBubble", QVariant(true)).toBool(); bool displayDesktop = uiSettings.value("NotificationDesktop", QVariant(true)).toBool(); if(displayBubble || displayDesktop) { -/* // FIXME port - if(uiSettings.value("DisplayPopupMessages", QVariant(true)).toBool()) { - // 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 - */ - } - if(uiSettings.value("AnimateTrayIcon", QVariant(true)).toBool()) { - QApplication::alert(this); - setTrayIconActivity(true); + } + if(uiSettings.value("AnimateTrayIcon", QVariant(true)).toBool()) { + QApplication::alert(this); + setTrayIconActivity(true); + } } } } @@ -746,7 +745,7 @@ void MainWin::clientNetworkRemoved(NetworkId id) { QAction *action = findChild(QString("NetworkAction-%1").arg(id.toInt())); if(!action) return; - + action->deleteLater(); } -- 2.20.1