diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configure_input_simple.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/yuzu/configuration/configure_input_simple.cpp b/src/yuzu/configuration/configure_input_simple.cpp index b4f3724bd..07d71e9d1 100644 --- a/src/yuzu/configuration/configure_input_simple.cpp +++ b/src/yuzu/configuration/configure_input_simple.cpp | |||
| @@ -3,12 +3,8 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <array> | 5 | #include <array> |
| 6 | #include <cstring> | ||
| 7 | #include <functional> | ||
| 8 | #include <tuple> | 6 | #include <tuple> |
| 9 | 7 | ||
| 10 | #include <QDialog> | ||
| 11 | |||
| 12 | #include "ui_configure_input_simple.h" | 8 | #include "ui_configure_input_simple.h" |
| 13 | #include "yuzu/configuration/configure_input.h" | 9 | #include "yuzu/configuration/configure_input.h" |
| 14 | #include "yuzu/configuration/configure_input_player.h" | 10 | #include "yuzu/configuration/configure_input_player.h" |
| @@ -73,20 +69,18 @@ void DualJoyconsDockedOnProfileSelect() { | |||
| 73 | 69 | ||
| 74 | // Name, OnProfileSelect (called when selected in drop down), OnConfigure (called when configure | 70 | // Name, OnProfileSelect (called when selected in drop down), OnConfigure (called when configure |
| 75 | // is clicked) | 71 | // is clicked) |
| 76 | using InputProfile = | 72 | using InputProfile = std::tuple<const char*, void (*)(), void (*)(ConfigureInputSimple*)>; |
| 77 | std::tuple<QString, std::function<void()>, std::function<void(ConfigureInputSimple*)>>; | ||
| 78 | 73 | ||
| 79 | const std::array<InputProfile, 3> INPUT_PROFILES{{ | 74 | constexpr std::array<InputProfile, 3> INPUT_PROFILES{{ |
| 80 | {ConfigureInputSimple::tr("Single Player - Handheld - Undocked"), HandheldOnProfileSelect, | 75 | {QT_TR_NOOP("Single Player - Handheld - Undocked"), HandheldOnProfileSelect, |
| 81 | [](ConfigureInputSimple* caller) { | 76 | [](ConfigureInputSimple* caller) { |
| 82 | CallConfigureDialog<ConfigureInputPlayer>(caller, HANDHELD_INDEX, false); | 77 | CallConfigureDialog<ConfigureInputPlayer>(caller, HANDHELD_INDEX, false); |
| 83 | }}, | 78 | }}, |
| 84 | {ConfigureInputSimple::tr("Single Player - Dual Joycons - Docked"), | 79 | {QT_TR_NOOP("Single Player - Dual Joycons - Docked"), DualJoyconsDockedOnProfileSelect, |
| 85 | DualJoyconsDockedOnProfileSelect, | ||
| 86 | [](ConfigureInputSimple* caller) { | 80 | [](ConfigureInputSimple* caller) { |
| 87 | CallConfigureDialog<ConfigureInputPlayer>(caller, 1, false); | 81 | CallConfigureDialog<ConfigureInputPlayer>(caller, 1, false); |
| 88 | }}, | 82 | }}, |
| 89 | {ConfigureInputSimple::tr("Custom"), [] {}, CallConfigureDialog<ConfigureInput>}, | 83 | {QT_TR_NOOP("Custom"), [] {}, CallConfigureDialog<ConfigureInput>}, |
| 90 | }}; | 84 | }}; |
| 91 | 85 | ||
| 92 | } // namespace | 86 | } // namespace |
| @@ -101,7 +95,8 @@ ConfigureInputSimple::ConfigureInputSimple(QWidget* parent) | |||
| 101 | ui->setupUi(this); | 95 | ui->setupUi(this); |
| 102 | 96 | ||
| 103 | for (const auto& profile : INPUT_PROFILES) { | 97 | for (const auto& profile : INPUT_PROFILES) { |
| 104 | ui->profile_combobox->addItem(std::get<0>(profile), std::get<0>(profile)); | 98 | const QString label = tr(std::get<0>(profile)); |
| 99 | ui->profile_combobox->addItem(label, label); | ||
| 105 | } | 100 | } |
| 106 | 101 | ||
| 107 | connect(ui->profile_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, | 102 | connect(ui->profile_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, |