aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/configuration/configure_input_dialog.cpp
blob: 1866003c28edb2aae36d68d18087e77bb61d033a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2020 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#include "ui_configure_input_dialog.h"
#include "yuzu/configuration/configure_input_dialog.h"

ConfigureInputDialog::ConfigureInputDialog(QWidget* parent, std::size_t max_players,
                                           InputCommon::InputSubsystem* input_subsystem)
    : QDialog(parent), ui(std::make_unique<Ui::ConfigureInputDialog>()),
      input_widget(new ConfigureInput(this)) {
    ui->setupUi(this);

    input_widget->Initialize(input_subsystem, max_players);

    ui->inputLayout->addWidget(input_widget);

    RetranslateUI();
}

ConfigureInputDialog::~ConfigureInputDialog() = default;

void ConfigureInputDialog::ApplyConfiguration() {
    input_widget->ApplyConfiguration();
}

void ConfigureInputDialog::changeEvent(QEvent* event) {
    if (event->type() == QEvent::LanguageChange) {
        RetranslateUI();
    }

    QDialog::changeEvent(event);
}

void ConfigureInputDialog::RetranslateUI() {
    ui->retranslateUi(this);
}