From f0eb5b4a0c16b0ddd17ee73e7ecebae2def16df7 Mon Sep 17 00:00:00 2001 From: Janrupf Date: Sat, 22 May 2021 13:28:23 +0200 Subject: NOISSUE Register settings for setting a server --- application/pages/instance/InstanceSettingsPage.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'application') diff --git a/application/pages/instance/InstanceSettingsPage.cpp b/application/pages/instance/InstanceSettingsPage.cpp index 05041c82..ff8659c5 100644 --- a/application/pages/instance/InstanceSettingsPage.cpp +++ b/application/pages/instance/InstanceSettingsPage.cpp @@ -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() -- cgit