Show hidden directories in browser
This commit is contained in:
@@ -111,6 +111,7 @@ STR_SCREEN_MARGIN: "Reader Screen Margin"
|
|||||||
STR_PARA_ALIGNMENT: "Reader Paragraph Alignment"
|
STR_PARA_ALIGNMENT: "Reader Paragraph Alignment"
|
||||||
STR_HYPHENATION: "Hyphenation"
|
STR_HYPHENATION: "Hyphenation"
|
||||||
STR_TIME_TO_SLEEP: "Time to Sleep"
|
STR_TIME_TO_SLEEP: "Time to Sleep"
|
||||||
|
STR_SHOW_HIDDEN_FILES: "Show Hidden Files"
|
||||||
STR_REFRESH_FREQ: "Refresh Frequency"
|
STR_REFRESH_FREQ: "Refresh Frequency"
|
||||||
STR_CALIBRE_SETTINGS: "Calibre Settings"
|
STR_CALIBRE_SETTINGS: "Calibre Settings"
|
||||||
STR_KOREADER_SYNC: "KOReader Sync"
|
STR_KOREADER_SYNC: "KOReader Sync"
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ class CrossPointSettings {
|
|||||||
uint8_t fadingFix = 0;
|
uint8_t fadingFix = 0;
|
||||||
// Use book's embedded CSS styles for EPUB rendering (1 = enabled, 0 = disabled)
|
// Use book's embedded CSS styles for EPUB rendering (1 = enabled, 0 = disabled)
|
||||||
uint8_t embeddedStyle = 1;
|
uint8_t embeddedStyle = 1;
|
||||||
|
// Show hidden files/directories (starting with '.') in the file browser (0 = hidden, 1 = show)
|
||||||
|
uint8_t showHiddenFiles = 0;
|
||||||
|
|
||||||
~CrossPointSettings() = default;
|
~CrossPointSettings() = default;
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ inline const std::vector<SettingInfo>& getSettingsList() {
|
|||||||
SettingInfo::Enum(StrId::STR_TIME_TO_SLEEP, &CrossPointSettings::sleepTimeout,
|
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},
|
{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),
|
"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) ---
|
// --- KOReader Sync (web-only, uses KOReaderCredentialStore) ---
|
||||||
SettingInfo::DynamicString(
|
SettingInfo::DynamicString(
|
||||||
|
|||||||
@@ -8,11 +8,13 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "../util/ConfirmationActivity.h"
|
#include "../util/ConfirmationActivity.h"
|
||||||
|
#include "CrossPointSettings.h"
|
||||||
#include "MappedInputManager.h"
|
#include "MappedInputManager.h"
|
||||||
#include "components/UITheme.h"
|
#include "components/UITheme.h"
|
||||||
#include "fontIds.h"
|
#include "fontIds.h"
|
||||||
#include "util/StringUtils.h"
|
#include "util/StringUtils.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr unsigned long GO_HOME_MS = 1000;
|
constexpr unsigned long GO_HOME_MS = 1000;
|
||||||
} // namespace
|
} // namespace
|
||||||
@@ -83,7 +85,7 @@ void FileBrowserActivity::loadFiles() {
|
|||||||
char name[500];
|
char name[500];
|
||||||
for (auto file = root.openNextFile(); file; file = root.openNextFile()) {
|
for (auto file = root.openNextFile(); file; file = root.openNextFile()) {
|
||||||
file.getName(name, sizeof(name));
|
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();
|
file.close();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ void CrossPointWebServer::scanFiles(const char* path, const std::function<void(F
|
|||||||
auto fileName = String(name);
|
auto fileName = String(name);
|
||||||
|
|
||||||
// Skip hidden items (starting with ".")
|
// Skip hidden items (starting with ".")
|
||||||
bool shouldHide = fileName.startsWith(".");
|
bool shouldHide = !SETTINGS.showHiddenFiles && fileName.startsWith(".");
|
||||||
|
|
||||||
// Check against explicitly hidden items list
|
// Check against explicitly hidden items list
|
||||||
if (!shouldHide) {
|
if (!shouldHide) {
|
||||||
|
|||||||
Reference in New Issue
Block a user