Merge pull request #7055 from spycrab/qt_other_state

Qt/Hotkeys: Implement missing "Other State Management" tab
This commit is contained in:
spycrab 2018-06-03 13:32:42 +02:00 committed by GitHub
commit 327eb1336b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 73 additions and 0 deletions

View File

@ -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

View File

@ -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();
}

View File

@ -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();
};

View File

@ -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;
}

View File

@ -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" />