Changed the custom slideshow screensaver image directory setting from ScreensaverSlideshowImageDir to ScreensaverSlideshowCustomDir

This commit is contained in:
Leon Styhre 2023-12-16 21:17:05 +01:00
parent 9283ab71fa
commit 88754a86ed
3 changed files with 8 additions and 8 deletions

View file

@ -465,7 +465,7 @@ void Screensaver::generateVideoList()
void Screensaver::generateCustomImageList()
{
std::string imageDir {Utils::FileSystem::expandHomePath(
Settings::getInstance()->getString("ScreensaverSlideshowImageDir"))};
Settings::getInstance()->getString("ScreensaverSlideshowCustomDir"))};
if (imageDir.empty())
imageDir = Utils::FileSystem::getAppDataDirectory()

View file

@ -199,14 +199,14 @@ void GuiScreensaverOptions::openSlideshowScreensaverOptions()
// Custom image directory.
ComponentListRow rowCustomImageDir;
auto screensaverSlideshowImageDir = std::make_shared<TextComponent>(
auto ScreensaverSlideshowCustomDir = std::make_shared<TextComponent>(
"CUSTOM IMAGE DIRECTORY", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
auto bracketCustomImageDir = std::make_shared<ImageComponent>();
bracketCustomImageDir->setResize(
glm::vec2 {0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()});
bracketCustomImageDir->setImage(":/graphics/arrow.svg");
bracketCustomImageDir->setColorShift(mMenuColorPrimary);
rowCustomImageDir.addElement(screensaverSlideshowImageDir, true);
rowCustomImageDir.addElement(ScreensaverSlideshowCustomDir, true);
rowCustomImageDir.addElement(bracketCustomImageDir, false);
const std::string titleCustomImageDir {"CUSTOM IMAGE DIRECTORY"};
const std::string defaultImageDirStaticText {"Default directory:"};
@ -215,10 +215,10 @@ void GuiScreensaverOptions::openSlideshowScreensaverOptions()
.append("custom_slideshow")
.string()};
const std::string initValueMediaDir {
Settings::getInstance()->getString("ScreensaverSlideshowImageDir")};
Settings::getInstance()->getString("ScreensaverSlideshowCustomDir")};
const bool multiLineMediaDir {false};
auto updateValMediaDir = [this, s](const std::string& newVal) {
Settings::getInstance()->setString("ScreensaverSlideshowImageDir", newVal);
Settings::getInstance()->setString("ScreensaverSlideshowCustomDir", newVal);
s->setNeedsSaving();
};
rowCustomImageDir.makeAcceptInputHandler(
@ -227,14 +227,14 @@ void GuiScreensaverOptions::openSlideshowScreensaverOptions()
if (Settings::getInstance()->getBool("VirtualKeyboard")) {
mWindow->pushGui(new GuiTextEditKeyboardPopup(
getHelpStyle(), s->getMenu().getPosition().y, titleCustomImageDir,
Settings::getInstance()->getString("ScreensaverSlideshowImageDir"),
Settings::getInstance()->getString("ScreensaverSlideshowCustomDir"),
updateValMediaDir, multiLineMediaDir, "SAVE", "SAVE CHANGES?",
defaultImageDirStaticText, defaultImageDirText, "load default directory"));
}
else {
mWindow->pushGui(new GuiTextEditPopup(
getHelpStyle(), titleCustomImageDir,
Settings::getInstance()->getString("ScreensaverSlideshowImageDir"),
Settings::getInstance()->getString("ScreensaverSlideshowCustomDir"),
updateValMediaDir, multiLineMediaDir, "SAVE", "SAVE CHANGES?",
defaultImageDirStaticText, defaultImageDirText, "load default directory"));
}

View file

@ -202,7 +202,7 @@ void Settings::setDefaults()
mBoolMap["ScreensaverSlideshowScanlines"] = {false, false};
mBoolMap["ScreensaverSlideshowCustomImages"] = {false, false};
mBoolMap["ScreensaverSlideshowRecurse"] = {false, false};
mStringMap["ScreensaverSlideshowImageDir"] = {"", ""};
mStringMap["ScreensaverSlideshowCustomDir"] = {"", ""};
// UI settings -> screensaver settings -> video screensaver settings.
mIntMap["ScreensaverSwapVideoTimeout"] = {0, 0};