summaryrefslogtreecommitdiffstats
path: root/gui/settingsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/settingsdialog.cpp')
-rw-r--r--gui/settingsdialog.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp
index 346f7414..bf331fc0 100644
--- a/gui/settingsdialog.cpp
+++ b/gui/settingsdialog.cpp
@@ -17,6 +17,7 @@
#include "settingsdialog.h"
#include "ui_settingsdialog.h"
#include "logic/JavaUtils.h"
+#include "logic/NagUtils.h"
#include "gui/versionselectdialog.h"
#include "gui/platform.h"
#include "gui/CustomMessageBox.h"
@@ -32,6 +33,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::Se
{
MultiMCPlatform::fixWM_CLASS(this);
ui->setupUi(this);
+ ui->sortingModeGroup->setId(ui->sortByNameBtn, Sort_Name);
+ ui->sortingModeGroup->setId(ui->sortLastLaunchedBtn, Sort_LastLaunch);
loadSettings(MMC->settings().get());
updateCheckboxStuff();
@@ -159,10 +162,25 @@ void SettingsDialog::applySettings(SettingsObject *s)
// Java Settings
s->set("JavaPath", ui->javaPathTextBox->text());
s->set("JvmArgs", ui->jvmArgsTextBox->text());
+ NagUtils::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget());
// Custom Commands
s->set("PreLaunchCommand", ui->preLaunchCmdTextBox->text());
s->set("PostExitCommand", ui->postExitCmdTextBox->text());
+
+ auto sortMode = (InstSortMode) ui->sortingModeGroup->checkedId();
+ switch(sortMode)
+ {
+ case Sort_LastLaunch:
+ s->set("InstSortMode", "LastLaunch");
+ break;
+ case Sort_Name:
+ default:
+ s->set("InstSortMode", "Name");
+ break;
+ }
+
+ s->set("PostExitCommand", ui->postExitCmdTextBox->text());
}
void SettingsDialog::loadSettings(SettingsObject *s)
@@ -193,6 +211,17 @@ void SettingsDialog::loadSettings(SettingsObject *s)
ui->maxMemSpinBox->setValue(s->get("MaxMemAlloc").toInt());
ui->permGenSpinBox->setValue(s->get("PermGen").toInt());
+ QString sortMode = s->get("InstSortMode").toString();
+
+ if(sortMode == "LastLaunch")
+ {
+ ui->sortLastLaunchedBtn->setChecked(true);
+ }
+ else
+ {
+ ui->sortByNameBtn->setChecked(true);
+ }
+
// Java Settings
ui->javaPathTextBox->setText(s->get("JavaPath").toString());
ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString());