common: Remove dependency from core
This commit is contained in:
@@ -8,10 +8,13 @@
|
||||
#include "citra_qt/configuration/configure_dialog.h"
|
||||
#include "citra_qt/hotkeys.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "ui_configure.h"
|
||||
|
||||
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, bool enable_web_config)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureDialog>()), registry(registry) {
|
||||
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, Core::System& system_,
|
||||
bool enable_web_config)
|
||||
: QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry{registry_},
|
||||
system{system_} {
|
||||
Settings::SetConfiguringGlobal(true);
|
||||
|
||||
ui->setupUi(this);
|
||||
@@ -68,7 +71,7 @@ void ConfigureDialog::ApplyConfiguration() {
|
||||
ui->webTab->ApplyConfiguration();
|
||||
ui->uiTab->ApplyConfiguration();
|
||||
ui->storageTab->ApplyConfiguration();
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
Settings::LogSettings();
|
||||
}
|
||||
|
||||
|
@@ -13,11 +13,15 @@ namespace Ui {
|
||||
class ConfigureDialog;
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
class ConfigureDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
|
||||
explicit ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, Core::System& system,
|
||||
bool enable_web_config = true);
|
||||
~ConfigureDialog() override;
|
||||
|
||||
@@ -37,4 +41,5 @@ private:
|
||||
|
||||
std::unique_ptr<Ui::ConfigureDialog> ui;
|
||||
HotkeyRegistry& registry;
|
||||
Core::System& system;
|
||||
};
|
||||
|
@@ -102,7 +102,7 @@ void ConfigurePerGame::ApplyConfiguration() {
|
||||
audio_tab->ApplyConfiguration();
|
||||
debug_tab->ApplyConfiguration();
|
||||
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
Settings::LogSettings();
|
||||
|
||||
game_config->Save();
|
||||
|
@@ -8,10 +8,11 @@
|
||||
#include "citra_qt/dumping/options_dialog.h"
|
||||
#include "citra_qt/uisettings.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "ui_dumping_dialog.h"
|
||||
|
||||
DumpingDialog::DumpingDialog(QWidget* parent)
|
||||
: QDialog(parent), ui(std::make_unique<Ui::DumpingDialog>()) {
|
||||
DumpingDialog::DumpingDialog(QWidget* parent, Core::System& system_)
|
||||
: QDialog(parent), ui{std::make_unique<Ui::DumpingDialog>()}, system{system_} {
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -216,5 +217,5 @@ void DumpingDialog::ApplyConfiguration() {
|
||||
Settings::values.audio_encoder_options = ui->audioEncoderOptionsLineEdit->text().toStdString();
|
||||
Settings::values.audio_bitrate = ui->audioBitrateSpinBox->value();
|
||||
UISettings::values.video_dumping_path = last_path;
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
}
|
||||
|
@@ -10,13 +10,17 @@ namespace Ui {
|
||||
class DumpingDialog;
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
class DumpingDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DumpingDialog(QWidget* parent);
|
||||
explicit DumpingDialog(QWidget* parent, Core::System& system);
|
||||
~DumpingDialog() override;
|
||||
|
||||
QString GetFilePath() const;
|
||||
@@ -32,6 +36,7 @@ private:
|
||||
QLineEdit* line_edit);
|
||||
|
||||
std::unique_ptr<Ui::DumpingDialog> ui;
|
||||
Core::System& system;
|
||||
|
||||
QString last_path;
|
||||
|
||||
|
@@ -140,7 +140,7 @@ void GMainWindow::ShowTelemetryCallout() {
|
||||
"<br/><br/>Would you like to share your usage data with us?");
|
||||
if (QMessageBox::question(this, tr("Telemetry"), telemetry_message) == QMessageBox::Yes) {
|
||||
NetSettings::values.enable_telemetry = true;
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1140,7 +1140,7 @@ void GMainWindow::BootGame(const QString& filename) {
|
||||
const std::string config_file_name =
|
||||
title_id == 0 ? name : fmt::format("{:016X}", title_id);
|
||||
Config per_game_config(config_file_name, Config::ConfigType::PerGameConfig);
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
|
||||
LOG_INFO(Frontend, "Using per game config file for title id {}", config_file_name);
|
||||
Settings::LogSettings();
|
||||
@@ -1883,7 +1883,7 @@ void GMainWindow::ChangeScreenLayout() {
|
||||
}
|
||||
|
||||
Settings::values.layout_option = new_layout;
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
UpdateSecondaryWindowVisibility();
|
||||
}
|
||||
|
||||
@@ -1911,18 +1911,18 @@ void GMainWindow::ToggleScreenLayout() {
|
||||
|
||||
Settings::values.layout_option = new_layout;
|
||||
SyncMenuUISettings();
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
UpdateSecondaryWindowVisibility();
|
||||
}
|
||||
|
||||
void GMainWindow::OnSwapScreens() {
|
||||
Settings::values.swap_screen = ui->action_Screen_Layout_Swap_Screens->isChecked();
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
}
|
||||
|
||||
void GMainWindow::OnRotateScreens() {
|
||||
Settings::values.upright_screen = ui->action_Screen_Layout_Upright_Screens->isChecked();
|
||||
Settings::Apply();
|
||||
system.ApplySettings();
|
||||
}
|
||||
|
||||
void GMainWindow::TriggerSwapScreens() {
|
||||
@@ -1961,7 +1961,7 @@ void GMainWindow::OnLoadState() {
|
||||
void GMainWindow::OnConfigure() {
|
||||
game_list->SetDirectoryWatcherEnabled(false);
|
||||
Settings::SetConfiguringGlobal(true);
|
||||
ConfigureDialog configureDialog(this, hotkey_registry,
|
||||
ConfigureDialog configureDialog(this, hotkey_registry, system,
|
||||
!multiplayer_state->IsHostingPublicRoom());
|
||||
connect(&configureDialog, &ConfigureDialog::LanguageChanged, this,
|
||||
&GMainWindow::OnLanguageChanged);
|
||||
@@ -2278,7 +2278,7 @@ void GMainWindow::OnOpenFFmpeg() {
|
||||
#endif
|
||||
|
||||
void GMainWindow::OnStartVideoDumping() {
|
||||
DumpingDialog dialog(this);
|
||||
DumpingDialog dialog(this, system);
|
||||
if (dialog.exec() != QDialog::DialogCode::Accepted) {
|
||||
ui->action_Dump_Video->setChecked(false);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user