Skip to content

Commit 966f4e9

Browse files
committed
Qt: Disable UI for fast boot & disc speedup if marked incompatible in the DB
1 parent 4c349ff commit 966f4e9

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/duckstation-qt/consolesettingswidget.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,16 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
141141
&ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked);
142142
connect(m_ui.cpuClockSpeed, &QSlider::valueChanged, this, &ConsoleSettingsWidget::onCPUClockSpeedValueChanged);
143143

144+
SettingWidgetBinder::SetAvailability(m_ui.fastBoot, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceFullBoot));
145+
SettingWidgetBinder::SetAvailability(m_ui.fastForwardBoot, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceFullBoot));
144146
SettingWidgetBinder::SetAvailability(
145147
m_ui.cpuExecutionMode, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter), m_ui.cpuExecutionModeLabel);
148+
SettingWidgetBinder::SetAvailability(m_ui.cdromReadSpeedup,
149+
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableCDROMReadSpeedup),
150+
m_ui.cdromReadSpeedupLabel);
151+
SettingWidgetBinder::SetAvailability(m_ui.cdromSeekSpeedup,
152+
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableCDROMSeekSpeedup),
153+
m_ui.cdromSeekSpeedupLabel);
146154

147155
calculateCPUClockValue();
148156
}

src/duckstation-qt/consolesettingswidget.ui

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>648</width>
10-
<height>468</height>
9+
<width>640</width>
10+
<height>492</height>
1111
</rect>
1212
</property>
1313
<layout class="QVBoxLayout" name="verticalLayout">
@@ -173,7 +173,7 @@
173173
</property>
174174
<layout class="QGridLayout" name="cdromLayout" columnstretch="0,1">
175175
<item row="0" column="0">
176-
<widget class="QLabel" name="label_2">
176+
<widget class="QLabel" name="cdromReadSpeedupLabel">
177177
<property name="text">
178178
<string>Read Speedup:</string>
179179
</property>
@@ -239,7 +239,7 @@
239239
</widget>
240240
</item>
241241
<item row="1" column="0">
242-
<widget class="QLabel" name="label_5">
242+
<widget class="QLabel" name="cdromSeekSpeedupLabel">
243243
<property name="text">
244244
<string>Seek Speedup:</string>
245245
</property>

src/duckstation-qt/settingwidgetbinder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,11 +1521,11 @@ inline void SetAvailability(WidgetType* widget, bool available, QLabel* widget_l
15211521
if constexpr (std::is_same_v<WidgetType, QComboBox>)
15221522
{
15231523
widget->clear();
1524-
widget->addItem(qApp->translate("SettingWidgetBinder", "Incompatible with this game."));
1524+
widget->addItem(qApp->translate("SettingWidgetBinder", "Incompatible with this game"));
15251525
}
15261526
else if constexpr (std::is_same_v<WidgetType, QLineEdit>)
15271527
{
1528-
widget->setText(qApp->translate("SettingWidgetBinder", "Incompatible with this game."));
1528+
widget->setText(qApp->translate("SettingWidgetBinder", "Incompatible with this game"));
15291529
}
15301530
else if constexpr (std::is_same_v<WidgetType, QCheckBox>)
15311531
{

0 commit comments

Comments
 (0)