summaryrefslogtreecommitdiff
path: root/src/settingsdialogworkarounds.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-10-07 04:27:53 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-10-07 04:27:53 -0400
commit3d97b0efd04326c0252411fc6639c4c6df2f2160 (patch)
tree45249ce4d01da37203c032cc2ff0e4caf1b2ce06 /src/settingsdialogworkarounds.cpp
parent4dbd5412860deaf0d709be5dfac1b8772285d92d (diff)
added ExitModOrganizer(), used instead of qApp->exit()
reset geometry uses TaskDialog moved restart code for the settings dialog to MainWindow fixed settings sometimes not being saved when restarting don't log "crash dumps present" every time the settings dialog is closed
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();
}
}