mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
DolphinQt: Rename "Keyboard" to "Keyboard Controller" and add warning text.
This commit is contained in:
parent
296959ec58
commit
e9af3d945a
@ -40,7 +40,7 @@ static constexpr std::array s_gc_types = {
|
||||
SIDeviceName{SerialInterface::SIDEVICE_GC_GBA_EMULATED, _trans("GBA (Integrated)")},
|
||||
#endif
|
||||
SIDeviceName{SerialInterface::SIDEVICE_GC_GBA, _trans("GBA (TCP)")},
|
||||
SIDeviceName{SerialInterface::SIDEVICE_GC_KEYBOARD, _trans("Keyboard")},
|
||||
SIDeviceName{SerialInterface::SIDEVICE_GC_KEYBOARD, _trans("Keyboard Controller")},
|
||||
};
|
||||
|
||||
static std::optional<int> ToGCMenuIndex(const SerialInterface::SIDevices sidevice)
|
||||
|
@ -6,6 +6,8 @@
|
||||
#include <QFormLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QStyle>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "InputCommon/InputConfig.h"
|
||||
@ -20,26 +22,32 @@ GCKeyboardEmu::GCKeyboardEmu(MappingWindow* window) : MappingWidget(window)
|
||||
|
||||
void GCKeyboardEmu::CreateMainLayout()
|
||||
{
|
||||
m_main_layout = new QHBoxLayout();
|
||||
const auto vbox_layout = new QVBoxLayout;
|
||||
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(QString{}, Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb0x)));
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(QString{}, Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb1x)));
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(QString{}, Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb2x)));
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(QString{}, Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb3x)));
|
||||
m_main_layout->addWidget(
|
||||
CreateGroupBox(QString{}, Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb4x)));
|
||||
const auto warning_layout = new QHBoxLayout;
|
||||
vbox_layout->addLayout(warning_layout);
|
||||
|
||||
auto* vbox_layout = new QVBoxLayout();
|
||||
vbox_layout->addWidget(
|
||||
CreateGroupBox(QString{}, Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb5x)));
|
||||
const auto warning_icon = new QLabel;
|
||||
const auto size = QFontMetrics(font()).height() * 3 / 2;
|
||||
warning_icon->setPixmap(style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(size, size));
|
||||
warning_layout->addWidget(warning_icon);
|
||||
|
||||
m_main_layout->addLayout(vbox_layout);
|
||||
const auto warning_text =
|
||||
new QLabel(tr("You are configuring a \"Keyboard Controller\". "
|
||||
"This device is exclusively for \"Phantasy Star Online Episode I & II\". "
|
||||
"If you are unsure, turn back now and configure a \"Standard Controller\"."));
|
||||
warning_text->setWordWrap(true);
|
||||
warning_layout->addWidget(warning_text, 1);
|
||||
|
||||
setLayout(m_main_layout);
|
||||
const auto layout = new QHBoxLayout;
|
||||
|
||||
using KG = KeyboardGroup;
|
||||
for (auto kbg : {KG::Kb0x, KG::Kb1x, KG::Kb2x, KG::Kb3x, KG::Kb4x, KG::Kb5x})
|
||||
layout->addWidget(CreateGroupBox(QString{}, Keyboard::GetGroup(GetPort(), kbg)));
|
||||
|
||||
vbox_layout->addLayout(layout);
|
||||
|
||||
setLayout(vbox_layout);
|
||||
}
|
||||
|
||||
void GCKeyboardEmu::LoadSettings()
|
||||
|
@ -5,13 +5,6 @@
|
||||
|
||||
#include "DolphinQt/Config/Mapping/MappingWidget.h"
|
||||
|
||||
class QCheckBox;
|
||||
class QFormLayout;
|
||||
class QGroupBox;
|
||||
class QHBoxLayout;
|
||||
class QLabel;
|
||||
class QVBoxLayout;
|
||||
|
||||
class GCKeyboardEmu final : public MappingWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -24,7 +17,4 @@ private:
|
||||
void LoadSettings() override;
|
||||
void SaveSettings() override;
|
||||
void CreateMainLayout();
|
||||
|
||||
// Main
|
||||
QHBoxLayout* m_main_layout;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user