2022-11-05 13:58:44 +01:00
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
2023-07-22 09:33:03 +02:00
|
|
|
#include <vector>
|
2022-11-05 13:58:44 +01:00
|
|
|
#include <QWidget>
|
2023-07-22 02:54:19 +02:00
|
|
|
#include "yuzu/configuration/configuration_shared.h"
|
2022-11-05 13:58:44 +01:00
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ConfigureDialog;
|
|
|
|
class HotkeyRegistry;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ConfigureGeneral;
|
|
|
|
}
|
|
|
|
|
2023-07-22 02:54:19 +02:00
|
|
|
namespace ConfigurationShared {
|
|
|
|
class Builder;
|
|
|
|
}
|
2022-11-05 13:58:44 +01:00
|
|
|
|
2023-07-22 02:54:19 +02:00
|
|
|
class ConfigureGeneral : public ConfigurationShared::Tab {
|
2022-11-05 13:58:44 +01:00
|
|
|
public:
|
2023-07-22 02:54:19 +02:00
|
|
|
explicit ConfigureGeneral(const Core::System& system_,
|
2023-07-22 09:33:03 +02:00
|
|
|
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
|
2023-07-22 02:54:19 +02:00
|
|
|
const ConfigurationShared::Builder& builder,
|
|
|
|
QWidget* parent = nullptr);
|
2022-11-05 13:58:44 +01:00
|
|
|
~ConfigureGeneral() override;
|
|
|
|
|
|
|
|
void SetResetCallback(std::function<void()> callback);
|
|
|
|
void ResetDefaults();
|
2023-07-22 02:54:19 +02:00
|
|
|
void ApplyConfiguration() override;
|
|
|
|
void SetConfiguration() override;
|
2022-11-05 13:58:44 +01:00
|
|
|
|
|
|
|
private:
|
2023-07-22 02:54:19 +02:00
|
|
|
void Setup(const ConfigurationShared::Builder& builder);
|
|
|
|
|
2022-11-05 13:58:44 +01:00
|
|
|
void changeEvent(QEvent* event) override;
|
|
|
|
void RetranslateUI();
|
|
|
|
|
|
|
|
std::function<void()> reset_callback;
|
|
|
|
|
|
|
|
std::unique_ptr<Ui::ConfigureGeneral> ui;
|
|
|
|
|
2023-07-22 09:33:03 +02:00
|
|
|
std::vector<std::function<void(bool)>> apply_funcs{};
|
2022-11-05 13:58:44 +01:00
|
|
|
|
|
|
|
const Core::System& system;
|
|
|
|
};
|