Qt: Add OSD options to general settings

This commit is contained in:
Connor McLaughlin 2020-03-22 13:16:39 +10:00
parent a4a5d3ef79
commit c646bf507f
2 changed files with 68 additions and 24 deletions

View file

@ -8,15 +8,20 @@ GeneralSettingsWidget::GeneralSettingsWidget(QtHostInterface* host_interface, QW
{ {
m_ui.setupUi(this); m_ui.setupUi(this);
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pauseOnStart, "Main/StartPaused");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.startFullscreen, "Main/StartFullscreen");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.saveStateOnExit, "Main/SaveStateOnExit");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.confirmPowerOff, "Main/ConfirmPowerOff");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.showOSDMessages, "Display/ShowOSDMessages");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.showFPS, "Display/ShowFPS");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.showVPS, "Display/ShowVPS");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.showSpeed, "Display/ShowSpeed");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.enableSpeedLimiter, "Main/SpeedLimiterEnabled"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.enableSpeedLimiter, "Main/SpeedLimiterEnabled");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.increaseTimerResolution, SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.increaseTimerResolution,
"Main/IncreaseTimerResolution"); "Main/IncreaseTimerResolution");
SettingWidgetBinder::BindWidgetToNormalizedSetting(m_host_interface, m_ui.emulationSpeed, "Main/EmulationSpeed", SettingWidgetBinder::BindWidgetToNormalizedSetting(m_host_interface, m_ui.emulationSpeed, "Main/EmulationSpeed",
100.0f); 100.0f);
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pauseOnStart, "Main/StartPaused");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.startFullscreen, "Main/StartFullscreen");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.saveStateOnExit, "Main/SaveStateOnExit");
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.confirmPowerOff, "Main/ConfirmPowerOff");
connect(m_ui.enableSpeedLimiter, &QCheckBox::stateChanged, this, connect(m_ui.enableSpeedLimiter, &QCheckBox::stateChanged, this,
&GeneralSettingsWidget::onEnableSpeedLimiterStateChanged); &GeneralSettingsWidget::onEnableSpeedLimiterStateChanged);

View file

@ -27,19 +27,49 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="groupBox_4">
<property name="title"> <property name="title">
<string>Behaviour</string> <string>Behaviour</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QGridLayout" name="formLayout_4">
<item row="3" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_5"> <widget class="QCheckBox" name="pauseOnStart">
<property name="text"> <property name="text">
<string>Emulation Speed:</string> <string>Pause On Start</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="0" column="1">
<widget class="QCheckBox" name="startFullscreen">
<property name="text">
<string>Start Fullscreen</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="saveStateOnExit">
<property name="text">
<string>Save State On Exit</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="confirmPowerOff">
<property name="text">
<string>Confirm Power Off</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Emulation Speed</string>
</property>
<layout class="QGridLayout" name="formLayout_3">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QSlider" name="emulationSpeed"> <widget class="QSlider" name="emulationSpeed">
@ -78,45 +108,54 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0" colspan="2"> <item row="1" column="0">
<widget class="QCheckBox" name="enableSpeedLimiter"> <widget class="QCheckBox" name="enableSpeedLimiter">
<property name="text"> <property name="text">
<string>Enable Speed Limiter</string> <string>Enable Speed Limiter</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="2"> <item row="1" column="1">
<widget class="QCheckBox" name="increaseTimerResolution"> <widget class="QCheckBox" name="increaseTimerResolution">
<property name="text"> <property name="text">
<string>Increase Timer Resolution</string> <string>Increase Timer Resolution</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" colspan="2"> </layout>
<widget class="QCheckBox" name="pauseOnStart"> </widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>On-Screen Display</string>
</property>
<layout class="QGridLayout" name="formLayout_5">
<item row="2" column="0">
<widget class="QCheckBox" name="showOSDMessages">
<property name="text"> <property name="text">
<string>Pause On Start</string> <string>Show Messages</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0" colspan="2"> <item row="2" column="1">
<widget class="QCheckBox" name="startFullscreen"> <widget class="QCheckBox" name="showFPS">
<property name="text"> <property name="text">
<string>Start Fullscreen</string> <string>Show FPS</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0" colspan="2"> <item row="3" column="0">
<widget class="QCheckBox" name="saveStateOnExit"> <widget class="QCheckBox" name="showSpeed">
<property name="text"> <property name="text">
<string>Save State On Exit</string> <string>Show Emulation Speed</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="0" colspan="2"> <item row="3" column="1">
<widget class="QCheckBox" name="confirmPowerOff"> <widget class="QCheckBox" name="showVPS">
<property name="text"> <property name="text">
<string>Confirm Power Off</string> <string>Show VPS</string>
</property> </property>
</widget> </widget>
</item> </item>