Merge pull request #1067 from RedsonBr140/feat/dont-hide-settings
feat: Don't hide the settings tab when an instance is running
This commit is contained in:
commit
9908e115aa
@ -60,6 +60,10 @@ InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
|
|||||||
m_settings = inst->settings();
|
m_settings = inst->settings();
|
||||||
ui->setupUi(this);
|
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(ui->openGlobalJavaSettingsButton, &QCommandLinkButton::clicked, this, &InstanceSettingsPage::globalSettingsButtonClicked);
|
||||||
connect(APPLICATION, &Application::globalSettingsAboutToOpen, this, &InstanceSettingsPage::applySettings);
|
connect(APPLICATION, &Application::globalSettingsAboutToOpen, this, &InstanceSettingsPage::applySettings);
|
||||||
connect(APPLICATION, &Application::globalSettingsClosed, this, &InstanceSettingsPage::loadSettings);
|
connect(APPLICATION, &Application::globalSettingsClosed, this, &InstanceSettingsPage::loadSettings);
|
||||||
@ -70,11 +74,6 @@ InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
|
|||||||
updateThresholds();
|
updateThresholds();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InstanceSettingsPage::shouldDisplay() const
|
|
||||||
{
|
|
||||||
return !m_instance->isRunning();
|
|
||||||
}
|
|
||||||
|
|
||||||
InstanceSettingsPage::~InstanceSettingsPage()
|
InstanceSettingsPage::~InstanceSettingsPage()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
@ -524,3 +523,8 @@ void InstanceSettingsPage::updateThresholds()
|
|||||||
ui->labelMaxMemIcon->setPixmap(pix);
|
ui->labelMaxMemIcon->setPixmap(pix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstanceSettingsPage::updateRunningStatus(bool running)
|
||||||
|
{
|
||||||
|
setEnabled(!running);
|
||||||
|
}
|
||||||
|
@ -75,12 +75,12 @@ public:
|
|||||||
{
|
{
|
||||||
return "Instance-settings";
|
return "Instance-settings";
|
||||||
}
|
}
|
||||||
virtual bool shouldDisplay() const override;
|
|
||||||
void retranslate() override;
|
void retranslate() override;
|
||||||
|
|
||||||
void updateThresholds();
|
void updateThresholds();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void updateRunningStatus(bool running);
|
||||||
void on_javaDetectBtn_clicked();
|
void on_javaDetectBtn_clicked();
|
||||||
void on_javaTestBtn_clicked();
|
void on_javaTestBtn_clicked();
|
||||||
void on_javaBrowseBtn_clicked();
|
void on_javaBrowseBtn_clicked();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user