Sanitize topic message
[quassel.git] / src / qtui / mainwin.cpp
index cc667ca..a4be9fd 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2012 by the Quassel Project                        *
+ *   Copyright (C) 2005-2013 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -15,8 +15,9 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
+
 #include "mainwin.h"
 
 #include <QMenuBar>
   #include "indicatornotificationbackend.h"
 #endif
 
+#ifdef HAVE_NOTIFICATION_CENTER
+  #include "osxnotificationbackend.h"
+#endif
+
+#ifdef HAVE_DBUS
+  #include "dockmanagernotificationbackend.h"
+#endif
+
 #include "settingspages/aliasessettingspage.h"
 #include "settingspages/appearancesettingspage.h"
 #include "settingspages/backlogsettingspage.h"
@@ -217,6 +226,14 @@ void MainWin::init()
     QtUi::registerNotificationBackend(new IndicatorNotificationBackend(this));
 #endif
 
+#ifdef HAVE_NOTIFICATION_CENTER
+    QtUi::registerNotificationBackend(new OSXNotificationBackend(this));
+#endif
+
+#ifdef HAVE_DBUS
+    QtUi::registerNotificationBackend(new DockManagerNotificationBackend(this));
+#endif
+
     // we assume that at this point, all configurable actions are defined!
     QtUi::loadShortcuts();
 
@@ -297,7 +314,9 @@ void MainWin::restoreStateFromSettings(UiSettings &s)
     move(_normalPos);
 #endif
 
-    if (s.value("MainWinHidden").toBool() && QtUi::haveSystemTray())
+    if ((Quassel::isOptionSet("hidewindow")
+            || s.value("MainWinHidden").toBool())
+            && _systemTray->isSystemTrayAvailable())
         QtUi::hideMainWidget();
     else if (s.value("MainWinMinimized").toBool())
         showMinimized();