mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-31 02:45:41 +00:00
Create LoRa Menu, move Region Picker into submenu, add Dismiss Frame option
This commit is contained in:
parent
ff8275e0dd
commit
7e067f5bf5
@ -1107,6 +1107,10 @@ void Screen::dismissCurrentFrame()
|
|||||||
LOG_DEBUG("Dismiss WiFi Screen");
|
LOG_DEBUG("Dismiss WiFi Screen");
|
||||||
dismissedFrames.wifi = true;
|
dismissedFrames.wifi = true;
|
||||||
dismissed = true;
|
dismissed = true;
|
||||||
|
} else if (currentFrame == framesetInfo.positions.lora) {
|
||||||
|
LOG_INFO("Dismiss LoRa");
|
||||||
|
dismissedFrames.lora = true;
|
||||||
|
dismissed = true;
|
||||||
} else if (currentFrame == framesetInfo.positions.system) {
|
} else if (currentFrame == framesetInfo.positions.system) {
|
||||||
LOG_INFO("Dismiss Memory");
|
LOG_INFO("Dismiss Memory");
|
||||||
dismissedFrames.system = true;
|
dismissedFrames.system = true;
|
||||||
@ -1416,7 +1420,7 @@ int Screen::handleInputEvent(const InputEvent *event)
|
|||||||
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.clock) {
|
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.clock) {
|
||||||
menuHandler::clockMenu();
|
menuHandler::clockMenu();
|
||||||
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.lora) {
|
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.lora) {
|
||||||
menuHandler::LoraRegionPicker();
|
menuHandler::loraMenu();
|
||||||
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.textMessage) {
|
} else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.textMessage) {
|
||||||
if (devicestate.rx_text_message.from) {
|
if (devicestate.rx_text_message.from) {
|
||||||
menuHandler::messageResponseMenu();
|
menuHandler::messageResponseMenu();
|
||||||
|
@ -23,6 +23,25 @@ menuHandler::screenMenus menuHandler::menuQueue = menu_none;
|
|||||||
bool test_enabled = false;
|
bool test_enabled = false;
|
||||||
uint8_t test_count = 0;
|
uint8_t test_count = 0;
|
||||||
|
|
||||||
|
void menuHandler::loraMenu()
|
||||||
|
{
|
||||||
|
static const char *optionsArray[] = {"Back", "Region Picker", "Dismiss Frame"};
|
||||||
|
enum optionsNumbers { Back = 0, lora_picker = 1, DismissCurrentFrame = 2 };
|
||||||
|
BannerOverlayOptions bannerOptions;
|
||||||
|
bannerOptions.message = "LoRa Actions";
|
||||||
|
bannerOptions.optionsArrayPtr = optionsArray;
|
||||||
|
bannerOptions.optionsCount = 3;
|
||||||
|
bannerOptions.bannerCallback = [](int selected) -> void {
|
||||||
|
if (selected == Back) {
|
||||||
|
menuHandler::menuQueue = menuHandler::clock_menu;
|
||||||
|
screen->runNow();
|
||||||
|
} else if (selected == DismissCurrentFrame) {
|
||||||
|
menuHandler::menuQueue = menuHandler::DismissCurrentFrame;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
screen->showOverlayBanner(bannerOptions);
|
||||||
|
}
|
||||||
|
|
||||||
void menuHandler::LoraRegionPicker(uint32_t duration)
|
void menuHandler::LoraRegionPicker(uint32_t duration)
|
||||||
{
|
{
|
||||||
static const char *optionsArray[] = {"Back",
|
static const char *optionsArray[] = {"Back",
|
||||||
|
@ -42,6 +42,7 @@ class menuHandler
|
|||||||
static screenMenus menuQueue;
|
static screenMenus menuQueue;
|
||||||
|
|
||||||
static void LoraRegionPicker(uint32_t duration = 30000);
|
static void LoraRegionPicker(uint32_t duration = 30000);
|
||||||
|
static void loraMenu();
|
||||||
static void handleMenuSwitch(OLEDDisplay *display);
|
static void handleMenuSwitch(OLEDDisplay *display);
|
||||||
static void clockMenu();
|
static void clockMenu();
|
||||||
static void TZPicker();
|
static void TZPicker();
|
||||||
|
Loading…
Reference in New Issue
Block a user