Files
roro9stack/src/apps/debug_console_page.h
T
twislaandClaude Opus 5.5 0c52613b72
CI / build (pull_request) Successful in 2m22s
Site / build (pull_request) Successful in 10s
Settings: its rows in five groups
Settings had grown to 21 rows in one list. It opens on five groups (This
device, Display, GNSS and radio, Network, System); Enter opens one, Back
returns to the groups, and Back from the groups leaves Settings.

SettingsMenu holds the groups and which one is open (host-tested: every
setting is in exactly one group). The guide, the how-tos, the README,
the scripts' messages and the firmware's own name the new paths, such as
"Settings > System > Firmware".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
2026-10-10 00:11:52 +02:00

47 lines
1.3 KiB
C++

#pragma once
#include <memory>
#include <string>
#include "dialog_model.h"
#include "key_event.h"
#include "key_help.h"
#include "line_editor.h"
#include "list_model.h"
#include "services/wifi_service.h"
#include "settings.h"
#include "ui/canvas.h"
#include "ui/theme.h"
namespace roro {
// Settings → System → Debug Console (ADR 0010): the switch, where to connect, and the token, which is shown
// here and nowhere else. Switching on makes a token if there's none; a new one, or one typed by
// hand, ends the connection of whoever holds the old one.
class DebugConsolePage {
public:
DebugConsolePage(Settings& settings, WifiService& wifi) : settings_(settings), wifi_(wifi) {}
void enter();
bool onKey(const KeyEvent& e); // false: leave the page
bool textEntryActive() const { return typing_; }
void draw(Canvas& c);
void help(std::vector<KeyHelp>& out) const;
const char* helpTitle() const { return typing_ ? "A token of your own" : "Debug Console"; }
private:
enum Row { kSwitch, kAddress, kNewToken, kTypeToken, kRows };
enum class Ask { None, SwitchOn, NewToken };
Settings& settings_;
WifiService& wifi_;
ListModel list_{kRows};
std::unique_ptr<DialogModel> confirm_;
Ask ask_ = Ask::None;
bool typing_ = false;
LineEditor editor_{64};
std::string refusal_;
};
} // namespace roro