Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Qt: Implement hotkeys (+ configuration)
- Loading branch information
Showing
26 changed files
with
944 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include "DolphinQt2/Config/Mapping/Hotkey3D.h" | ||
|
||
#include <QGroupBox> | ||
#include <QHBoxLayout> | ||
|
||
#include "Core/HotkeyManager.h" | ||
|
||
Hotkey3D::Hotkey3D(MappingWindow* window) : MappingWidget(window) | ||
{ | ||
CreateMainLayout(); | ||
} | ||
|
||
void Hotkey3D::CreateMainLayout() | ||
{ | ||
m_main_layout = new QHBoxLayout(); | ||
|
||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("3D"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_3D_TOGGLE))); | ||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("3D Depth"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_3D_DEPTH))); | ||
|
||
setLayout(m_main_layout); | ||
} | ||
|
||
InputConfig* Hotkey3D::GetConfig() | ||
{ | ||
return HotkeyManagerEmu::GetConfig(); | ||
} | ||
|
||
void Hotkey3D::LoadSettings() | ||
{ | ||
HotkeyManagerEmu::LoadConfig(); | ||
} | ||
|
||
void Hotkey3D::SaveSettings() | ||
{ | ||
HotkeyManagerEmu::GetConfig()->SaveConfig(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#pragma once | ||
|
||
#include "DolphinQt2/Config/Mapping/MappingWidget.h" | ||
|
||
class QHBoxLayout; | ||
|
||
class Hotkey3D final : public MappingWidget | ||
{ | ||
public: | ||
explicit Hotkey3D(MappingWindow* window); | ||
|
||
InputConfig* GetConfig() override; | ||
|
||
private: | ||
void LoadSettings() override; | ||
void SaveSettings() override; | ||
void CreateMainLayout(); | ||
|
||
// Main | ||
QHBoxLayout* m_main_layout; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include "DolphinQt2/Config/Mapping/HotkeyGeneral.h" | ||
|
||
#include <QGroupBox> | ||
#include <QHBoxLayout> | ||
#include <QVBoxLayout> | ||
|
||
#include "Core/HotkeyManager.h" | ||
|
||
HotkeyGeneral::HotkeyGeneral(MappingWindow* window) : MappingWidget(window) | ||
{ | ||
CreateMainLayout(); | ||
} | ||
|
||
void HotkeyGeneral::CreateMainLayout() | ||
{ | ||
m_main_layout = new QHBoxLayout(); | ||
|
||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("General"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_GENERAL))); | ||
|
||
auto* vbox = new QVBoxLayout(); | ||
vbox->addWidget(CreateGroupBox(tr("Volume"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_VOLUME))); | ||
vbox->addWidget( | ||
CreateGroupBox(tr("Emulation Speed"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_SPEED))); | ||
m_main_layout->addItem(vbox); | ||
|
||
setLayout(m_main_layout); | ||
} | ||
|
||
InputConfig* HotkeyGeneral::GetConfig() | ||
{ | ||
return HotkeyManagerEmu::GetConfig(); | ||
} | ||
|
||
void HotkeyGeneral::LoadSettings() | ||
{ | ||
HotkeyManagerEmu::LoadConfig(); | ||
} | ||
|
||
void HotkeyGeneral::SaveSettings() | ||
{ | ||
HotkeyManagerEmu::GetConfig()->SaveConfig(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#pragma once | ||
|
||
#include "DolphinQt2/Config/Mapping/MappingWidget.h" | ||
|
||
class QHBoxLayout; | ||
|
||
class HotkeyGeneral final : public MappingWidget | ||
{ | ||
public: | ||
explicit HotkeyGeneral(MappingWindow* window); | ||
|
||
InputConfig* GetConfig() override; | ||
|
||
private: | ||
void LoadSettings() override; | ||
void SaveSettings() override; | ||
void CreateMainLayout(); | ||
|
||
// Main | ||
QHBoxLayout* m_main_layout; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include "DolphinQt2/Config/Mapping/HotkeyGraphics.h" | ||
|
||
#include <QGroupBox> | ||
#include <QHBoxLayout> | ||
#include <QVBoxLayout> | ||
|
||
#include "Core/HotkeyManager.h" | ||
|
||
HotkeyGraphics::HotkeyGraphics(MappingWindow* window) : MappingWidget(window) | ||
{ | ||
CreateMainLayout(); | ||
} | ||
|
||
void HotkeyGraphics::CreateMainLayout() | ||
{ | ||
m_main_layout = new QHBoxLayout(); | ||
|
||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("Freelook"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FREELOOK))); | ||
|
||
auto* vbox = new QVBoxLayout(); | ||
vbox->addWidget(CreateGroupBox(tr("Graphics Toggles"), | ||
HotkeyManagerEmu::GetHotkeyGroup(HKGP_GRAPHICS_TOGGLES))); | ||
vbox->addWidget( | ||
CreateGroupBox(tr("Internal Resolution"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_IR))); | ||
m_main_layout->addItem(vbox); | ||
|
||
setLayout(m_main_layout); | ||
} | ||
|
||
InputConfig* HotkeyGraphics::GetConfig() | ||
{ | ||
return HotkeyManagerEmu::GetConfig(); | ||
} | ||
|
||
void HotkeyGraphics::LoadSettings() | ||
{ | ||
HotkeyManagerEmu::LoadConfig(); | ||
} | ||
|
||
void HotkeyGraphics::SaveSettings() | ||
{ | ||
HotkeyManagerEmu::GetConfig()->SaveConfig(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#pragma once | ||
|
||
#include "DolphinQt2/Config/Mapping/MappingWidget.h" | ||
|
||
class QHBoxLayout; | ||
|
||
class HotkeyGraphics final : public MappingWidget | ||
{ | ||
public: | ||
explicit HotkeyGraphics(MappingWindow* window); | ||
|
||
InputConfig* GetConfig() override; | ||
|
||
private: | ||
void LoadSettings() override; | ||
void SaveSettings() override; | ||
void CreateMainLayout(); | ||
|
||
// Main | ||
QHBoxLayout* m_main_layout; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include "DolphinQt2/Config/Mapping/HotkeyStates.h" | ||
|
||
#include <QGroupBox> | ||
#include <QHBoxLayout> | ||
|
||
#include "Core/HotkeyManager.h" | ||
|
||
HotkeyStates::HotkeyStates(MappingWindow* window) : MappingWidget(window) | ||
{ | ||
CreateMainLayout(); | ||
} | ||
|
||
void HotkeyStates::CreateMainLayout() | ||
{ | ||
m_main_layout = new QHBoxLayout(); | ||
|
||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("Save"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_SAVE_STATE))); | ||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("Load"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_LOAD_STATE))); | ||
|
||
setLayout(m_main_layout); | ||
} | ||
|
||
InputConfig* HotkeyStates::GetConfig() | ||
{ | ||
return HotkeyManagerEmu::GetConfig(); | ||
} | ||
|
||
void HotkeyStates::LoadSettings() | ||
{ | ||
HotkeyManagerEmu::LoadConfig(); | ||
} | ||
|
||
void HotkeyStates::SaveSettings() | ||
{ | ||
HotkeyManagerEmu::GetConfig()->SaveConfig(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#pragma once | ||
|
||
#include "DolphinQt2/Config/Mapping/MappingWidget.h" | ||
|
||
class QHBoxLayout; | ||
|
||
class HotkeyStates final : public MappingWidget | ||
{ | ||
public: | ||
explicit HotkeyStates(MappingWindow* window); | ||
|
||
InputConfig* GetConfig() override; | ||
|
||
private: | ||
void LoadSettings() override; | ||
void SaveSettings() override; | ||
void CreateMainLayout(); | ||
|
||
// Main | ||
QHBoxLayout* m_main_layout; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#include "DolphinQt2/Config/Mapping/HotkeyTAS.h" | ||
|
||
#include <QGroupBox> | ||
#include <QHBoxLayout> | ||
|
||
#include "Core/HotkeyManager.h" | ||
|
||
HotkeyTAS::HotkeyTAS(MappingWindow* window) : MappingWidget(window) | ||
{ | ||
CreateMainLayout(); | ||
} | ||
|
||
void HotkeyTAS::CreateMainLayout() | ||
{ | ||
m_main_layout = new QHBoxLayout(); | ||
|
||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("Frame Advance"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FRAME_ADVANCE))); | ||
m_main_layout->addWidget( | ||
CreateGroupBox(tr("Movie"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_MOVIE))); | ||
|
||
setLayout(m_main_layout); | ||
} | ||
|
||
InputConfig* HotkeyTAS::GetConfig() | ||
{ | ||
return HotkeyManagerEmu::GetConfig(); | ||
} | ||
|
||
void HotkeyTAS::LoadSettings() | ||
{ | ||
HotkeyManagerEmu::LoadConfig(); | ||
} | ||
|
||
void HotkeyTAS::SaveSettings() | ||
{ | ||
HotkeyManagerEmu::GetConfig()->SaveConfig(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#pragma once | ||
|
||
#include "DolphinQt2/Config/Mapping/MappingWidget.h" | ||
|
||
class QHBoxLayout; | ||
|
||
class HotkeyTAS final : public MappingWidget | ||
{ | ||
public: | ||
explicit HotkeyTAS(MappingWindow* window); | ||
|
||
InputConfig* GetConfig() override; | ||
|
||
private: | ||
void LoadSettings() override; | ||
void SaveSettings() override; | ||
void CreateMainLayout(); | ||
|
||
// Main | ||
QHBoxLayout* m_main_layout; | ||
}; |
Oops, something went wrong.