summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2018-06-03 13:32:42 +0200
committerGitHub <noreply@github.com>2018-06-03 13:32:42 +0200
commit327eb1336b5b33ce50ff0c4320ef6d5074bfc930 (patch)
treeb81e85f30f0d02ca9d716c56ffa2f9deac5b3554 /Source/Core
parent1e51e263e05dffc0de136d406c76b41af8d0350f (diff)
parent9c26a1a458b3c291061c0f4671fcf253b1611134 (diff)
Merge pull request #7055 from spycrab/qt_other_state
Qt/Hotkeys: Implement missing "Other State Management" tab
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/CMakeLists.txt1
-rw-r--r--Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.cpp44
-rw-r--r--Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.h23
-rw-r--r--Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp2
-rw-r--r--Source/Core/DolphinQt2/DolphinQt2.vcxproj3
5 files changed, 73 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/CMakeLists.txt b/Source/Core/DolphinQt2/CMakeLists.txt
index 16eaadb2d7..e78fe5f628 100644
--- a/Source/Core/DolphinQt2/CMakeLists.txt
+++ b/Source/Core/DolphinQt2/CMakeLists.txt
@@ -54,6 +54,7 @@ add_executable(dolphin-emu
Config/Mapping/HotkeyGeneral.cpp
Config/Mapping/HotkeyGraphics.cpp
Config/Mapping/HotkeyStates.cpp
+ Config/Mapping/HotkeyStatesOther.cpp
Config/Mapping/HotkeyTAS.cpp
Config/Mapping/HotkeyWii.cpp
Config/Mapping/IOWindow.cpp
diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.cpp b/Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.cpp
new file mode 100644
index 0000000000..bbb1159893
--- /dev/null
+++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.cpp
@@ -0,0 +1,44 @@
+// Copyright 2018 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "DolphinQt2/Config/Mapping/HotkeyStatesOther.h"
+
+#include <QGroupBox>
+#include <QHBoxLayout>
+
+#include "Core/HotkeyManager.h"
+
+HotkeyStatesOther::HotkeyStatesOther(MappingWindow* window) : MappingWidget(window)
+{
+ CreateMainLayout();
+}
+
+void HotkeyStatesOther::CreateMainLayout()
+{
+ auto* layout = new QHBoxLayout;
+
+ layout->addWidget(
+ CreateGroupBox(tr("Select Last State"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_SELECT_STATE)));
+ layout->addWidget(CreateGroupBox(tr("Load Last State"),
+ HotkeyManagerEmu::GetHotkeyGroup(HKGP_LOAD_LAST_STATE)));
+ layout->addWidget(
+ CreateGroupBox(tr("Other State Hotkeys"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_STATE_MISC)));
+
+ setLayout(layout);
+}
+
+InputConfig* HotkeyStatesOther::GetConfig()
+{
+ return HotkeyManagerEmu::GetConfig();
+}
+
+void HotkeyStatesOther::LoadSettings()
+{
+ HotkeyManagerEmu::LoadConfig();
+}
+
+void HotkeyStatesOther::SaveSettings()
+{
+ HotkeyManagerEmu::GetConfig()->SaveConfig();
+}
diff --git a/Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.h b/Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.h
new file mode 100644
index 0000000000..4b71122abe
--- /dev/null
+++ b/Source/Core/DolphinQt2/Config/Mapping/HotkeyStatesOther.h
@@ -0,0 +1,23 @@
+// Copyright 2018 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "DolphinQt2/Config/Mapping/MappingWidget.h"
+
+class QHBoxLayout;
+
+class HotkeyStatesOther final : public MappingWidget
+{
+ Q_OBJECT
+public:
+ explicit HotkeyStatesOther(MappingWindow* window);
+
+ InputConfig* GetConfig() override;
+
+private:
+ void LoadSettings() override;
+ void SaveSettings() override;
+ void CreateMainLayout();
+};
diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
index d642f17f78..c405512e17 100644
--- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
+++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp
@@ -29,6 +29,7 @@
#include "DolphinQt2/Config/Mapping/HotkeyGeneral.h"
#include "DolphinQt2/Config/Mapping/HotkeyGraphics.h"
#include "DolphinQt2/Config/Mapping/HotkeyStates.h"
+#include "DolphinQt2/Config/Mapping/HotkeyStatesOther.h"
#include "DolphinQt2/Config/Mapping/HotkeyTAS.h"
#include "DolphinQt2/Config/Mapping/HotkeyWii.h"
#include "DolphinQt2/Config/Mapping/WiimoteEmuExtension.h"
@@ -318,6 +319,7 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
AddWidget(tr("Graphics"), new HotkeyGraphics(this));
AddWidget(tr("3D"), new Hotkey3D(this));
AddWidget(tr("Save and Load State"), new HotkeyStates(this));
+ AddWidget(tr("Other State Management"), new HotkeyStatesOther(this));
setWindowTitle(tr("Hotkey Settings"));
break;
}
diff --git a/Source/Core/DolphinQt2/DolphinQt2.vcxproj b/Source/Core/DolphinQt2/DolphinQt2.vcxproj
index decbae647a..9f6311f423 100644
--- a/Source/Core/DolphinQt2/DolphinQt2.vcxproj
+++ b/Source/Core/DolphinQt2/DolphinQt2.vcxproj
@@ -74,6 +74,7 @@
<QtMoc Include="Config\Mapping\HotkeyGeneral.h" />
<QtMoc Include="Config\Mapping\HotkeyGraphics.h" />
<QtMoc Include="Config\Mapping\HotkeyStates.h" />
+ <QtMoc Include="Config\Mapping\HotkeyStatesOther.h" />
<QtMoc Include="Config\Mapping\HotkeyTAS.h" />
<QtMoc Include="Config\Mapping\HotkeyWii.h" />
<QtMoc Include="Config\Mapping\IOWindow.h" />
@@ -207,6 +208,7 @@
<ClCompile Include="$(QtMocOutPrefix)HotkeyGraphics.cpp" />
<ClCompile Include="$(QtMocOutPrefix)HotkeyScheduler.cpp" />
<ClCompile Include="$(QtMocOutPrefix)HotkeyStates.cpp" />
+ <ClCompile Include="$(QtMocOutPrefix)HotkeyStatesOther.cpp" />
<ClCompile Include="$(QtMocOutPrefix)HotkeyTAS.cpp" />
<ClCompile Include="$(QtMocOutPrefix)HotkeyWii.cpp" />
<ClCompile Include="$(QtMocOutPrefix)IOWindow.cpp" />
@@ -285,6 +287,7 @@
<ClCompile Include="Config\Mapping\HotkeyGeneral.cpp" />
<ClCompile Include="Config\Mapping\HotkeyGraphics.cpp" />
<ClCompile Include="Config\Mapping\HotkeyStates.cpp" />
+ <ClCompile Include="Config\Mapping\HotkeyStatesOther.cpp" />
<ClCompile Include="Config\Mapping\HotkeyTAS.cpp" />
<ClCompile Include="Config\Mapping\HotkeyWii.cpp" />
<ClCompile Include="Config\Mapping\IOWindow.cpp" />