summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-08-04 06:30:37 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-08-04 06:30:37 -0400
commit3d86f150ca3a0992ddaca5055a270b7204c0682a (patch)
tree2b6b61eb33d308828c4ad710a1d98c2d6a7d8f5d /src/mainwindow.cpp
parent61ad96cb54a20ce9f8e5380d67ba4bb26e19cc8e (diff)
moved geometry handling to ProblemsDialog and CategoriesDialog
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f41bde17..26398630 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -6164,24 +6164,20 @@ void MainWindow::on_bsaList_itemChanged(QTreeWidgetItem*, int)
void MainWindow::on_actionNotifications_triggered()
{
updateProblemsButton();
- ProblemsDialog problems(m_PluginContainer.plugins<QObject>(), this);
- QSettings &settings = m_OrganizerCore.settings().directInterface();
- QString key = QString("geometry/%1").arg(problems.objectName());
- if (settings.contains(key)) {
- problems.restoreGeometry(settings.value(key).toByteArray());
- }
+ ProblemsDialog problems(m_PluginContainer.plugins<QObject>(), this);
problems.exec();
- settings.setValue(key, problems.saveGeometry());
+
updateProblemsButton();
}
void MainWindow::on_actionChange_Game_triggered()
{
- if (QMessageBox::question(this, tr("Are you sure?"),
- tr("This will restart MO, continue?"),
- QMessageBox::Yes | QMessageBox::Cancel)
- == QMessageBox::Yes) {
+ const auto r = QMessageBox::question(
+ this, tr("Are you sure?"), tr("This will restart MO, continue?"),
+ QMessageBox::Yes | QMessageBox::Cancel);
+
+ if (r == QMessageBox::Yes) {
InstanceManager::instance().clearCurrentInstance();
qApp->exit(INT_MAX);
}
@@ -6206,16 +6202,10 @@ void MainWindow::on_displayCategoriesBtn_toggled(bool checked)
void MainWindow::editCategories()
{
CategoriesDialog dialog(this);
- QSettings &settings = m_OrganizerCore.settings().directInterface();
- QString key = QString("geometry/%1").arg(dialog.objectName());
- if (settings.contains(key)) {
- dialog.restoreGeometry(settings.value(key).toByteArray());
- }
+
if (dialog.exec() == QDialog::Accepted) {
dialog.commitChanges();
}
- settings.setValue(key, dialog.saveGeometry());
-
}
void MainWindow::deselectFilters()