2022-04-23 09:59:50 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-10-26 07:28:03 +00:00
|
|
|
|
2021-09-03 02:40:55 +01:00
|
|
|
#include "core/core.h"
|
2020-10-26 07:28:03 +00:00
|
|
|
#include "ui_configure_input_profile_dialog.h"
|
2020-10-27 17:33:25 +00:00
|
|
|
#include "yuzu/configuration/configure_input_player.h"
|
2020-10-26 07:28:03 +00:00
|
|
|
#include "yuzu/configuration/configure_input_profile_dialog.h"
|
|
|
|
|
|
|
|
ConfigureInputProfileDialog::ConfigureInputProfileDialog(
|
2021-09-03 02:40:55 +01:00
|
|
|
QWidget* parent, InputCommon::InputSubsystem* input_subsystem, InputProfiles* profiles,
|
|
|
|
Core::System& system)
|
2020-10-26 07:28:03 +00:00
|
|
|
: QDialog(parent), ui(std::make_unique<Ui::ConfigureInputProfileDialog>()),
|
2021-11-05 03:54:22 +00:00
|
|
|
profile_widget(new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles,
|
|
|
|
system.HIDCore(), system.IsPoweredOn(), false)) {
|
2020-10-26 07:28:03 +00:00
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
ui->controllerLayout->addWidget(profile_widget);
|
|
|
|
|
|
|
|
connect(ui->clear_all_button, &QPushButton::clicked, this,
|
|
|
|
[this] { profile_widget->ClearAll(); });
|
|
|
|
connect(ui->restore_defaults_button, &QPushButton::clicked, this,
|
|
|
|
[this] { profile_widget->RestoreDefaults(); });
|
|
|
|
|
|
|
|
RetranslateUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
ConfigureInputProfileDialog::~ConfigureInputProfileDialog() = default;
|
|
|
|
|
|
|
|
void ConfigureInputProfileDialog::changeEvent(QEvent* event) {
|
|
|
|
if (event->type() == QEvent::LanguageChange) {
|
|
|
|
RetranslateUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
QDialog::changeEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigureInputProfileDialog::RetranslateUI() {
|
|
|
|
ui->retranslateUi(this);
|
|
|
|
}
|