diff --git a/lib/I18n/translations/english.yaml b/lib/I18n/translations/english.yaml index 38192cc9..bf7219b6 100644 --- a/lib/I18n/translations/english.yaml +++ b/lib/I18n/translations/english.yaml @@ -115,6 +115,7 @@ STR_SCREEN_MARGIN: "Reader Screen Margin" STR_PARA_ALIGNMENT: "Reader Paragraph Alignment" STR_HYPHENATION: "Hyphenation" STR_TIME_TO_SLEEP: "Time to Sleep" +STR_SHOW_HIDDEN_FILES: "Show Hidden Files" STR_REFRESH_FREQ: "Refresh Frequency" STR_CALIBRE_SETTINGS: "Calibre Settings" STR_KOREADER_SYNC: "KOReader Sync" diff --git a/src/SettingsList.h b/src/SettingsList.h index f69c9e93..cdbee372 100644 --- a/src/SettingsList.h +++ b/src/SettingsList.h @@ -78,6 +78,8 @@ inline const std::vector& getSettingsList() { SettingInfo::Enum(StrId::STR_TIME_TO_SLEEP, &CrossPointSettings::sleepTimeout, {StrId::STR_MIN_1, StrId::STR_MIN_5, StrId::STR_MIN_10, StrId::STR_MIN_15, StrId::STR_MIN_30}, "sleepTimeout", StrId::STR_CAT_SYSTEM), + SettingInfo::Toggle(StrId::STR_SHOW_HIDDEN_FILES, &CrossPointSettings::showHiddenFiles, "showHiddenFiles", + StrId::STR_CAT_SYSTEM), // --- KOReader Sync (web-only, uses KOReaderCredentialStore) --- SettingInfo::DynamicString( diff --git a/src/activities/home/FileBrowserActivity.cpp b/src/activities/home/FileBrowserActivity.cpp index b8b910ba..b47efc6c 100644 --- a/src/activities/home/FileBrowserActivity.cpp +++ b/src/activities/home/FileBrowserActivity.cpp @@ -9,6 +9,7 @@ #include #include "../util/ConfirmationActivity.h" +#include "CrossPointSettings.h" #include "MappedInputManager.h" #include "components/UITheme.h" #include "fontIds.h" @@ -83,7 +84,7 @@ void FileBrowserActivity::loadFiles() { char name[500]; for (auto file = root.openNextFile(); file; file = root.openNextFile()) { file.getName(name, sizeof(name)); - if (name[0] == '.' || strcmp(name, "System Volume Information") == 0) { + if ((!SETTINGS.showHiddenFiles && name[0] == '.') || strcmp(name, "System Volume Information") == 0) { file.close(); continue; } diff --git a/src/network/CrossPointWebServer.cpp b/src/network/CrossPointWebServer.cpp index ede4aa39..bb090604 100644 --- a/src/network/CrossPointWebServer.cpp +++ b/src/network/CrossPointWebServer.cpp @@ -354,7 +354,7 @@ void CrossPointWebServer::scanFiles(const char* path, const std::function