From 988acf588a01367389b7e86de772066473fb0fce Mon Sep 17 00:00:00 2001 From: Adityarup Laha <30696515+adityaruplaha@users.noreply.github.com> Date: Sat, 17 Nov 2018 16:55:05 +0530 Subject: [PATCH] citra-qt: Add back missing hotkeys & conflict fixes. * Also fixed a missing spacer in ConfigureGeneral. --- src/citra_qt/configuration/config.cpp | 14 ++++++++++++-- src/citra_qt/configuration/configure_dialog.cpp | 6 +++--- src/citra_qt/configuration/configure_dialog.h | 3 ++- src/citra_qt/configuration/configure_general.ui | 13 +++++++++++++ src/citra_qt/main.cpp | 2 +- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index 878defdda..c12c90507 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -320,7 +320,7 @@ void Config::ReadValues() { qt_config->endGroup(); qt_config->beginGroup("Shortcuts"); - const std::array default_hotkeys{ + const std::array default_hotkeys{ {{"Load File", "Main Window", UISettings::ContextualShortcut(QKeySequence(QKeySequence::Open).toString(), Qt::WindowShortcut)}, @@ -349,7 +349,17 @@ void Config::ReadValues() { {"Increase Speed Limit", "Main Window", UISettings::ContextualShortcut("+", Qt::ApplicationShortcut)}, {"Decrease Speed Limit", "Main Window", - UISettings::ContextualShortcut("-", Qt::ApplicationShortcut)}}}; + UISettings::ContextualShortcut("-", Qt::ApplicationShortcut)}, + {"Advance Frame", "Main Window", + UISettings::ContextualShortcut("\\", Qt::ApplicationShortcut)}, + {"Toggle Frame Advancing", "Main Window", + UISettings::ContextualShortcut("Ctrl+A", Qt::ApplicationShortcut)}, + {"Load Amiibo", "Main Window", + UISettings::ContextualShortcut("F2", Qt::ApplicationShortcut)}, + {"Remove Amiibo", "Main Window", + UISettings::ContextualShortcut("F3", Qt::ApplicationShortcut)}, + {"Capture Screenshot", "Main Window", + UISettings::ContextualShortcut("Ctrl+P", Qt::ApplicationShortcut)}}}; for (int i = 0; i < default_hotkeys.size(); i++) { qt_config->beginGroup(default_hotkeys[i].group); diff --git a/src/citra_qt/configuration/configure_dialog.cpp b/src/citra_qt/configuration/configure_dialog.cpp index 8d0d89c3b..a5d3d4fe9 100644 --- a/src/citra_qt/configuration/configure_dialog.cpp +++ b/src/citra_qt/configuration/configure_dialog.cpp @@ -10,8 +10,8 @@ #include "core/settings.h" #include "ui_configure.h" -ConfigureDialog::ConfigureDialog(QWidget* parent, const HotkeyRegistry& registry) - : QDialog(parent), ui(new Ui::ConfigureDialog) { +ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry) + : QDialog(parent), registry(registry), ui(new Ui::ConfigureDialog) { ui->setupUi(this); ui->hotkeysTab->Populate(registry); @@ -47,7 +47,7 @@ void ConfigureDialog::setConfiguration() { ui->uiTab->setConfiguration(); } -void ConfigureDialog::applyConfiguration(HotkeyRegistry& registry) { +void ConfigureDialog::applyConfiguration() { ui->generalTab->applyConfiguration(); ui->systemTab->applyConfiguration(); ui->inputTab->applyConfiguration(); diff --git a/src/citra_qt/configuration/configure_dialog.h b/src/citra_qt/configuration/configure_dialog.h index 40bc94e76..39ece2847 100644 --- a/src/citra_qt/configuration/configure_dialog.h +++ b/src/citra_qt/configuration/configure_dialog.h @@ -22,7 +22,7 @@ public: void UpdateVisibleTabs(); void PopulateSelectionList(); - void applyConfiguration(HotkeyRegistry& registry); + void applyConfiguration(); private slots: void onLanguageChanged(const QString& locale); @@ -35,4 +35,5 @@ private: void retranslateUi(); std::unique_ptr ui; + HotkeyRegistry& registry; }; diff --git a/src/citra_qt/configuration/configure_general.ui b/src/citra_qt/configuration/configure_general.ui index 3879e6b77..f33fb9d98 100644 --- a/src/citra_qt/configuration/configure_general.ui +++ b/src/citra_qt/configuration/configure_general.ui @@ -122,6 +122,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 7da699b98..6ff7e3b2b 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1325,7 +1325,7 @@ void GMainWindow::OnConfigure() { const bool old_discord_presence = UISettings::values.enable_discord_presence; auto result = configureDialog.exec(); if (result == QDialog::Accepted) { - configureDialog.applyConfiguration(hotkey_registry); + configureDialog.applyConfiguration(); InitializeHotkeys(); if (UISettings::values.theme != old_theme) UpdateUITheme();