qtui: Rework the attention state behavior of the tray icon
[quassel.git] / src / qtui / mainwin.cpp
index 49c3d3d..00f8372 100644 (file)
@@ -299,11 +299,7 @@ void MainWin::init()
     // restore locked state of docks
     QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool());
 
-    CoreConnection *conn = Client::coreConnection();
-    if (!conn->connectToCore()) {
-        // No autoconnect selected (or no accounts)
-        showCoreConnectionDlg();
-    }
+    QTimer::singleShot(0, this, SLOT(doAutoConnect()));
 }
 
 
@@ -460,7 +456,7 @@ void MainWin::setupActions()
     coll->addAction("ConfigureQuassel", configureQuasselAct);
 
     // Help
-    QAction *aboutQuasselAct = new Action(QIcon(":/icons/quassel.png"), tr("&About Quassel"), coll,
+    QAction *aboutQuasselAct = new Action(QIcon::fromTheme("quassel"), tr("&About Quassel"), coll,
         this, SLOT(showAboutDlg()));
     aboutQuasselAct->setMenuRole(QAction::AboutRole);
     coll->addAction("AboutQuassel", aboutQuasselAct);
@@ -1149,7 +1145,6 @@ void MainWin::setupSystray()
 #else
     _systemTray = new SystemTray(this); // dummy
 #endif
-    _systemTray->init();
 }
 
 
@@ -1218,6 +1213,15 @@ void MainWin::saveMainToolBarStatus(bool enabled)
 }
 
 
+void MainWin::doAutoConnect()
+{
+    if (!Client::coreConnection()->connectToCore()) {
+        // No autoconnect selected (or no accounts)
+        showCoreConnectionDlg();
+    }
+}
+
+
 void MainWin::connectedToCore()
 {
     Q_CHECK_PTR(Client::bufferViewManager());