- QMessageBox box(QMessageBox::Warning, tr("Feature Not Supported"),
- tr("<b>Your Quassel Core does not support this feature</b>"),
- 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("<b>Your Quassel Core does not support this feature</b>"),
+ 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();
+ }
+}
+
+
+void MainWin::showMigrationWarning(bool show)
+{
+ if (show && !_migrationWarning) {
+ _migrationWarning = new QMessageBox(QMessageBox::Information,
+ tr("Upgrading..."),
+ "<b>" + tr("Your database is being upgraded") + "</b>",
+ QMessageBox::NoButton, this);
+ _migrationWarning->setInformativeText("<p>"
+ + tr("In order to support new features, we need to make changes to your backlog database. This may take a long while.")
+ + "</p><p>"
+ + tr("Do not exit Quassel until the upgrade is complete!")
+ + "</p>");
+ _migrationWarning->setStandardButtons(QMessageBox::NoButton);
+ _migrationWarning->show();
+ }
+ else if (!show && _migrationWarning) {
+ _migrationWarning->close();
+ _migrationWarning->deleteLater();
+ _migrationWarning = nullptr;
+ }
+}
+
+
+void MainWin::onExitRequested(const QString &reason)
+{
+ if (!reason.isEmpty()) {
+ auto box = new QMessageBox(QMessageBox::Critical,
+ tr("Fatal error"),
+ "<b>" + tr("Quassel encountered a fatal error and is terminated.") + "</b>",
+ QMessageBox::Ok, this);
+ box->setInformativeText("<p>" + tr("Reason:<em>") + " " + reason + "</em>");
+ box->setAttribute(Qt::WA_DeleteOnClose);
+ box->exec();