Public Access
M0 step 7: Settings, About, Storage, first-boot setup
- lib/apps_model (host-tested): SettingsMenu (rows, readable values, choices, validation messages) and SetupWizard (names, Region confirmation, timezone; saves only when finished) - AppManager: modal Apps that Home/Back can't leave (setup wizard) - SettingsApp: all settings plus Storage (usage, erase SD behind a dialog) and About (version, node id, battery, memory, uptime) pages, replacing the temporary Diagnostics App - SetupApp: first-boot wizard, opened modally until SetupDone - Node id and default names derived from the MAC like Meshtastic - Widget demo is now hidden (About, then w) - lib_ldf_mode = deep+ so libraries see each other's headers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -21,19 +21,41 @@ void AppManager::begin() {
|
||||
redraw_ = true;
|
||||
}
|
||||
|
||||
bool AppManager::open(const char* id) {
|
||||
for (auto& info : apps_) {
|
||||
if (std::strcmp(info.id, id) == 0) {
|
||||
switchTo(*info.app);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
App* AppManager::find(const char* id) const {
|
||||
for (auto& info : apps_)
|
||||
if (std::strcmp(info.id, id) == 0) return info.app;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AppManager::home() { switchTo(launcher_); }
|
||||
bool AppManager::open(const char* id) {
|
||||
App* app = find(id);
|
||||
if (!app || modal_) return false;
|
||||
switchTo(*app);
|
||||
return true;
|
||||
}
|
||||
|
||||
void AppManager::home() {
|
||||
if (!modal_) switchTo(launcher_);
|
||||
}
|
||||
|
||||
bool AppManager::openModal(const char* id) {
|
||||
App* app = find(id);
|
||||
if (!app) return false;
|
||||
switchTo(*app);
|
||||
modal_ = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AppManager::endModal() {
|
||||
modal_ = false;
|
||||
switchTo(launcher_);
|
||||
}
|
||||
|
||||
void AppManager::handleKey(const KeyEvent& event) {
|
||||
if (modal_) {
|
||||
foreground_->onKey(event);
|
||||
return;
|
||||
}
|
||||
if (event.key == Key::Home) {
|
||||
home();
|
||||
return;
|
||||
@@ -42,6 +64,12 @@ void AppManager::handleKey(const KeyEvent& event) {
|
||||
if (!consumed && event.key == Key::Back) home();
|
||||
}
|
||||
|
||||
const char* AppManager::foregroundTitle() const {
|
||||
for (auto& info : apps_)
|
||||
if (info.app == foreground_) return info.title;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool AppManager::takeRedraw() {
|
||||
bool r = redraw_ | foreground_->consumeRedraw();
|
||||
redraw_ = false;
|
||||
|
||||
Reference in New Issue
Block a user