mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
Merge pull request #6287 from spycrab/qt_gamecube
Qt/Settings: Implement "GameCube pane"
This commit is contained in:
45
Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.cpp
Normal file
45
Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
// Copyright 2018 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "DolphinQt2/Config/Mapping/GCMicrophone.h"
|
||||
|
||||
#include "InputCommon/InputConfig.h"
|
||||
|
||||
#include "Core/HW/GCPad.h"
|
||||
#include "Core/HW/GCPadEmu.h"
|
||||
|
||||
GCMicrophone::GCMicrophone(MappingWindow* window) : MappingWidget(window)
|
||||
{
|
||||
CreateMainLayout();
|
||||
}
|
||||
|
||||
void GCMicrophone::CreateMainLayout()
|
||||
{
|
||||
m_main_layout = new QHBoxLayout();
|
||||
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(tr("Microphone"), Pad::GetGroup(GetPort(), PadGroup::Mic)));
|
||||
|
||||
setLayout(m_main_layout);
|
||||
}
|
||||
|
||||
void GCMicrophone::LoadSettings()
|
||||
{
|
||||
Pad::LoadConfig();
|
||||
}
|
||||
|
||||
void GCMicrophone::SaveSettings()
|
||||
{
|
||||
Pad::GetConfig()->SaveConfig();
|
||||
}
|
||||
|
||||
InputConfig* GCMicrophone::GetConfig()
|
||||
{
|
||||
return Pad::GetConfig();
|
||||
}
|
29
Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.h
Normal file
29
Source/Core/DolphinQt2/Config/Mapping/GCMicrophone.h
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright 2018 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DolphinQt2/Config/Mapping/MappingWidget.h"
|
||||
|
||||
class QCheckBox;
|
||||
class QFormLayout;
|
||||
class QGroupBox;
|
||||
class QHBoxLayout;
|
||||
class QLabel;
|
||||
class QVBoxLayout;
|
||||
|
||||
class GCMicrophone final : public MappingWidget
|
||||
{
|
||||
public:
|
||||
explicit GCMicrophone(MappingWindow* window);
|
||||
|
||||
InputConfig* GetConfig() override;
|
||||
|
||||
private:
|
||||
void LoadSettings() override;
|
||||
void SaveSettings() override;
|
||||
void CreateMainLayout();
|
||||
|
||||
QHBoxLayout* m_main_layout;
|
||||
};
|
@ -19,6 +19,7 @@
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinQt2/Config/Mapping/GCKeyboardEmu.h"
|
||||
#include "DolphinQt2/Config/Mapping/GCMicrophone.h"
|
||||
#include "DolphinQt2/Config/Mapping/GCPadEmu.h"
|
||||
#include "DolphinQt2/Config/Mapping/Hotkey3D.h"
|
||||
#include "DolphinQt2/Config/Mapping/HotkeyGeneral.h"
|
||||
@ -254,6 +255,12 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
|
||||
setWindowTitle(tr("GameCube Controller at Port %1").arg(GetPort() + 1));
|
||||
AddWidget(tr("GameCube Controller"), widget);
|
||||
break;
|
||||
case Type::MAPPING_GC_MICROPHONE:
|
||||
widget = new GCMicrophone(this);
|
||||
setWindowTitle(tr("GameCube Microphone Slot %1")
|
||||
.arg(GetPort() == 0 ? QStringLiteral("A") : QStringLiteral("B")));
|
||||
AddWidget(tr("Microphone"), widget);
|
||||
break;
|
||||
case Type::MAPPING_WIIMOTE_EMU:
|
||||
case Type::MAPPING_WIIMOTE_HYBRID:
|
||||
{
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
MAPPING_GC_KEYBOARD,
|
||||
MAPPING_GCPAD,
|
||||
MAPPING_GC_STEERINGWHEEL,
|
||||
MAPPING_GC_MICROPHONE,
|
||||
// Wii
|
||||
MAPPING_WIIMOTE_EMU,
|
||||
MAPPING_WIIMOTE_HYBRID,
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "DolphinQt2/Settings.h"
|
||||
#include "DolphinQt2/Settings/AdvancedPane.h"
|
||||
#include "DolphinQt2/Settings/AudioPane.h"
|
||||
#include "DolphinQt2/Settings/GameCubePane.h"
|
||||
#include "DolphinQt2/Settings/GeneralPane.h"
|
||||
#include "DolphinQt2/Settings/InterfacePane.h"
|
||||
#include "DolphinQt2/Settings/PathPane.h"
|
||||
@ -42,6 +43,7 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
|
||||
m_general_pane_index = AddTab(m_tabs, tr("General"), new GeneralPane(), "config");
|
||||
AddTab(m_tabs, tr("Interface"), new InterfacePane(), "browse");
|
||||
m_audio_pane_index = AddTab(m_tabs, tr("Audio"), new AudioPane(), "play");
|
||||
AddTab(m_tabs, tr("GameCube"), new GameCubePane(), "gcpad");
|
||||
AddTab(m_tabs, tr("Paths"), new PathPane(), "browse");
|
||||
AddTab(m_tabs, tr("Advanced"), new AdvancedPane(), "config");
|
||||
|
||||
|
Reference in New Issue
Block a user