2020-07-22 14:39:53 +00:00
|
|
|
// 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"
|
|
|
|
|
2020-08-27 19:16:47 +00:00
|
|
|
ConfigureDebugController::ConfigureDebugController(QWidget* parent,
|
2020-09-23 13:52:25 +00:00
|
|
|
InputCommon::InputSubsystem* input_subsystem,
|
|
|
|
InputProfiles* profiles)
|
2020-08-15 19:26:29 +00:00
|
|
|
: QDialog(parent), ui(std::make_unique<Ui::ConfigureDebugController>()),
|
2020-09-23 13:52:25 +00:00
|
|
|
debug_controller(
|
|
|
|
new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles, true)) {
|
2020-07-22 14:39:53 +00:00
|
|
|
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);
|
|
|
|
}
|