summaryrefslogtreecommitdiff
path: root/src/settingsdialogworkarounds.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-10-08 23:24:53 -0400
committerGitHub <noreply@github.com>2019-10-08 23:24:53 -0400
commitc01e80a651f5e25441330ad20253bb47ad0f516c (patch)
treec801c21b793f2fd4d9c141b7c0efe9836912a99a /src/settingsdialogworkarounds.cpp
parent94b40b328b7e455ad4799b98c2b00cd5d96f86f3 (diff)
parent3d97b0efd04326c0252411fc6639c4c6df2f2160 (diff)
Merge pull request #858 from isanae/proper-exit
Proper exit procedure
Diffstat (limited to 'src/settingsdialogworkarounds.cpp')
-rw-r--r--src/settingsdialogworkarounds.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/settingsdialogworkarounds.cpp b/src/settingsdialogworkarounds.cpp
index 0e31fc4b..1c5fbe26 100644
--- a/src/settingsdialogworkarounds.cpp
+++ b/src/settingsdialogworkarounds.cpp
@@ -2,6 +2,7 @@
#include "ui_settingsdialog.h"
#include "spawn.h"
#include "settings.h"
+#include <report.h>
#include <iplugingame.h>
WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d)
@@ -118,16 +119,18 @@ void WorkaroundsSettingsTab::on_bsaDateBtn_clicked()
void WorkaroundsSettingsTab::on_resetGeometryBtn_clicked()
{
- const auto caption = QObject::tr("Restart Mod Organizer?");
- const auto text = QObject::tr(
- "In order to reset the geometry, Mod Organizer must be restarted.\n"
- "Restart now?");
+ const auto r = MOBase::TaskDialog(parentWidget())
+ .title(QObject::tr("Restart Mod Organizer"))
+ .main(QObject::tr("Restart Mod Organizer"))
+ .content(QObject::tr("Geometries will be reset to their default values."))
+ .icon(QMessageBox::Question)
+ .button({QObject::tr("Restart Mod Organizer"), QMessageBox::Ok})
+ .button({QObject::tr("Cancel"), QMessageBox::Cancel})
+ .exec();
- const auto res = QMessageBox::question(
- parentWidget(), caption, text, QMessageBox::Yes | QMessageBox::Cancel);
-
- if (res == QMessageBox::Yes) {
+ if (r == QMessageBox::Ok) {
settings().geometry().requestReset();
- qApp->exit(INT_MAX);
+ ExitModOrganizer(Exit::Restart);
+ dialog().close();
}
}