This is part of a series of PRs made in preparation for the QML rewrite. this PR specifically moves a bunch of utility functions from main.cpp into qt_common, with the biggest benefit being that QML can reuse the exact same code through ctx passthrough. Also, QtCommon::Frontend is an abstraction layer over several previously Widgets-specific stuff like QMessageBox that gets used everywhere. The idea is that once QML is implemented, these functions can have a Quick version implemented for systems that don't work well with Widgets (sun) or for those on Plasma 6+ (reduces memory usage w/o Widgets linkage) although Quick from C++ is actually anal, but whatever. Other than that this should also just kinda reduce the size of main.cpp which is a 6000-line behemoth rn, and clangd straight up gives up with it for me (likely caused by the massive amount of headers, which this DOES reduce). In the future, I probably want to create a common strings lookup table that both Qt and QML can reference--though I'm not sure how much linguist likes that--which should give us a way to keep language consistent (use frozen-map). TODO: Docs for Qt stuff Co-authored-by: MaranBr <maranbr@outlook.com> Reviewed-on: #94 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
99 lines
2.8 KiB
C++
99 lines
2.8 KiB
C++
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <QDialog>
|
|
#include "configuration/shared_widget.h"
|
|
#include "yuzu/configuration/configuration_shared.h"
|
|
#include "qt_common/shared_translation.h"
|
|
#include "yuzu/vk_device_info.h"
|
|
|
|
namespace Core {
|
|
class System;
|
|
}
|
|
|
|
class ConfigureApplets;
|
|
class ConfigureAudio;
|
|
class ConfigureCpu;
|
|
class ConfigureDebugTab;
|
|
class ConfigureFilesystem;
|
|
class ConfigureGeneral;
|
|
class ConfigureGraphics;
|
|
class ConfigureGraphicsAdvanced;
|
|
class ConfigureGraphicsExtensions;
|
|
class ConfigureHotkeys;
|
|
class ConfigureInput;
|
|
class ConfigureProfileManager;
|
|
class ConfigureSystem;
|
|
class ConfigureNetwork;
|
|
class ConfigureUi;
|
|
class ConfigureWeb;
|
|
|
|
class HotkeyRegistry;
|
|
|
|
namespace InputCommon {
|
|
class InputSubsystem;
|
|
}
|
|
|
|
namespace Ui {
|
|
class ConfigureDialog;
|
|
}
|
|
|
|
class ConfigureDialog : public QDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
|
|
InputCommon::InputSubsystem* input_subsystem,
|
|
std::vector<VkDeviceInfo::Record>& vk_device_records,
|
|
Core::System& system_, bool enable_web_config = true);
|
|
~ConfigureDialog() override;
|
|
|
|
void ApplyConfiguration();
|
|
|
|
private slots:
|
|
void OnLanguageChanged(const QString& locale);
|
|
|
|
signals:
|
|
void LanguageChanged(const QString& locale);
|
|
|
|
private:
|
|
void changeEvent(QEvent* event) override;
|
|
void RetranslateUI();
|
|
|
|
void HandleApplyButtonClicked();
|
|
|
|
void SetConfiguration();
|
|
void UpdateVisibleTabs();
|
|
void PopulateSelectionList();
|
|
|
|
std::unique_ptr<Ui::ConfigureDialog> ui;
|
|
HotkeyRegistry& registry;
|
|
|
|
Core::System& system;
|
|
std::unique_ptr<ConfigurationShared::Builder> builder;
|
|
std::vector<ConfigurationShared::Tab*> tab_group;
|
|
|
|
std::unique_ptr<ConfigureApplets> applets_tab;
|
|
std::unique_ptr<ConfigureAudio> audio_tab;
|
|
std::unique_ptr<ConfigureCpu> cpu_tab;
|
|
std::unique_ptr<ConfigureDebugTab> debug_tab_tab;
|
|
std::unique_ptr<ConfigureFilesystem> filesystem_tab;
|
|
std::unique_ptr<ConfigureGeneral> general_tab;
|
|
std::unique_ptr<ConfigureGraphicsAdvanced> graphics_advanced_tab;
|
|
std::unique_ptr<ConfigureGraphicsExtensions> graphics_extensions_tab;
|
|
std::unique_ptr<ConfigureUi> ui_tab;
|
|
std::unique_ptr<ConfigureGraphics> graphics_tab;
|
|
std::unique_ptr<ConfigureHotkeys> hotkeys_tab;
|
|
std::unique_ptr<ConfigureInput> input_tab;
|
|
std::unique_ptr<ConfigureNetwork> network_tab;
|
|
std::unique_ptr<ConfigureProfileManager> profile_tab;
|
|
std::unique_ptr<ConfigureSystem> system_tab;
|
|
std::unique_ptr<ConfigureWeb> web_tab;
|
|
};
|