citra-emu
/
citra-canary
Archived
1
0
Fork 0

Merge pull request #4858 from FearlessTobi/port-2504

Port yuzu-emu/yuzu#2504: "yuzu/configuration/config: Specify string conversions explicitly"
This commit is contained in:
Weiyi Wang 2019-07-27 16:34:18 -04:00 committed by GitHub
commit aca55d0378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 24 deletions

View File

@ -8,6 +8,7 @@
#include <QKeySequence> #include <QKeySequence>
#include <QSettings> #include <QSettings>
#include "citra_qt/configuration/config.h" #include "citra_qt/configuration/config.h"
#include "citra_qt/ui_settings.h"
#include "common/file_util.h" #include "common/file_util.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "input_common/main.h" #include "input_common/main.h"
@ -51,29 +52,31 @@ const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config:
}}; }};
// This shouldn't have anything except static initializers (no functions). So // This shouldn't have anything except static initializers (no functions). So
// QKeySequnce(...).toString() is NOT ALLOWED HERE. // QKeySequence(...).toString() is NOT ALLOWED HERE.
// This must be in alphabetical order according to action name as it must have the same order as // This must be in alphabetical order according to action name as it must have the same order as
// UISetting::values.shortcuts, which is alphabetically ordered. // UISetting::values.shortcuts, which is alphabetically ordered.
const std::array<UISettings::Shortcut, 19> Config::default_hotkeys{ // clang-format off
{{"Advance Frame", "Main Window", {"\\", Qt::ApplicationShortcut}}, const std::array<UISettings::Shortcut, 19> default_hotkeys{
{"Capture Screenshot", "Main Window", {"Ctrl+P", Qt::ApplicationShortcut}}, {{QStringLiteral("Advance Frame"), QStringLiteral("Main Window"), {QStringLiteral("\\"), Qt::ApplicationShortcut}},
{"Continue/Pause Emulation", "Main Window", {"F4", Qt::WindowShortcut}}, {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}},
{"Decrease Speed Limit", "Main Window", {"-", Qt::ApplicationShortcut}}, {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}},
{"Exit Citra", "Main Window", {"Ctrl+Q", Qt::WindowShortcut}}, {QStringLiteral("Decrease Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("-"), Qt::ApplicationShortcut}},
{"Exit Fullscreen", "Main Window", {"Esc", Qt::WindowShortcut}}, {QStringLiteral("Exit Citra"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), Qt::WindowShortcut}},
{"Fullscreen", "Main Window", {"F11", Qt::WindowShortcut}}, {QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), Qt::WindowShortcut}},
{"Increase Speed Limit", "Main Window", {"+", Qt::ApplicationShortcut}}, {QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), Qt::WindowShortcut}},
{"Load Amiibo", "Main Window", {"F2", Qt::ApplicationShortcut}}, {QStringLiteral("Increase Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("+"), Qt::ApplicationShortcut}},
{"Load File", "Main Window", {"Ctrl+O", Qt::WindowShortcut}}, {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), Qt::ApplicationShortcut}},
{"Remove Amiibo", "Main Window", {"F3", Qt::ApplicationShortcut}}, {QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), Qt::WindowShortcut}},
{"Restart Emulation", "Main Window", {"F6", Qt::WindowShortcut}}, {QStringLiteral("Remove Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F3"), Qt::ApplicationShortcut}},
{"Stop Emulation", "Main Window", {"F5", Qt::WindowShortcut}}, {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), Qt::WindowShortcut}},
{"Swap Screens", "Main Window", {"F9", Qt::WindowShortcut}}, {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}},
{"Toggle Filter Bar", "Main Window", {"Ctrl+F", Qt::WindowShortcut}}, {QStringLiteral("Swap Screens"), QStringLiteral("Main Window"), {QStringLiteral("F9"), Qt::WindowShortcut}},
{"Toggle Frame Advancing", "Main Window", {"Ctrl+A", Qt::ApplicationShortcut}}, {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}},
{"Toggle Screen Layout", "Main Window", {"F10", Qt::WindowShortcut}}, {QStringLiteral("Toggle Frame Advancing"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+A"), Qt::ApplicationShortcut}},
{"Toggle Speed Limit", "Main Window", {"Ctrl+Z", Qt::ApplicationShortcut}}, {QStringLiteral("Toggle Screen Layout"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::WindowShortcut}},
{"Toggle Status Bar", "Main Window", {"Ctrl+S", Qt::WindowShortcut}}}}; {QStringLiteral("Toggle Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Z"), Qt::ApplicationShortcut}},
{QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), Qt::WindowShortcut}}}};
// clang-format on
void Config::ReadValues() { void Config::ReadValues() {
qt_config->beginGroup("Controls"); qt_config->beginGroup("Controls");

View File

@ -8,7 +8,6 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include <QVariant> #include <QVariant>
#include "citra_qt/ui_settings.h"
#include "core/settings.h" #include "core/settings.h"
class QSettings; class QSettings;
@ -32,8 +31,6 @@ private:
void WriteSetting(const QString& name, const QVariant& value); void WriteSetting(const QString& name, const QVariant& value);
void WriteSetting(const QString& name, const QVariant& value, const QVariant& default_value); void WriteSetting(const QString& name, const QVariant& value, const QVariant& default_value);
static const std::array<UISettings::Shortcut, 19> default_hotkeys;
std::unique_ptr<QSettings> qt_config; std::unique_ptr<QSettings> qt_config;
std::string qt_config_loc; std::string qt_config_loc;
}; };