Made settings editable when instance is running

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-21 22:42:08 +03:00
parent 0975dbc3dd
commit 820892d7cc
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
2 changed files with 3 additions and 13 deletions

View File

@ -60,17 +60,13 @@ InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
m_settings = inst->settings();
ui->setupUi(this);
// As the signal will (probably) not be triggered once we click edit, let's update it manually instead.
updateRunningStatus(m_instance->isRunning());
connect(m_instance, &BaseInstance::runningStatusChanged, this, &InstanceSettingsPage::updateRunningStatus);
connect(ui->openGlobalJavaSettingsButton, &QCommandLinkButton::clicked, this, &InstanceSettingsPage::globalSettingsButtonClicked);
connect(APPLICATION, &Application::globalSettingsAboutToOpen, this, &InstanceSettingsPage::applySettings);
connect(APPLICATION, &Application::globalSettingsClosed, this, &InstanceSettingsPage::loadSettings);
connect(ui->instanceAccountSelector, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &InstanceSettingsPage::changeInstanceAccount);
connect(ui->instanceAccountSelector, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&InstanceSettingsPage::changeInstanceAccount);
loadSettings();
updateThresholds();
}
@ -523,8 +519,3 @@ void InstanceSettingsPage::updateThresholds()
ui->labelMaxMemIcon->setPixmap(pix);
}
}
void InstanceSettingsPage::updateRunningStatus(bool running)
{
setEnabled(!running);
}

View File

@ -79,8 +79,7 @@ public:
void updateThresholds();
private slots:
void updateRunningStatus(bool running);
private slots:
void on_javaDetectBtn_clicked();
void on_javaTestBtn_clicked();
void on_javaBrowseBtn_clicked();