Skip to content

Commit

Permalink
Qt: Move savestate related options to its new home
Browse files Browse the repository at this point in the history
  • Loading branch information
kamfretoz authored and F0bes committed Oct 5, 2024
1 parent a304959 commit 2ab24bb
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 113 deletions.
11 changes: 11 additions & 0 deletions pcsx2-qt/Settings/AdvancedSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget*
connect(m_ui.savestateCompressionMethod, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&AdvancedSettingsWidget::onSavestateCompressionTypeChanged);

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false);

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pineEnable, "EmuCore", "EnablePINE", false);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.pineSlot, "EmuCore", "PINESlot", 28011);

Expand Down Expand Up @@ -138,6 +141,14 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget*

dialog->registerWidgetHelp(m_ui.savestateCompressionLevel, tr("Savestate Compression Level"), tr("Medium"),
tr("Determines the level to be used when compressing savestates."));

dialog->registerWidgetHelp(m_ui.saveStateOnShutdown, tr("Save State On Shutdown"), tr("Unchecked"),
tr("Automatically saves the emulator state when powering down or exiting. You can then "
"resume directly from where you left off next time."));

dialog->registerWidgetHelp(m_ui.backupSaveStates, tr("Create Save State Backups"), tr("Checked"),
//: Do not translate the ".backup" extension.
tr("Creates a backup copy of a save state if it already exists when the save is created. The backup copy has a .backup suffix."));
}

AdvancedSettingsWidget::~AdvancedSettingsWidget() = default;
Expand Down
162 changes: 88 additions & 74 deletions pcsx2-qt/Settings/AdvancedSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>809</width>
<height>725</height>
<height>602</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
Expand All @@ -32,9 +32,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-272</y>
<y>0</y>
<width>790</width>
<height>997</height>
<height>1023</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -416,6 +416,91 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="savestateSettings">
<property name="title">
<string>Savestate Settings</string>
</property>
<layout class="QGridLayout" name="savestateSettingsLayout">
<item row="0" column="0">
<widget class="QLabel" name="savestateCompressionLabel">
<property name="text">
<string>Compression Method:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="savestateCompressionLevel">
<item>
<property name="text">
<string>Low (Fast)</string>
</property>
</item>
<item>
<property name="text">
<string>Medium (Recommended)</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Very High (Slow, Not Recommended)</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="savestateCompressionMethod">
<item>
<property name="text">
<string>Uncompressed</string>
</property>
</item>
<item>
<property name="text">
<string>Deflate64</string>
</property>
</item>
<item>
<property name="text">
<string>Zstandard</string>
</property>
</item>
<item>
<property name="text">
<string>LZMA2</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="savestateCompressionMethodLabel">
<property name="text">
<string>Compression Level:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="backupSaveStates">
<property name="text">
<string>Create Save State Backups</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="saveStateOnShutdown">
<property name="text">
<string>Save State On Shutdown</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="framerateControlSettings">
<property name="title">
Expand Down Expand Up @@ -471,77 +556,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="savestateSettings">
<property name="title">
<string>Savestate Settings</string>
</property>
<layout class="QGridLayout" name="savestateSettingsLayout">
<item row="1" column="0">
<widget class="QLabel" name="savestateCompressionMethodLabel">
<property name="text">
<string>Compression Level:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="savestateCompressionLabel">
<property name="text">
<string>Compression Method:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="savestateCompressionMethod">
<item>
<property name="text">
<string>Uncompressed</string>
</property>
</item>
<item>
<property name="text">
<string>Deflate64</string>
</property>
</item>
<item>
<property name="text">
<string>Zstandard</string>
</property>
</item>
<item>
<property name="text">
<string>LZMA2</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="savestateCompressionLevel">
<item>
<property name="text">
<string>Low (Fast)</string>
</property>
</item>
<item>
<property name="text">
<string>Medium (Recommended)</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Very High (Slow, Not Recommended)</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="pineSettings">
<property name="title">
Expand Down
8 changes: 0 additions & 8 deletions pcsx2-qt/Settings/InterfaceSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.inhibitScreensaver, "EmuCore", "InhibitScreensaver", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.confirmShutdown, "UI", "ConfirmShutdown", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnFocusLoss, "UI", "PauseOnFocusLoss", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnControllerDisconnection, "UI", "PauseOnControllerDisconnection", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.discordPresence, "EmuCore", "EnableDiscordPresence", false);

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "UI", "StartFullscreen", false);
Expand Down Expand Up @@ -143,19 +141,13 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
m_ui.confirmShutdown, tr("Confirm Shutdown"), tr("Checked"),
tr("Determines whether a prompt will be displayed to confirm shutting down the virtual machine "
"when the hotkey is pressed."));
dialog->registerWidgetHelp(m_ui.saveStateOnShutdown, tr("Save State On Shutdown"), tr("Unchecked"),
tr("Automatically saves the emulator state when powering down or exiting. You can then "
"resume directly from where you left off next time."));
dialog->registerWidgetHelp(m_ui.pauseOnStart, tr("Pause On Start"), tr("Unchecked"),
tr("Pauses the emulator when a game is started."));
dialog->registerWidgetHelp(m_ui.pauseOnFocusLoss, tr("Pause On Focus Loss"), tr("Unchecked"),
tr("Pauses the emulator when you minimize the window or switch to another application, "
"and unpauses when you switch back."));
dialog->registerWidgetHelp(m_ui.pauseOnControllerDisconnection, tr("Pause On Controller Disconnection"),
tr("Unchecked"), tr("Pauses the emulator when a controller with bindings is disconnected."));
dialog->registerWidgetHelp(m_ui.backupSaveStates, tr("Create Save State Backups"), tr("Checked"),
//: Do not translate the ".backup" extension.
tr("Creates a backup copy of a save state if it already exists when the save is created. The backup copy has a .backup suffix."));
dialog->registerWidgetHelp(m_ui.startFullscreen, tr("Start Fullscreen"), tr("Unchecked"),
tr("Automatically switches to fullscreen mode when a game is started."));
dialog->registerWidgetHelp(m_ui.hideMouseCursor, tr("Hide Cursor In Fullscreen"), tr("Unchecked"),
Expand Down
48 changes: 17 additions & 31 deletions pcsx2-qt/Settings/InterfaceSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>698</width>
<height>494</height>
<height>512</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand All @@ -24,18 +24,11 @@
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox_4">
<widget class="QGroupBox" name="behaviourGroup">
<property name="title">
<string>Behaviour</string>
</property>
<layout class="QGridLayout" name="formLayout_4">
<item row="0" column="1">
<widget class="QCheckBox" name="saveStateOnShutdown">
<property name="text">
<string>Save State On Shutdown</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="inhibitScreensaver">
<property name="text">
Expand All @@ -50,17 +43,17 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="pauseOnStart">
<item row="2" column="0">
<widget class="QCheckBox" name="discordPresence">
<property name="text">
<string>Pause On Start</string>
<string>Enable Discord Presence</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="pauseOnFocusLoss">
<item row="1" column="1">
<widget class="QCheckBox" name="pauseOnStart">
<property name="text">
<string>Pause On Focus Loss</string>
<string>Pause On Start</string>
</property>
</widget>
</item>
Expand All @@ -71,25 +64,18 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="discordPresence">
<property name="text">
<string>Enable Discord Presence</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="backupSaveStates">
<item row="0" column="1">
<widget class="QCheckBox" name="pauseOnFocusLoss">
<property name="text">
<string>Create Save State Backups</string>
<string>Pause On Focus Loss</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<widget class="QGroupBox" name="gameDisplayGroup">
<property name="title">
<string>Game Display</string>
</property>
Expand Down Expand Up @@ -146,7 +132,7 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="languageLabel">
<property name="text">
<string>Language:</string>
</property>
Expand All @@ -156,7 +142,7 @@
<widget class="QComboBox" name="language"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="themeLabel">
<property name="text">
<string>Theme:</string>
</property>
Expand All @@ -182,14 +168,14 @@
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="updaterChannelLabel">
<property name="text">
<string>Update Channel:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="currentVersionLabel">
<property name="text">
<string>Current Version:</string>
</property>
Expand All @@ -199,7 +185,7 @@
<widget class="QComboBox" name="autoUpdateTag"/>
</item>
<item row="2" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
<layout class="QHBoxLayout" name="automaticUpdaterCheckGroup" stretch="1,0">
<item>
<widget class="QCheckBox" name="autoUpdateEnabled">
<property name="text">
Expand Down

0 comments on commit 2ab24bb

Please sign in to comment.