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