Some code cleanup

This commit is contained in:
Kleidis 2024-11-13 02:53:17 +01:00 committed by OpenSauce04
parent f7a670cc29
commit 86432c8fc1
4 changed files with 13 additions and 15 deletions

View File

@ -780,8 +780,7 @@ void GMainWindow::InitializeHotkeys() {
});
connect_shortcut(QStringLiteral("Toggle Per-Application Speed"), [&] {
if (!hotkey_registry
.GetKeySequence(QStringLiteral("Main Window"),
QStringLiteral("Toggle Custom Emulation Speed"))
.GetKeySequence(QStringLiteral("Main Window"), QStringLiteral("Toggle Turbo Mode"))
.isEmpty()) {
return;
}
@ -793,16 +792,11 @@ void GMainWindow::InitializeHotkeys() {
connect_shortcut(QStringLiteral("Toggle Custom Textures"),
[&] { Settings::values.custom_textures = !Settings::values.custom_textures; });
connect_shortcut(QStringLiteral("Toggle Custom Emulation Speed"), &GMainWindow::ToggleEmulationSpeed);
connect_shortcut(QStringLiteral("Toggle Turbo Mode"), &GMainWindow::ToggleEmulationSpeed);
connect_shortcut(QStringLiteral("Increase Speed Limit"), [&] {
AdjustSpeedLimit(true);
});
connect_shortcut(QStringLiteral("Decrease Speed Limit"), [&] {
AdjustSpeedLimit(false);
});
connect_shortcut(QStringLiteral("Increase Speed Limit"), [&] { AdjustSpeedLimit(true); });
connect_shortcut(QStringLiteral("Decrease Speed Limit"), [&] { AdjustSpeedLimit(false); });
connect_shortcut(QStringLiteral("Audio Mute/Unmute"), &GMainWindow::OnMute);
connect_shortcut(QStringLiteral("Audio Volume Down"), &GMainWindow::OnDecreaseVolume);

View File

@ -83,7 +83,7 @@ const std::array<UISettings::Shortcut, 36> QtConfig::default_hotkeys {{
{QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}},
{QStringLiteral("Swap Screens"), QStringLiteral("Main Window"), {QStringLiteral("F9"), Qt::WindowShortcut}},
{QStringLiteral("Toggle 3D"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+3"), Qt::ApplicationShortcut}},
{QStringLiteral("Toggle Custom Emulation Speed"), QStringLiteral("Main Window"), {QStringLiteral("+"), Qt::ApplicationShortcut}},
{QStringLiteral("Toggle Turbo Mode"), QStringLiteral("Main Window"), {QStringLiteral(""), Qt::ApplicationShortcut}},
{QStringLiteral("Toggle Custom Textures"), QStringLiteral("Main Window"), {QStringLiteral("F7"), Qt::ApplicationShortcut}},
{QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}},
{QStringLiteral("Toggle Frame Advancing"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+A"), Qt::ApplicationShortcut}},

View File

@ -30,7 +30,8 @@ ConfigureGeneral::ConfigureGeneral(bool is_powered_on, QWidget* parent)
connect(ui->turbo_speed_slider, &QSlider::valueChanged, this, [&](int value) {
UISettings::values.turbo_speed_slider.SetValue(SliderToSettings(value));
ui->turbo_speed_display_label->setText(QStringLiteral("%1%").arg(UISettings::values.turbo_speed_slider.GetValue()));
ui->turbo_speed_display_label->setText(
QStringLiteral("%1%").arg(UISettings::values.turbo_speed_slider.GetValue()));
});
// Set a minimum width for the label to prevent the slider from changing size.
@ -75,7 +76,10 @@ ConfigureGeneral::~ConfigureGeneral() = default;
void ConfigureGeneral::SetConfiguration() {
if (Settings::IsConfiguringGlobal()) {
ui->turbo_speed_slider->setValue(SettingsToSlider(UISettings::values.turbo_speed_slider.GetValue()));
ui->turbo_speed_slider->setValue(
SettingsToSlider(UISettings::values.turbo_speed_slider.GetValue()));
ui->turbo_speed_display_label->setText(
QStringLiteral("%1%").arg(UISettings::values.turbo_speed_slider.GetValue()));
ui->toggle_check_exit->setChecked(UISettings::values.confirm_before_closing.GetValue());
ui->toggle_background_pause->setChecked(

View File

@ -76,7 +76,7 @@ struct Values {
Settings::Setting<bool> show_filter_bar{true, "showFilterBar"};
Settings::Setting<bool> show_status_bar{true, "showStatusBar"};
Settings::Setting<int> turbo_speed_slider{100, "turboSpeedSlider"};
Settings::Setting<int> turbo_speed_slider{200, "turboSpeedSlider"};
Settings::Setting<bool> confirm_before_closing{true, "confirmClose"};
Settings::Setting<bool> save_state_warning{true, "saveStateWarning"};
Settings::Setting<bool> first_start{true, "firstStart"};