X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=ed467cd46d0b66979b30a401326235db125edf7d;hb=01e2f218ef5b1cf2e8c2eb1b0d3b7d9c3ad878e5;hp=6871ae013f87aa78f1cb56f2c4d941f87449cc1b;hpb=cba75e911d78fd3250b25c94e4ad1aa1c4207ecf;p=quassel.git diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 6871ae01..ed467cd4 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -55,6 +55,7 @@ #include "clientbufferviewconfig.h" #include "clientbufferviewmanager.h" #include "clientignorelistmanager.h" +#include "coreconnectdlg.h" #include "coreconnection.h" #include "coreconnectionstatuswidget.h" #include "coreinfodlg.h" @@ -157,6 +158,7 @@ void MainWin::init() { SLOT(messagesInserted(const QModelIndex &, int, int))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString))); + connect(Client::coreConnection(), SIGNAL(userAuthenticationRequired(CoreAccount *, bool *, QString)), SLOT(userAuthenticationRequired(CoreAccount *, bool *, QString))); // Setup Dock Areas setDockNestingEnabled(true); @@ -212,12 +214,11 @@ void MainWin::init() { // restore locked state of docks QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool()); - if(Quassel::runMode() != Quassel::Monolithic) { - //showCoreConnectionDlg(true); // autoconnect if appropriate - } else { - startInternalCore(); + CoreConnection *conn = Client::coreConnection(); + if(!conn->connectToCore()) { + // No autoconnect selected (or no accounts) + showCoreConnectionDlg(); } - Client::coreConnection()->start(); } MainWin::~MainWin() { @@ -831,6 +832,21 @@ void MainWin::startInternalCore() { } +void MainWin::showCoreConnectionDlg() { + CoreConnectDlg dlg(this); + if(dlg.exec() == QDialog::Accepted) { + AccountId accId = dlg.selectedAccount(); + if(accId.isValid()) + Client::coreConnection()->connectToCore(accId); + } +} + +void MainWin::userAuthenticationRequired(CoreAccount *account, bool *valid, const QString &errorMessage) { + Q_UNUSED(errorMessage) + CoreConnectAuthDlg dlg(account, this); + *valid = (dlg.exec() == QDialog::Accepted); +} + void MainWin::showChannelList(NetworkId netId) { ChannelListDlg *channelListDlg = new ChannelListDlg();