mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Qt GCPadWiiU: standalone dialog, not subclass of MappingWidget
It uses none of the functionality of MappingWidget or the parent MappingWindow, and complicates the definition of the MappingWidget interface.
This commit is contained in:
@ -20,7 +20,6 @@
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinQt2/Config/Mapping/GCKeyboardEmu.h"
|
||||
#include "DolphinQt2/Config/Mapping/GCPadEmu.h"
|
||||
#include "DolphinQt2/Config/Mapping/GCPadWiiU.h"
|
||||
#include "DolphinQt2/Config/Mapping/Hotkey3D.h"
|
||||
#include "DolphinQt2/Config/Mapping/HotkeyGeneral.h"
|
||||
#include "DolphinQt2/Config/Mapping/HotkeyGraphics.h"
|
||||
@ -240,8 +239,6 @@ void MappingWindow::RefreshDevices()
|
||||
|
||||
void MappingWindow::SetMappingType(MappingWindow::Type type)
|
||||
{
|
||||
m_controller = nullptr;
|
||||
|
||||
MappingWidget* widget;
|
||||
|
||||
switch (type)
|
||||
@ -259,11 +256,6 @@ 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_GCPAD_WIIU:
|
||||
widget = new GCPadWiiU(this);
|
||||
setWindowTitle(tr("GameCube Adapter for Wii U at Port %1").arg(GetPort() + 1));
|
||||
AddWidget(tr("GameCube Adapter for Wii U"), widget);
|
||||
break;
|
||||
case Type::MAPPING_WIIMOTE_EMU:
|
||||
case Type::MAPPING_WIIMOTE_HYBRID:
|
||||
{
|
||||
@ -295,23 +287,18 @@ void MappingWindow::SetMappingType(MappingWindow::Type type)
|
||||
|
||||
m_config = widget->GetConfig();
|
||||
|
||||
if (m_config)
|
||||
m_controller = m_config->GetController(GetPort());
|
||||
m_profiles_combo->addItem(QStringLiteral(""));
|
||||
|
||||
const std::string profiles_path =
|
||||
File::GetUserPath(D_CONFIG_IDX) + "Profiles/" + m_config->GetProfileName();
|
||||
for (const auto& filename : Common::DoFileSearch({profiles_path}, {".ini"}))
|
||||
{
|
||||
m_controller = m_config->GetController(GetPort());
|
||||
m_profiles_combo->addItem(QStringLiteral(""));
|
||||
|
||||
const std::string profiles_path =
|
||||
File::GetUserPath(D_CONFIG_IDX) + "Profiles/" + m_config->GetProfileName();
|
||||
for (const auto& filename : Common::DoFileSearch({profiles_path}, {".ini"}))
|
||||
{
|
||||
std::string basename;
|
||||
SplitPath(filename, nullptr, &basename, nullptr);
|
||||
m_profiles_combo->addItem(QString::fromStdString(basename), QString::fromStdString(filename));
|
||||
}
|
||||
std::string basename;
|
||||
SplitPath(filename, nullptr, &basename, nullptr);
|
||||
m_profiles_combo->addItem(QString::fromStdString(basename), QString::fromStdString(filename));
|
||||
}
|
||||
|
||||
SetLayoutComplex(type != Type::MAPPING_GCPAD_WIIU);
|
||||
|
||||
if (m_controller != nullptr)
|
||||
RefreshDevices();
|
||||
}
|
||||
@ -321,15 +308,6 @@ void MappingWindow::AddWidget(const QString& name, QWidget* widget)
|
||||
m_tab_widget->addTab(widget, name);
|
||||
}
|
||||
|
||||
void MappingWindow::SetLayoutComplex(bool is_complex)
|
||||
{
|
||||
m_reset_box->setHidden(!is_complex);
|
||||
m_profiles_box->setHidden(!is_complex);
|
||||
m_devices_box->setHidden(!is_complex);
|
||||
|
||||
m_is_complex = is_complex;
|
||||
}
|
||||
|
||||
int MappingWindow::GetPort() const
|
||||
{
|
||||
return m_port;
|
||||
|
Reference in New Issue
Block a user