Qt: Disable UI for fast boot & disc speedup if marked incompatible in the DB (#3525)

This commit is contained in:
Davide Pesavento
2025-08-20 02:45:10 -04:00
committed by GitHub
parent 28db2be7f6
commit c1e71820d7
3 changed files with 14 additions and 6 deletions

View File

@@ -141,8 +141,16 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
&ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked);
connect(m_ui.cpuClockSpeed, &QSlider::valueChanged, this, &ConsoleSettingsWidget::onCPUClockSpeedValueChanged);
SettingWidgetBinder::SetAvailability(m_ui.fastBoot, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceFullBoot));
SettingWidgetBinder::SetAvailability(m_ui.fastForwardBoot, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceFullBoot));
SettingWidgetBinder::SetAvailability(
m_ui.cpuExecutionMode, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter), m_ui.cpuExecutionModeLabel);
SettingWidgetBinder::SetAvailability(m_ui.cdromReadSpeedup,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableCDROMReadSpeedup),
m_ui.cdromReadSpeedupLabel);
SettingWidgetBinder::SetAvailability(m_ui.cdromSeekSpeedup,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableCDROMSeekSpeedup),
m_ui.cdromSeekSpeedupLabel);
calculateCPUClockValue();
}

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>648</width>
<height>468</height>
<width>640</width>
<height>492</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -173,7 +173,7 @@
</property>
<layout class="QGridLayout" name="cdromLayout" columnstretch="0,1">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="cdromReadSpeedupLabel">
<property name="text">
<string>Read Speedup:</string>
</property>
@@ -239,7 +239,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="cdromSeekSpeedupLabel">
<property name="text">
<string>Seek Speedup:</string>
</property>

View File

@@ -1521,11 +1521,11 @@ inline void SetAvailability(WidgetType* widget, bool available, QLabel* widget_l
if constexpr (std::is_same_v<WidgetType, QComboBox>)
{
widget->clear();
widget->addItem(qApp->translate("SettingWidgetBinder", "Incompatible with this game."));
widget->addItem(qApp->translate("SettingWidgetBinder", "Incompatible with this game"));
}
else if constexpr (std::is_same_v<WidgetType, QLineEdit>)
{
widget->setText(qApp->translate("SettingWidgetBinder", "Incompatible with this game."));
widget->setText(qApp->translate("SettingWidgetBinder", "Incompatible with this game"));
}
else if constexpr (std::is_same_v<WidgetType, QCheckBox>)
{