Merge branch 'select-account-from-cli' of https://github.com/justjanne/quassel
authorDaniel Albers <daniel@lbe.rs>
Fri, 2 Aug 2019 09:57:15 +0000 (11:57 +0200)
committerDaniel Albers <daniel@lbe.rs>
Fri, 2 Aug 2019 10:14:46 +0000 (12:14 +0200)
Closes #503.

src/common/quassel.cpp
src/qtui/mainwin.cpp

index 09d8037..0c6b863 100644 (file)
@@ -336,6 +336,7 @@ void Quassel::setupCliParser()
             {"icontheme", tr("Override the system icon theme ('breeze' is recommended)."), tr("theme")},
             {"qss", tr("Load a custom application stylesheet."), tr("file.qss")},
             {"hidewindow", tr("Start the client minimized to the system tray.")},
+            {"account", tr("Account id to connect to on startup."), tr("account"), "0"},
         };
     }
 
index 2b43a7e..5b0118a 100644 (file)
@@ -1195,7 +1195,8 @@ void MainWin::saveMainToolBarStatus(bool enabled)
 
 void MainWin::doAutoConnect()
 {
-    if (!Client::coreConnection()->connectToCore()) {
+    int accountId = Quassel::optionValue("account").toInt();
+    if (!Client::coreConnection()->connectToCore(accountId)) {
         // No autoconnect selected (or no accounts)
         showCoreConnectionDlg();
     }