Bring back systray notifications. Another hacky solution that needs more thinking.
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 2 Aug 2008 23:39:21 +0000 (01:39 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 2 Aug 2008 23:40:49 +0000 (01:40 +0200)
src/qtui/mainwin.cpp

index cbe3526..027f7de 100644 (file)
@@ -82,12 +82,12 @@ MainWin::MainWin(QtUi *_gui, QWidget *parent)
 {
   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);
@@ -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<QAction *>(QString("NetworkAction-%1").arg(id.toInt()));
   if(!action)
     return;
-  
+
   action->deleteLater();
 }