diff options
author | David <25727384+ogniK5377@users.noreply.github.com> | 2020-08-03 21:00:14 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-03 21:00:14 +1000 |
commit | 6c7292de33702aababf60acbc58128bd060f81ab (patch) | |
tree | 668e2d0365852682609764f5ebff600848ef7246 /src/yuzu/configuration/config.cpp | |
parent | 0ca42c806fac7280a14958f28cc0286beb6bc351 (diff) | |
parent | 156bf5b2976b9df3451a06ca32092c252c6f039f (diff) |
Merge pull request #4263 from lat9nq/fix-screencaps-2
screenshots: Option to save screenshots immediately in a specified directory + Linux workaround
Diffstat (limited to 'src/yuzu/configuration/config.cpp')
-rw-r--r-- | src/yuzu/configuration/config.cpp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 94b96afb4..cb71b8d11 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -578,7 +578,6 @@ void Config::ReadPathValues() { UISettings::values.roms_path = ReadSetting(QStringLiteral("romsPath")).toString(); UISettings::values.symbols_path = ReadSetting(QStringLiteral("symbolsPath")).toString(); - UISettings::values.screenshot_path = ReadSetting(QStringLiteral("screenshotPath")).toString(); UISettings::values.game_dir_deprecated = ReadSetting(QStringLiteral("gameListRootDir"), QStringLiteral(".")).toString(); UISettings::values.game_dir_deprecated_deepscan = @@ -673,6 +672,22 @@ void Config::ReadRendererValues() { qt_config->endGroup(); } +void Config::ReadScreenshotValues() { + qt_config->beginGroup(QStringLiteral("Screenshots")); + + UISettings::values.enable_screenshot_save_as = + ReadSetting(QStringLiteral("enable_screenshot_save_as"), true).toBool(); + FileUtil::GetUserPath( + FileUtil::UserPath::ScreenshotsDir, + qt_config + ->value(QStringLiteral("screenshot_path"), QString::fromStdString(FileUtil::GetUserPath( + FileUtil::UserPath::ScreenshotsDir))) + .toString() + .toStdString()); + + qt_config->endGroup(); +} + void Config::ReadShortcutValues() { qt_config->beginGroup(QStringLiteral("Shortcuts")); @@ -754,6 +769,7 @@ void Config::ReadUIValues() { ReadUIGamelistValues(); ReadUILayoutValues(); ReadPathValues(); + ReadScreenshotValues(); ReadShortcutValues(); UISettings::values.single_window_mode = @@ -1083,7 +1099,6 @@ void Config::SavePathValues() { WriteSetting(QStringLiteral("romsPath"), UISettings::values.roms_path); WriteSetting(QStringLiteral("symbolsPath"), UISettings::values.symbols_path); - WriteSetting(QStringLiteral("screenshotPath"), UISettings::values.screenshot_path); qt_config->beginWriteArray(QStringLiteral("gamedirs")); for (int i = 0; i < UISettings::values.game_dirs.size(); ++i) { qt_config->setArrayIndex(i); @@ -1159,6 +1174,17 @@ void Config::SaveRendererValues() { qt_config->endGroup(); } +void Config::SaveScreenshotValues() { + qt_config->beginGroup(QStringLiteral("Screenshots")); + + WriteSetting(QStringLiteral("enable_screenshot_save_as"), + UISettings::values.enable_screenshot_save_as); + WriteSetting(QStringLiteral("screenshot_path"), + QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::ScreenshotsDir))); + + qt_config->endGroup(); +} + void Config::SaveShortcutValues() { qt_config->beginGroup(QStringLiteral("Shortcuts")); @@ -1221,6 +1247,7 @@ void Config::SaveUIValues() { SaveUIGamelistValues(); SaveUILayoutValues(); SavePathValues(); + SaveScreenshotValues(); SaveShortcutValues(); WriteSetting(QStringLiteral("singleWindowMode"), UISettings::values.single_window_mode, true); |