Public Access
- 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
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "settings.h"
|
|
|
|
namespace roro {
|
|
|
|
// What the Settings App lists: one row per user-facing setting (plus sub-pages), with readable
|
|
// values, choice lists and validation messages. Rendering and navigation live in the App.
|
|
class SettingsMenu {
|
|
public:
|
|
enum class Row { LongName, ShortName, Region, Timezone, Brightness, DimTimeout, OffTimeout, Sound, ProbeMacs, Storage, About };
|
|
enum class Kind { Text, Choice, Toggle, Slider, Page };
|
|
|
|
explicit SettingsMenu(Settings& settings) : settings_(settings) {}
|
|
|
|
int count() const;
|
|
Row row(int i) const;
|
|
Kind kind(int i) const;
|
|
std::string label(int i) const;
|
|
std::string value(int i) const;
|
|
|
|
// Choice rows
|
|
std::vector<std::string> choices(int i) const;
|
|
int currentChoice(int i) const; // -1 if the current value isn't one of the choices
|
|
std::string choose(int i, int choice); // empty on success, otherwise why it was refused
|
|
|
|
// Toggle and Slider rows
|
|
void toggle(int i);
|
|
void adjust(int i, int direction);
|
|
|
|
// Text rows
|
|
int maxBytes(int i) const;
|
|
std::string setText(int i, const std::string& text); // empty on success, otherwise why
|
|
|
|
private:
|
|
Settings& settings_;
|
|
};
|
|
|
|
} // namespace roro
|