NOISSUE Register settings for setting a server

This commit is contained in:
Janrupf
2021-05-22 13:28:23 +02:00
parent 2e2a5d0943
commit f0eb5b4a0c
2 changed files with 23 additions and 0 deletions

View File

@ -191,6 +191,20 @@ void InstanceSettingsPage::applySettings()
m_settings->reset("ShowGameTime");
m_settings->reset("RecordGameTime");
}
// Join server on launch
bool joinServerOnLaunch = ui->serverJoinGroupBox->isChecked();
m_settings->set("JoinServerOnLaunch", joinServerOnLaunch);
if (joinServerOnLaunch)
{
m_settings->set("JoinServerOnLaunchAddress", ui->serverJoinAddress->text());
m_settings->set("JoinServerOnLaunchPort", ui->serverJoinPort->value());
}
else
{
m_settings->reset("JoinServerOnLaunchAddress");
m_settings->reset("JoinServerOnLaunchPort");
}
}
void InstanceSettingsPage::loadSettings()
@ -257,6 +271,10 @@ void InstanceSettingsPage::loadSettings()
ui->gameTimeGroupBox->setChecked(m_settings->get("OverrideGameTime").toBool());
ui->showGameTime->setChecked(m_settings->get("ShowGameTime").toBool());
ui->recordGameTime->setChecked(m_settings->get("RecordGameTime").toBool());
ui->serverJoinGroupBox->setChecked(m_settings->get("JoinServerOnLaunch").toBool());
ui->serverJoinAddress->setText(m_settings->get("JoinServerOnLaunchAddress").toString());
ui->serverJoinPort->setValue(m_settings->get("JoinServerOnLaunchPort").toInt());
}
void InstanceSettingsPage::on_javaDetectBtn_clicked()