| 1 | // Copyright 2018 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #include "DolphinQt/Config/Mapping/HotkeyControllerProfile.h" |
| 5 | |
| 6 | #include <QGridLayout> |
| 7 | #include <QGroupBox> |
| 8 | |
| 9 | #include "Core/HotkeyManager.h" |
| 10 | |
| 11 | HotkeyControllerProfile::HotkeyControllerProfile(MappingWindow* window) : MappingWidget(window) |
| 12 | { |
| 13 | CreateMainLayout(); |
| 14 | } |
| 15 | |
| 16 | void HotkeyControllerProfile::CreateMainLayout() |
| 17 | { |
| 18 | const auto main_layout = new QGridLayout; |
| 19 | |
| 20 | main_layout->addWidget( |
| 21 | CreateGroupBox(tr("Wii Remote %1").arg(1), |
| 22 | HotkeyManagerEmu::GetHotkeyGroup(HKGP_CONTROLLER_PROFILE_1)), |
| 23 | 0, 0); |
| 24 | |
| 25 | main_layout->addWidget( |
| 26 | CreateGroupBox(tr("Wii Remote %1").arg(2), |
| 27 | HotkeyManagerEmu::GetHotkeyGroup(HKGP_CONTROLLER_PROFILE_2)), |
| 28 | 0, 1); |
| 29 | |
| 30 | main_layout->addWidget( |
| 31 | CreateGroupBox(tr("Wii Remote %1").arg(3), |
| 32 | HotkeyManagerEmu::GetHotkeyGroup(HKGP_CONTROLLER_PROFILE_3)), |
| 33 | 1, 0); |
| 34 | |
| 35 | main_layout->addWidget( |
| 36 | CreateGroupBox(tr("Wii Remote %1").arg(4), |
| 37 | HotkeyManagerEmu::GetHotkeyGroup(HKGP_CONTROLLER_PROFILE_4)), |
| 38 | 1, 1); |
| 39 | |
| 40 | setLayout(main_layout); |
| 41 | } |
| 42 | |
| 43 | InputConfig* HotkeyControllerProfile::GetConfig() |
| 44 | { |
| 45 | return HotkeyManagerEmu::GetConfig(); |
| 46 | } |
| 47 | |
| 48 | void HotkeyControllerProfile::LoadSettings() |
| 49 | { |
| 50 | HotkeyManagerEmu::LoadConfig(); |
| 51 | } |
| 52 | |
| 53 | void HotkeyControllerProfile::SaveSettings() |
| 54 | { |
| 55 | HotkeyManagerEmu::GetConfig()->SaveConfig(); |
| 56 | } |