GH-2150 Split out custom commands into a custom widget

Now it is used from a global page and from a sub-page in the instance settings.
This commit is contained in:
Petr Mrázek
2018-02-17 00:00:06 +01:00
parent a7957f24ba
commit 65bca65489
13 changed files with 689 additions and 166 deletions

View File

@ -22,7 +22,6 @@
#include <QDir>
#include "dialogs/VersionSelectDialog.h"
#include <ColumnResizer.h>
#include "java/JavaUtils.h"
#include "java/JavaInstallList.h"
@ -37,10 +36,6 @@ JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
ui->setupUi(this);
ui->tabWidget->tabBar()->hide();
auto resizer = new ColumnResizer(this);
resizer->addWidgetsFromLayout(ui->javaSettingsGroupBox->layout(), 0);
resizer->addWidgetsFromLayout(ui->customCommandsGroupBox->layout(), 0);
auto sysMB = Sys::getSystemRam() / Sys::megabyte;
ui->maxMemSpinBox->setMaximum(sysMB);
loadSettings();
@ -80,11 +75,6 @@ void JavaPage::applySettings()
s->set("JavaPath", ui->javaPathTextBox->text());
s->set("JvmArgs", ui->jvmArgsTextBox->text());
JavaCommon::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget());
// Custom Commands
s->set("PreLaunchCommand", ui->preLaunchCmdTextBox->text());
s->set("WrapperCommand", ui->wrapperCmdTextBox->text());
s->set("PostExitCommand", ui->postExitCmdTextBox->text());
}
void JavaPage::loadSettings()
{
@ -107,11 +97,6 @@ void JavaPage::loadSettings()
// Java Settings
ui->javaPathTextBox->setText(s->get("JavaPath").toString());
ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString());
// Custom Commands
ui->preLaunchCmdTextBox->setText(s->get("PreLaunchCommand").toString());
ui->wrapperCmdTextBox->setText(s->get("WrapperCommand").toString());
ui->postExitCmdTextBox->setText(s->get("PostExitCommand").toString());
}
void JavaPage::on_javaDetectBtn_clicked()