mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-30 02:15:41 +00:00
Rename System Frame (from Memory) and add Dismiss Frame
This commit is contained in:
parent
cf574c71d8
commit
42516f541e
@ -933,10 +933,10 @@ void Screen::setFrames(FrameFocus focus)
|
||||
normalFrames[numframes++] = graphics::DebugRenderer::drawLoRaFocused;
|
||||
indicatorIcons.push_back(icon_radio);
|
||||
}
|
||||
if (!dismissedFrames.memory) {
|
||||
fsi.positions.memory = numframes;
|
||||
normalFrames[numframes++] = graphics::DebugRenderer::drawMemoryUsage;
|
||||
indicatorIcons.push_back(icon_memory);
|
||||
if (!dismissedFrames.system) {
|
||||
fsi.positions.system = numframes;
|
||||
normalFrames[numframes++] = graphics::DebugRenderer::drawSystemScreen;
|
||||
indicatorIcons.push_back(icon_system);
|
||||
}
|
||||
#if !defined(DISPLAY_CLOCK_FRAME)
|
||||
fsi.positions.clock = numframes;
|
||||
@ -1047,7 +1047,7 @@ void Screen::setFrames(FrameFocus focus)
|
||||
ui->switchToFrame(fsi.positions.clock);
|
||||
break;
|
||||
case FOCUS_SYSTEM:
|
||||
ui->switchToFrame(fsi.positions.memory);
|
||||
ui->switchToFrame(fsi.positions.system);
|
||||
break;
|
||||
|
||||
case FOCUS_PRESERVE:
|
||||
@ -1096,9 +1096,9 @@ void Screen::dismissCurrentFrame()
|
||||
LOG_DEBUG("Dismiss WiFi Screen");
|
||||
dismissedFrames.wifi = true;
|
||||
dismissed = true;
|
||||
} else if (currentFrame == framesetInfo.positions.memory) {
|
||||
} else if (currentFrame == framesetInfo.positions.system) {
|
||||
LOG_INFO("Dismiss Memory");
|
||||
dismissedFrames.memory = true;
|
||||
dismissedFrames.system = true;
|
||||
dismissed = true;
|
||||
}
|
||||
|
||||
@ -1366,7 +1366,7 @@ int Screen::handleInputEvent(const InputEvent *event)
|
||||
} else if (event->inputEvent == INPUT_BROKER_SELECT) {
|
||||
if (this->ui->getUiState()->currentFrame == framesetInfo.positions.home) {
|
||||
menuHandler::homeBaseMenu();
|
||||
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.memory) {
|
||||
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.system) {
|
||||
menuHandler::systemBaseMenu();
|
||||
#if HAS_GPS
|
||||
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.gps && gps) {
|
||||
|
@ -653,7 +653,7 @@ class Screen : public concurrency::OSThread
|
||||
uint8_t settings = 255;
|
||||
uint8_t wifi = 255;
|
||||
uint8_t deviceFocused = 255;
|
||||
uint8_t memory = 255;
|
||||
uint8_t system = 255;
|
||||
uint8_t gps = 255;
|
||||
uint8_t home = 255;
|
||||
uint8_t textMessage = 255;
|
||||
@ -675,7 +675,7 @@ class Screen : public concurrency::OSThread
|
||||
bool textMessage = false;
|
||||
bool waypoint = false;
|
||||
bool wifi = false;
|
||||
bool memory = false;
|
||||
bool system = false;
|
||||
} dismissedFrames;
|
||||
|
||||
/// Try to start drawing ASAP
|
||||
|
@ -485,7 +485,7 @@ void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x,
|
||||
// ****************************
|
||||
// * System Screen *
|
||||
// ****************************
|
||||
void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||
void drawSystemScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||
{
|
||||
display->clear();
|
||||
display->setFont(FONT_SMALL);
|
||||
|
@ -31,8 +31,8 @@ void drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiState *state
|
||||
// LoRa information display
|
||||
void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||
|
||||
// Memory screen display
|
||||
void drawMemoryUsage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||
// System screen display
|
||||
void drawSystemScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||
} // namespace DebugRenderer
|
||||
|
||||
} // namespace graphics
|
||||
|
@ -375,7 +375,7 @@ void menuHandler::textMessageBaseMenu()
|
||||
|
||||
void menuHandler::systemBaseMenu()
|
||||
{
|
||||
enum optionsNumbers { Back, Notifications, ScreenOptions, PowerMenu, Test, enumEnd };
|
||||
enum optionsNumbers { Back, Notifications, ScreenOptions, PowerMenu, Test, DismissSystemFrame, enumEnd };
|
||||
static const char *optionsArray[enumEnd] = {"Back"};
|
||||
static int optionsEnumArray[enumEnd] = {Back};
|
||||
int options = 1;
|
||||
@ -396,6 +396,9 @@ void menuHandler::systemBaseMenu()
|
||||
optionsEnumArray[options++] = Test;
|
||||
}
|
||||
|
||||
optionsArray[options] = "Dismiss Frame";
|
||||
optionsEnumArray[options++] = DismissSystemFrame;
|
||||
|
||||
BannerOverlayOptions bannerOptions;
|
||||
bannerOptions.message = "System Action";
|
||||
bannerOptions.optionsArrayPtr = optionsArray;
|
||||
@ -414,6 +417,9 @@ void menuHandler::systemBaseMenu()
|
||||
} else if (selected == Test) {
|
||||
menuHandler::menuQueue = menuHandler::test_menu;
|
||||
screen->runNow();
|
||||
} else if (selected == DismissSystemFrame) {
|
||||
menuHandler::menuQueue = menuHandler::DismissSystemFrame;
|
||||
screen->runNow();
|
||||
} else if (selected == Back && !test_enabled) {
|
||||
test_count++;
|
||||
if (test_count > 4) {
|
||||
@ -1067,6 +1073,24 @@ void menuHandler::keyVerificationFinalPrompt()
|
||||
}
|
||||
}
|
||||
|
||||
void menuHandler::DismissSystemFrame_menu()
|
||||
{
|
||||
static const char *optionsArray[] = {"Back", "Confirm"};
|
||||
BannerOverlayOptions bannerOptions;
|
||||
bannerOptions.message = "Dismiss System Frame?";
|
||||
bannerOptions.optionsArrayPtr = optionsArray;
|
||||
bannerOptions.optionsCount = 2;
|
||||
bannerOptions.bannerCallback = [](int selected) -> void {
|
||||
if (selected == 1) {
|
||||
screen->dismissCurrentFrame();
|
||||
} else {
|
||||
menuQueue = system_base_menu;
|
||||
screen->runNow();
|
||||
}
|
||||
};
|
||||
screen->showOverlayBanner(bannerOptions);
|
||||
}
|
||||
|
||||
void menuHandler::handleMenuSwitch(OLEDDisplay *display)
|
||||
{
|
||||
if (menuQueue != menu_none)
|
||||
@ -1157,6 +1181,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display)
|
||||
case power_menu:
|
||||
powerMenu();
|
||||
break;
|
||||
case DismissSystemFrame:
|
||||
DismissSystemFrame_menu();
|
||||
break;
|
||||
case throttle_message:
|
||||
screen->showSimpleBanner("Too Many Attempts\nTry again in 60 seconds.", 5000);
|
||||
break;
|
||||
|
@ -36,7 +36,8 @@ class menuHandler
|
||||
system_base_menu,
|
||||
key_verification_init,
|
||||
key_verification_final_prompt,
|
||||
throttle_message
|
||||
throttle_message,
|
||||
DismissSystemFrame
|
||||
};
|
||||
static screenMenus menuQueue;
|
||||
|
||||
@ -71,6 +72,7 @@ class menuHandler
|
||||
static void notificationsMenu();
|
||||
static void screenOptionsMenu();
|
||||
static void powerMenu();
|
||||
static void DismissSystemFrame_menu();
|
||||
|
||||
private:
|
||||
static void saveUIConfig();
|
||||
|
@ -117,8 +117,8 @@ const uint8_t icon_radio[] PROGMEM = {
|
||||
0xA9 // Row 7: #..#.#.#
|
||||
};
|
||||
|
||||
// 🪙 Memory Icon
|
||||
const uint8_t icon_memory[] PROGMEM = {
|
||||
// 🪙 System Icon
|
||||
const uint8_t icon_system[] PROGMEM = {
|
||||
0x24, // Row 0: ..#..#..
|
||||
0x3C, // Row 1: ..####..
|
||||
0xC3, // Row 2: ##....##
|
||||
|
Loading…
Reference in New Issue
Block a user