X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.cpp;h=801fab8b70e2fa9824cd981322f8167723c1a853;hb=1f2784bfa1c1ce90defa32f13c78afd72c227bfd;hp=fe1a0d0639d8bed4e27e1de3896b7d5cbcb8b415;hpb=da1a6f40b28d65e5b6a5a03e62f9b2604c3f00a7;p=quassel.git diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index fe1a0d06..801fab8b 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -206,12 +206,17 @@ void MainWin::init() connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), SLOT(clientNetworkRemoved(NetworkId))); connect(Client::messageModel(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), SLOT(messagesInserted(const QModelIndex &, int, int))); - connect(GraphicalUi::contextMenuActionProvider(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId))); - connect(Client::instance(), SIGNAL(showChannelList(NetworkId)), SLOT(showChannelList(NetworkId))); + connect(GraphicalUi::contextMenuActionProvider(), + SIGNAL(showChannelList(NetworkId,QString,bool)), + SLOT(showChannelList(NetworkId,QString,bool))); + connect(Client::instance(), + 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))); @@ -818,15 +823,17 @@ void MainWin::changeActiveBufferView(int bufferViewId) void MainWin::showPasswordChangeDlg() { if(Client::isCoreFeatureEnabled(Quassel::Feature::PasswordChange)) { - PasswordChangeDlg dlg(this); - dlg.exec(); + auto dlg = new PasswordChangeDlg(this); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->exec(); } else { - QMessageBox box(QMessageBox::Warning, tr("Feature Not Supported"), - tr("Your Quassel Core does not support this feature"), - QMessageBox::Ok, this); - box.setInformativeText(tr("You need a Quassel Core v0.12.0 or newer in order to be able to remotely change your password.")); - box.exec(); + auto box = new QMessageBox(QMessageBox::Warning, tr("Feature Not Supported"), + tr("Your Quassel Core does not support this feature"), + QMessageBox::Ok, this); + box->setInformativeText(tr("You need a Quassel Core v0.12.0 or newer in order to be able to remotely change your password.")); + box->setAttribute(Qt::WA_DeleteOnClose); + box->exec(); } } @@ -854,6 +861,20 @@ void MainWin::showMigrationWarning(bool show) } +void MainWin::onExitRequested(const QString &reason) +{ + if (!reason.isEmpty()) { + auto box = new QMessageBox(QMessageBox::Critical, + tr("Fatal error"), + "" + tr("Quassel encountered a fatal error and is terminated.") + "", + QMessageBox::Ok, this); + box->setInformativeText("
" + tr("Reason:") + " " + reason + ""); + box->setAttribute(Qt::WA_DeleteOnClose); + box->exec(); + } +} + + void MainWin::changeActiveBufferView(bool backwards) { if (_activeBufferViewIndex >= 0 && _activeBufferViewIndex < _bufferViews.count()) { @@ -924,22 +945,25 @@ void MainWin::hideCurrentBuffer() void MainWin::showNotificationsDlg() { - SettingsPageDlg dlg(new NotificationsSettingsPage(this), this); - dlg.exec(); + auto dlg = new SettingsPageDlg(new NotificationsSettingsPage(this), this); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->exec(); } void MainWin::on_actionConfigureNetworks_triggered() { - SettingsPageDlg dlg(new NetworksSettingsPage(this), this); - dlg.exec(); + auto dlg = new SettingsPageDlg(new NetworksSettingsPage(this), this); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->exec(); } void MainWin::on_actionConfigureViews_triggered() { - SettingsPageDlg dlg(new BufferViewSettingsPage(this), this); - dlg.exec(); + auto dlg = new SettingsPageDlg(new BufferViewSettingsPage(this), this); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->exec(); } @@ -1375,28 +1399,31 @@ void MainWin::setDisconnectedState() void MainWin::userAuthenticationRequired(CoreAccount *account, bool *valid, const QString &errorMessage) { Q_UNUSED(errorMessage) - CoreConnectAuthDlg dlg(account, this); - *valid = (dlg.exec() == QDialog::Accepted); + auto dlg = new CoreConnectAuthDlg(account, this); + dlg->setAttribute(Qt::WA_DeleteOnClose); + *valid = (dlg->exec() == QDialog::Accepted); } void MainWin::handleNoSslInClient(bool *accepted) { - QMessageBox box(QMessageBox::Warning, tr("Unencrypted Connection"), tr("Your client does not support SSL encryption"), - QMessageBox::Ignore|QMessageBox::Cancel, this); - box.setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core.")); - box.setDefaultButton(QMessageBox::Ignore); - *accepted = box.exec() == QMessageBox::Ignore; + auto box = new QMessageBox(QMessageBox::Warning, tr("Unencrypted Connection"), tr("Your client does not support SSL encryption"), + QMessageBox::Ignore|QMessageBox::Cancel, this); + box->setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core.")); + box->setDefaultButton(QMessageBox::Ignore); + box->setAttribute(Qt::WA_DeleteOnClose); + *accepted = (box->exec() == QMessageBox::Ignore); } void MainWin::handleNoSslInCore(bool *accepted) { - QMessageBox box(QMessageBox::Warning, tr("Unencrypted Connection"), tr("Your core does not support SSL encryption"), - QMessageBox::Ignore|QMessageBox::Cancel, this); - box.setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core.")); - box.setDefaultButton(QMessageBox::Ignore); - *accepted = box.exec() == QMessageBox::Ignore; + auto box = new QMessageBox(QMessageBox::Warning, tr("Unencrypted Connection"), tr("Your core does not support SSL encryption"), + QMessageBox::Ignore|QMessageBox::Cancel, this); + box->setInformativeText(tr("Sensitive data, like passwords, will be transmitted unencrypted to your Quassel core.")); + box->setDefaultButton(QMessageBox::Ignore); + box->setAttribute(Qt::WA_DeleteOnClose); + *accepted = (box->exec() == QMessageBox::Ignore); } @@ -1409,35 +1436,38 @@ void MainWin::handleSslErrors(const QSslSocket *socket, bool *accepted, bool *pe errorString += QString("