From: Janne Koschinski Date: Fri, 26 Jul 2019 12:19:48 +0000 (+0200) Subject: Allow selecting the core account to connect to from CLI X-Git-Tag: test-travis-01~48^2 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=d00f6a7cadf195b4bf9c3b3101774e6950fbb2ab Allow selecting the core account to connect to from CLI - adds new --account option - if an account id is specified, connects to that account instead of asking or using any other defaults --- diff --git a/src/common/quassel.cpp b/src/common/quassel.cpp index 09d8037f..0c6b8630 100644 --- a/src/common/quassel.cpp +++ b/src/common/quassel.cpp @@ -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"}, }; } diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 2b43a7e1..5b0118a2 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -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(); }