9e1b0af259
Abstracts most of the input mechanisms under an InputSubsystem class that is managed by the frontends, eliminating any static constructors and destructors. This gets rid of global accessor functions and also allows the frontends to have a more fine-grained control over the lifecycle of the input subsystem. This also makes it explicit which interfaces rely on the input subsystem instead of making it opaque in the interface functions. All that remains to migrate over is the factories, which can be done in a separate change.
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
// Copyright 2020 yuzu Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#include "ui_configure_debug_controller.h"
|
|
#include "yuzu/configuration/configure_debug_controller.h"
|
|
|
|
ConfigureDebugController::ConfigureDebugController(QWidget* parent,
|
|
InputCommon::InputSubsystem* input_subsystem)
|
|
: QDialog(parent), ui(std::make_unique<Ui::ConfigureDebugController>()),
|
|
debug_controller(new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, true)) {
|
|
ui->setupUi(this);
|
|
|
|
ui->controllerLayout->addWidget(debug_controller);
|
|
|
|
connect(ui->clear_all_button, &QPushButton::clicked, this,
|
|
[this] { debug_controller->ClearAll(); });
|
|
connect(ui->restore_defaults_button, &QPushButton::clicked, this,
|
|
[this] { debug_controller->RestoreDefaults(); });
|
|
|
|
RetranslateUI();
|
|
}
|
|
|
|
ConfigureDebugController::~ConfigureDebugController() = default;
|
|
|
|
void ConfigureDebugController::ApplyConfiguration() {
|
|
debug_controller->ApplyConfiguration();
|
|
}
|
|
|
|
void ConfigureDebugController::changeEvent(QEvent* event) {
|
|
if (event->type() == QEvent::LanguageChange) {
|
|
RetranslateUI();
|
|
}
|
|
|
|
QDialog::changeEvent(event);
|
|
}
|
|
|
|
void ConfigureDebugController::RetranslateUI() {
|
|
ui->retranslateUi(this);
|
|
}
|