Feature additions (#434)
Lots of things "ported" over from the "enhanced" fork. With some adjustments here and there. KeyboardBacklight driver (for T-Deck only currently) Trackball driver (for T-Deck only currently) Keyboard backlight sleep/wake (for T-Deck only currently...also requires keyboard firmware update) Display sleep/wake Files - create file/folder Keyboard settings (for T-Deck only currently) Time & Date settings tweaks Locale settings tweaks Systeminfo additions Espnow wifi coexist initI2cDevices - moved to T-deck init.cpp / initBoot KeyboardInitService - removed, moved to T-deck init.cpp / initBoot Adjusted TIMER_UPDATE_INTERVAL to 2 seconds. Added lock to ActionCreateFolder Maybe missed some things in the list. Display wake could do with some kind of block on wake first touch to prevent UI elements being hit when waking device with touch. Same with encoder/trackball/keyboard press i guess. The original code was written by @cscott0108 at https://github.com/cscott0108/tactility-enhanced-t-deck
This commit is contained in:
@@ -40,6 +40,25 @@ static bool loadSystemSettingsFromFile(SystemSettings& properties) {
|
||||
bool time_format_24h = time_format_entry == map.end() ? true : (time_format_entry->second == "true");
|
||||
properties.timeFormat24h = time_format_24h;
|
||||
|
||||
// Load date format
|
||||
// Default to MM/DD/YYYY if missing (backward compat with older system.properties)
|
||||
auto date_format_entry = map.find("dateFormat");
|
||||
if (date_format_entry != map.end() && !date_format_entry->second.empty()) {
|
||||
properties.dateFormat = date_format_entry->second;
|
||||
} else {
|
||||
TT_LOG_I(TAG, "dateFormat missing or empty, using default MM/DD/YYYY (likely from older system.properties)");
|
||||
properties.dateFormat = "MM/DD/YYYY";
|
||||
}
|
||||
|
||||
// Load region
|
||||
auto region_entry = map.find("region");
|
||||
if (region_entry != map.end() && !region_entry->second.empty()) {
|
||||
properties.region = region_entry->second;
|
||||
} else {
|
||||
TT_LOG_I(TAG, "region missing or empty, using default US");
|
||||
properties.region = "US";
|
||||
}
|
||||
|
||||
TT_LOG_I(TAG, "System settings loaded");
|
||||
return true;
|
||||
}
|
||||
@@ -61,12 +80,15 @@ bool saveSystemSettings(const SystemSettings& properties) {
|
||||
std::map<std::string, std::string> map;
|
||||
map["language"] = toString(properties.language);
|
||||
map["timeFormat24h"] = properties.timeFormat24h ? "true" : "false";
|
||||
map["dateFormat"] = properties.dateFormat;
|
||||
map["region"] = properties.region;
|
||||
|
||||
if (!file::savePropertiesFile(file_path, map)) {
|
||||
TT_LOG_E(TAG, "Failed to save %s", file_path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update local cache
|
||||
cachedSettings = properties;
|
||||
cached = true;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user