X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=d87026c330a2ae431927bab70508fda8e0c14a75;hp=fd258838e5370b76d80f84f5fc016909fd022ea3;hb=bfeb38f1572e44bdfbfb7f4d47d6dc6ecc20439f;hpb=8e93326fd70af3c0accc599770796619ef3cee6e diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index fd258838..d87026c3 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -207,15 +207,16 @@ void MainWin::init() connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), SLOT(messagesInserted(const QModelIndex &, int, int))); connect(GraphicalUi::contextMenuActionProvider(), - SIGNAL(showChannelList(NetworkId, const QString &)), - SLOT(showChannelList(NetworkId, const QString &))); + SIGNAL(showChannelList(NetworkId,QString,bool)), + SLOT(showChannelList(NetworkId,QString,bool))); connect(Client::instance(), - SIGNAL(showChannelList(NetworkId, const QString &)), - SLOT(showChannelList(NetworkId, const QString &))); + SIGNAL(showChannelList(NetworkId,QString,bool)), + SLOT(showChannelList(NetworkId,QString,bool))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showNetworkConfig(NetworkId)), SLOT(showNetworkConfig(NetworkId))); connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString))); connect(Client::instance(), SIGNAL(showIgnoreList(QString)), SLOT(showIgnoreList(QString))); connect(Client::instance(), SIGNAL(dbUpgradeInProgress(bool)), SLOT(showMigrationWarning(bool))); + connect(Client::instance(), SIGNAL(exitRequested(QString)), SLOT(onExitRequested(QString))); connect(Client::coreConnection(), SIGNAL(startCoreSetup(QVariantList, QVariantList)), SLOT(showCoreConfigWizard(QVariantList, QVariantList))); connect(Client::coreConnection(), SIGNAL(connectionErrorPopup(QString)), SLOT(handleCoreConnectionError(QString))); @@ -858,6 +859,19 @@ void MainWin::showMigrationWarning(bool show) } +void MainWin::onExitRequested(const QString &reason) +{ + if (!reason.isEmpty()) { + QMessageBox box(QMessageBox::Critical, + tr("Fatal error"), + "" + tr("Quassel encountered a fatal error and is terminated.") + "", + QMessageBox::Ok, this); + box.setInformativeText("

" + tr("Reason:") + " " + reason + ""); + box.exec(); + } +} + + void MainWin::changeActiveBufferView(bool backwards) { if (_activeBufferViewIndex >= 0 && _activeBufferViewIndex < _bufferViews.count()) { @@ -1473,10 +1487,8 @@ void MainWin::showCoreConfigWizard(const QVariantList &backends, const QVariantL } -void MainWin::showChannelList(NetworkId netId, const QString &channelFilters) +void MainWin::showChannelList(NetworkId netId, const QString &channelFilters, bool listImmediately) { - ChannelListDlg *channelListDlg = new ChannelListDlg(); - if (!netId.isValid()) { QAction *action = qobject_cast(sender()); if (action) @@ -1493,12 +1505,15 @@ void MainWin::showChannelList(NetworkId netId, const QString &channelFilters) } } - + ChannelListDlg *channelListDlg = new ChannelListDlg(this); channelListDlg->setAttribute(Qt::WA_DeleteOnClose); channelListDlg->setNetwork(netId); if (!channelFilters.isEmpty()) { channelListDlg->setChannelFilters(channelFilters); } + if (listImmediately) { + channelListDlg->requestSearch(); + } channelListDlg->show(); }