mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
Added omitted functions for buttons
This commit is contained in:
parent
d19d4b9639
commit
65de641113
@ -99,12 +99,14 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||||||
Config::save(config_dir / "config.toml");
|
Config::save(config_dir / "config.toml");
|
||||||
QWidget::close();
|
QWidget::close();
|
||||||
} else if (button == ui->buttonBox->button(QDialogButtonBox::Apply)) {
|
} else if (button == ui->buttonBox->button(QDialogButtonBox::Apply)) {
|
||||||
|
UpdateSettings();
|
||||||
Config::save(config_dir / "config.toml");
|
Config::save(config_dir / "config.toml");
|
||||||
} else if (button == ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)) {
|
} else if (button == ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)) {
|
||||||
Config::setDefaultValues();
|
Config::setDefaultValues();
|
||||||
|
Config::save(config_dir / "config.toml");
|
||||||
LoadValuesFromConfig();
|
LoadValuesFromConfig();
|
||||||
} else if (button == ui->buttonBox->button(QDialogButtonBox::Close)) {
|
} else if (button == ui->buttonBox->button(QDialogButtonBox::Close)) {
|
||||||
UpdateInstallFolders();
|
ResetInstallFolders();
|
||||||
}
|
}
|
||||||
if (Common::Log::IsActive()) {
|
if (Common::Log::IsActive()) {
|
||||||
Common::Log::Filter filter;
|
Common::Log::Filter filter;
|
||||||
@ -223,6 +225,12 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||||||
void SettingsDialog::LoadValuesFromConfig() {
|
void SettingsDialog::LoadValuesFromConfig() {
|
||||||
|
|
||||||
std::filesystem::path userdir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
std::filesystem::path userdir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||||
|
std::error_code error;
|
||||||
|
if (!std::filesystem::exists(userdir / "Config.toml", error)) {
|
||||||
|
Config::load(userdir / "Config.toml");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
std::ifstream ifs;
|
std::ifstream ifs;
|
||||||
ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||||
@ -516,7 +524,7 @@ void SettingsDialog::UpdateSettings() {
|
|||||||
UpdateInstallFolders();
|
UpdateInstallFolders();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::UpdateInstallFolders() {
|
void SettingsDialog::ResetInstallFolders() {
|
||||||
|
|
||||||
std::filesystem::path userdir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
std::filesystem::path userdir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||||
const toml::value data = toml::parse(userdir / "Config.toml");
|
const toml::value data = toml::parse(userdir / "Config.toml");
|
||||||
|
@ -32,7 +32,7 @@ signals:
|
|||||||
private:
|
private:
|
||||||
void LoadValuesFromConfig();
|
void LoadValuesFromConfig();
|
||||||
void UpdateSettings();
|
void UpdateSettings();
|
||||||
void UpdateInstallFolders();
|
void ResetInstallFolders();
|
||||||
void InitializeEmulatorLanguages();
|
void InitializeEmulatorLanguages();
|
||||||
void OnLanguageChanged(int index);
|
void OnLanguageChanged(int index);
|
||||||
void OnCursorStateChanged(s16 index);
|
void OnCursorStateChanged(s16 index);
|
||||||
|
Loading…
Reference in New Issue
Block a user