feat(ui): simplify family UI - hide advanced settings/apps, sane defaults
Hide from Settings: Bluetooth, Development, MCP Screen, Power, Region & Language, Time & Date (APP_MANIFEST_FLAG_HIDDEN). Hide from Apps list: App Hub, Chat, I2C Scanner, Notes, Screenshot, System Info, Web Server. Defaults: MCP on, WebServer on, America/New_York timezone, 12-hour time format.
This commit is contained in:
@@ -17,7 +17,7 @@ apOpenNetwork=0
|
|||||||
apChannel=1
|
apChannel=1
|
||||||
|
|
||||||
# Web Server Settings
|
# Web Server Settings
|
||||||
webServerEnabled=0
|
webServerEnabled=1
|
||||||
webServerPort=80
|
webServerPort=80
|
||||||
|
|
||||||
# HTTP Basic Authentication (optional)
|
# HTTP Basic Authentication (optional)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace tt::settings {
|
|||||||
|
|
||||||
struct SystemSettings {
|
struct SystemSettings {
|
||||||
Language language = Language::en_US;
|
Language language = Language::en_US;
|
||||||
bool timeFormat24h = true;
|
bool timeFormat24h = false;
|
||||||
std::string dateFormat = std::string("DD/MM/YYYY"); // MM/DD/YYYY, DD/MM/YYYY, YYYY-MM-DD, YYYY/MM/DD
|
std::string dateFormat = std::string("DD/MM/YYYY"); // MM/DD/YYYY, DD/MM/YYYY, YYYY-MM-DD, YYYY/MM/DD
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -339,7 +339,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.apphub",
|
.id = "tactility.apphub",
|
||||||
.name = "App Hub",
|
.name = "App Hub",
|
||||||
.category = APP_CATEGORY_SYSTEM,
|
.category = APP_CATEGORY_SYSTEM,
|
||||||
.location = {APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain)}
|
.location = {APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain)},
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tt::app::apphub
|
} // namespace tt::app::apphub
|
||||||
|
|||||||
@@ -245,7 +245,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.btmanage",
|
.id = "tactility.btmanage",
|
||||||
.name = "Bluetooth",
|
.name = "Bluetooth",
|
||||||
.category = APP_CATEGORY_SETTINGS,
|
.category = APP_CATEGORY_SETTINGS,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tt::app::btmanage
|
} // namespace tt::app::btmanage
|
||||||
|
|||||||
@@ -228,7 +228,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.chat",
|
.id = "tactility.chat",
|
||||||
.name = "Chat",
|
.name = "Chat",
|
||||||
.category = APP_CATEGORY_USER,
|
.category = APP_CATEGORY_USER,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tt::app::chat
|
} // namespace tt::app::chat
|
||||||
|
|||||||
@@ -230,7 +230,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.development",
|
.id = "tactility.development",
|
||||||
.name = "Development",
|
.name = "Development",
|
||||||
.category = APP_CATEGORY_SETTINGS,
|
.category = APP_CATEGORY_SETTINGS,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -426,7 +426,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.i2cscanner",
|
.id = "tactility.i2cscanner",
|
||||||
.name = "I2C Scanner",
|
.name = "I2C Scanner",
|
||||||
.category = APP_CATEGORY_SYSTEM,
|
.category = APP_CATEGORY_SYSTEM,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t start() {
|
uint32_t start() {
|
||||||
|
|||||||
@@ -182,7 +182,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.localesettings",
|
.id = "tactility.localesettings",
|
||||||
.name = "Region & Language",
|
.name = "Region & Language",
|
||||||
.category = APP_CATEGORY_SETTINGS,
|
.category = APP_CATEGORY_SETTINGS,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tt::app::localesettings
|
} // namespace tt::app::localesettings
|
||||||
|
|||||||
@@ -92,6 +92,6 @@ int32_t appMain(int, char**) {
|
|||||||
window_manager_remove(window); check(app_event_unsubscribe(&sub) == ERROR_NONE); task_event_group_destruct(&group); return 0;
|
window_manager_remove(window); check(app_event_unsubscribe(&sub) == ERROR_NONE); task_event_group_destruct(&group); return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
extern const ::AppManifest manifest = { .id = "McpSettings", .name = "MCP Screen", .category = APP_CATEGORY_SETTINGS, .location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }, .flags = 0, .stack = { .depth = 8192, .desired_memory_capability = 0 } };
|
extern const ::AppManifest manifest = { .id = "McpSettings", .name = "MCP Screen", .category = APP_CATEGORY_SETTINGS, .location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }, .flags = APP_MANIFEST_FLAG_HIDDEN, .stack = { .depth = 8192, .desired_memory_capability = 0 } };
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -276,7 +276,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.notes",
|
.id = "tactility.notes",
|
||||||
.name = "Notes",
|
.name = "Notes",
|
||||||
.category = APP_CATEGORY_USER,
|
.category = APP_CATEGORY_USER,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tt::app::notes
|
} // namespace tt::app::notes
|
||||||
|
|||||||
@@ -278,7 +278,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.power",
|
.id = "tactility.power",
|
||||||
.name = "Power",
|
.name = "Power",
|
||||||
.category = APP_CATEGORY_SETTINGS,
|
.category = APP_CATEGORY_SETTINGS,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -290,7 +290,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.screenshot",
|
.id = "tactility.screenshot",
|
||||||
.name = "Screenshot",
|
.name = "Screenshot",
|
||||||
.category = APP_CATEGORY_SYSTEM,
|
.category = APP_CATEGORY_SYSTEM,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -457,7 +457,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.systeminfo",
|
.id = "tactility.systeminfo",
|
||||||
.name = "System Info",
|
.name = "System Info",
|
||||||
.category = APP_CATEGORY_SYSTEM,
|
.category = APP_CATEGORY_SYSTEM,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -215,7 +215,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.timedatesettings",
|
.id = "tactility.timedatesettings",
|
||||||
.name = "Time & Date",
|
.name = "Time & Date",
|
||||||
.category = APP_CATEGORY_SETTINGS,
|
.category = APP_CATEGORY_SETTINGS,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace tt::app::timedatesettings
|
} // namespace tt::app::timedatesettings
|
||||||
|
|||||||
@@ -424,7 +424,8 @@ extern const ::AppManifest manifest = {
|
|||||||
.id = "tactility.webserversettings",
|
.id = "tactility.webserversettings",
|
||||||
.name = "Web Server",
|
.name = "Web Server",
|
||||||
.category = APP_CATEGORY_SYSTEM,
|
.category = APP_CATEGORY_SYSTEM,
|
||||||
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) }
|
.location = { APP_LOCATION_MEMORY, reinterpret_cast<void*>(appMain) },
|
||||||
|
.flags = APP_MANIFEST_FLAG_HIDDEN
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ bool load(McpSettings& settings) {
|
|||||||
auto mcp_enabled = map.find(KEY_MCP_ENABLED);
|
auto mcp_enabled = map.find(KEY_MCP_ENABLED);
|
||||||
settings.mcpEnabled = (mcp_enabled != map.end())
|
settings.mcpEnabled = (mcp_enabled != map.end())
|
||||||
? (mcp_enabled->second == "1" || mcp_enabled->second == "true")
|
? (mcp_enabled->second == "1" || mcp_enabled->second == "true")
|
||||||
: false;
|
: true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
McpSettings getDefault() {
|
McpSettings getDefault() {
|
||||||
return McpSettings{
|
return McpSettings{
|
||||||
.mcpEnabled = false
|
.mcpEnabled = true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ static bool loadSystemSettingsFromFile(SystemSettings& properties) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto time_format_entry = map.find("timeFormat24h");
|
auto time_format_entry = map.find("timeFormat24h");
|
||||||
bool time_format_24h = time_format_entry == map.end() ? true : (time_format_entry->second == "true");
|
bool time_format_24h = time_format_entry == map.end() ? false : (time_format_entry->second == "true");
|
||||||
properties.timeFormat24h = time_format_24h;
|
properties.timeFormat24h = time_format_24h;
|
||||||
|
|
||||||
// Load date format
|
// Load date format
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ bool load(WebServerSettings& settings) {
|
|||||||
// Web server settings
|
// Web server settings
|
||||||
settings.webServerEnabled = (webserver_enabled != map.end())
|
settings.webServerEnabled = (webserver_enabled != map.end())
|
||||||
? (webserver_enabled->second == "1" || webserver_enabled->second == "true")
|
? (webserver_enabled->second == "1" || webserver_enabled->second == "true")
|
||||||
: false;
|
: true;
|
||||||
|
|
||||||
settings.webServerPort = (webserver_port != map.end())
|
settings.webServerPort = (webserver_port != map.end())
|
||||||
? static_cast<uint16_t>(parseInt(webserver_port->second, 1, 65535, 80))
|
? static_cast<uint16_t>(parseInt(webserver_port->second, 1, 65535, 80))
|
||||||
@@ -206,7 +206,7 @@ WebServerSettings getDefault() {
|
|||||||
.apPassword = "", // Empty - will be auto-generated on first use (unless apOpenNetwork)
|
.apPassword = "", // Empty - will be auto-generated on first use (unless apOpenNetwork)
|
||||||
.apOpenNetwork = false, // Default to secured network
|
.apOpenNetwork = false, // Default to secured network
|
||||||
.apChannel = 1,
|
.apChannel = 1,
|
||||||
.webServerEnabled = false, // Default WebServer OFF for security
|
.webServerEnabled = true, // Default WebServer ON (simplified family UI: no toggle exposed)
|
||||||
.webServerPort = 80,
|
.webServerPort = 80,
|
||||||
.webServerAuthEnabled = false, // Auth disabled by default
|
.webServerAuthEnabled = false, // Auth disabled by default
|
||||||
.webServerUsername = "", // Empty - will be generated if auth is enabled
|
.webServerUsername = "", // Empty - will be generated if auth is enabled
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ std::string getTimeZoneName() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "Europe/Amsterdam";
|
return "America/New_York";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasTimeZone() {
|
bool hasTimeZone() {
|
||||||
@@ -105,13 +105,13 @@ std::string getTimeZoneCode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "CET-1CEST,M3.5.0,M10.5.0/3"; // Default: Europe/Amsterdam
|
return "EST5EDT,M3.2.0,M11.1.0"; // Default: America/New_York
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isTimeFormat24Hour() {
|
bool isTimeFormat24Hour() {
|
||||||
SystemSettings properties;
|
SystemSettings properties;
|
||||||
if (!loadSystemSettings(properties)) {
|
if (!loadSystemSettings(properties)) {
|
||||||
return true;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return properties.timeFormat24h;
|
return properties.timeFormat24h;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user