Qt: Remove Apperance/Update settings from Game Properties

This commit is contained in:
Stenzek 2025-01-07 12:48:27 +10:00
parent 092e819a07
commit 6318223f58
No known key found for this signature in database
2 changed files with 59 additions and 31 deletions

View File

@ -71,14 +71,20 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
connect(m_ui.renderToSeparateWindow, &QCheckBox::checkStateChanged, this,
&InterfaceSettingsWidget::onRenderToSeparateWindowChanged);
SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.theme, "UI", "Theme", THEME_NAMES, THEME_VALUES,
QtHost::GetDefaultThemeName(), "MainWindow");
connect(m_ui.theme, QOverload<int>::of(&QComboBox::currentIndexChanged), [this]() { emit themeChanged(); });
if (!m_dialog->isPerGameSettings())
{
SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.theme, "UI", "Theme", THEME_NAMES, THEME_VALUES,
QtHost::GetDefaultThemeName(), "MainWindow");
connect(m_ui.theme, QOverload<int>::of(&QComboBox::currentIndexChanged), [this]() { emit themeChanged(); });
populateLanguageDropdown(m_ui.language);
SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.language, "Main", "Language", QtHost::GetDefaultLanguage());
connect(m_ui.language, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&InterfaceSettingsWidget::onLanguageChanged);
populateLanguageDropdown(m_ui.language);
SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.language, "Main", "Language",
QtHost::GetDefaultLanguage());
connect(m_ui.language, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&InterfaceSettingsWidget::onLanguageChanged);
m_ui.autoUpdateCurrentVersion->setText(tr("%1 (%2)").arg(g_scm_tag_str).arg(g_scm_date_str));
}
onRenderToSeparateWindowChanged();
@ -114,27 +120,49 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
dialog->registerWidgetHelp(m_ui.enableDiscordPresence, tr("Enable Discord Presence"), tr("Unchecked"),
tr("Shows the game you are currently playing as part of your profile in Discord."));
dialog->registerWidgetHelp(m_ui.autoUpdateEnabled, tr("Enable Automatic Update Check"), tr("Checked"),
tr("Automatically checks for updates to the program on startup. Updates can be deferred "
"until later or skipped entirely."));
m_ui.autoUpdateCurrentVersion->setText(tr("%1 (%2)").arg(g_scm_tag_str).arg(g_scm_date_str));
if (!m_dialog->isPerGameSettings() && AutoUpdaterDialog::isSupported())
if (!m_dialog->isPerGameSettings())
{
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.autoUpdateEnabled, "AutoUpdater", "CheckAtStartup", true);
m_ui.autoUpdateTag->addItems(AutoUpdaterDialog::getTagList());
SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.autoUpdateTag, "AutoUpdater", "UpdateTag",
AutoUpdaterDialog::getDefaultTag());
connect(m_ui.checkForUpdates, &QPushButton::clicked, this, []() { g_main_window->checkForUpdates(true); });
dialog->registerWidgetHelp(m_ui.autoUpdateEnabled, tr("Enable Automatic Update Check"), tr("Checked"),
tr("Automatically checks for updates to the program on startup. Updates can be deferred "
"until later or skipped entirely."));
}
if (!m_dialog->isPerGameSettings())
{
if (AutoUpdaterDialog::isSupported())
{
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.autoUpdateEnabled, "AutoUpdater", "CheckAtStartup", true);
m_ui.autoUpdateTag->addItems(AutoUpdaterDialog::getTagList());
SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.autoUpdateTag, "AutoUpdater", "UpdateTag",
AutoUpdaterDialog::getDefaultTag());
connect(m_ui.checkForUpdates, &QPushButton::clicked, this, []() { g_main_window->checkForUpdates(true); });
}
else
{
m_ui.autoUpdateTag->addItem(tr("Unavailable"));
m_ui.autoUpdateEnabled->setEnabled(false);
m_ui.autoUpdateTag->setEnabled(false);
m_ui.checkForUpdates->setEnabled(false);
m_ui.updatesGroup->setEnabled(false);
}
}
else
{
m_ui.autoUpdateTag->addItem(tr("Unavailable"));
m_ui.autoUpdateEnabled->setEnabled(false);
m_ui.autoUpdateTag->setEnabled(false);
m_ui.checkForUpdates->setEnabled(false);
m_ui.updatesGroup->setEnabled(false);
delete m_ui.appearanceGroup;
m_ui.appearanceGroup = nullptr;
m_ui.languageLabel = nullptr;
m_ui.language = nullptr;
m_ui.themeLabel = nullptr;
m_ui.theme = nullptr;
delete m_ui.updatesGroup;
m_ui.autoUpdateTagLabel = nullptr;
m_ui.autoUpdateTag = nullptr;
m_ui.autoUpdateCurrentVersionLabel = nullptr;
m_ui.autoUpdateCurrentVersion = nullptr;
m_ui.autoUpdateCheckLayout = nullptr;
m_ui.autoUpdateEnabled = nullptr;
m_ui.checkForUpdates = nullptr;
}
}

View File

@ -24,7 +24,7 @@
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox_4">
<widget class="QGroupBox" name="behaviorGroup">
<property name="title">
<string>Behaviour</string>
</property>
@ -89,7 +89,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<widget class="QGroupBox" name="gameDisplayGroup">
<property name="title">
<string>Game Display</string>
</property>
@ -149,14 +149,14 @@
<widget class="QComboBox" name="theme"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="languageLabel">
<property name="text">
<string>Language:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="themeLabel">
<property name="text">
<string>Theme:</string>
</property>
@ -175,7 +175,7 @@
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="autoUpdateTagLabel">
<property name="text">
<string>Update Channel:</string>
</property>
@ -185,7 +185,7 @@
<widget class="QComboBox" name="autoUpdateTag"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="autoUpdateCurrentVersionLabel">
<property name="text">
<string>Current Version:</string>
</property>
@ -199,7 +199,7 @@
</widget>
</item>
<item row="2" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="autoUpdateCheckLayout">
<item>
<widget class="QCheckBox" name="autoUpdateEnabled">
<property name="text">