Implement instance sorting options.
This commit is contained in:
parent
4466929074
commit
d6e4fb2971
5 changed files with 52 additions and 9 deletions
|
@ -33,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();
|
||||
|
@ -165,6 +167,20 @@ void SettingsDialog::applySettings(SettingsObject *s)
|
|||
// 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)
|
||||
|
@ -195,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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue