This commit is contained in:
Ben Meadors 2025-07-30 20:05:21 -05:00
parent 22470bca9a
commit 3d2ec6fb85
2 changed files with 3 additions and 10 deletions

View File

@ -27,7 +27,6 @@ bool test_enabled = false;
uint8_t test_count = 0; uint8_t test_count = 0;
void menuHandler::LoraRegionPicker(uint32_t duration) void menuHandler::LoraRegionPicker(uint32_t duration)
// ...existing code...
{ {
static const char *optionsArray[] = {"Back", static const char *optionsArray[] = {"Back",
"US", "US",
@ -356,11 +355,7 @@ void menuHandler::homeBaseMenu()
InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_SEND_PING, .kbchar = 0, .touchX = 0, .touchY = 0}; InputEvent event = {.inputEvent = (input_broker_event)INPUT_BROKER_SEND_PING, .kbchar = 0, .touchX = 0, .touchY = 0};
inputBroker->injectInputEvent(&event); inputBroker->injectInputEvent(&event);
} else if (selected == Preset) { } else if (selected == Preset) {
#if CANNED_MESSAGE_ADD_CONFIRMATION
showConfirmationBanner("Send message?", [] { cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); });
#else
cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST);
#endif
} else if (selected == Freetext) { } else if (selected == Freetext) {
cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST);
} }
@ -389,11 +384,7 @@ void menuHandler::textMessageBaseMenu()
bannerOptions.optionsCount = options; bannerOptions.optionsCount = options;
bannerOptions.bannerCallback = [](int selected) -> void { bannerOptions.bannerCallback = [](int selected) -> void {
if (selected == Preset) { if (selected == Preset) {
#if CANNED_MESSAGE_ADD_CONFIRMATION
showConfirmationBanner("Send message?", [] { cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); });
#else
cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST); cannedMessageModule->LaunchWithDestination(NODENUM_BROADCAST);
#endif
} else if (selected == Freetext) { } else if (selected == Freetext) {
cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST); cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST);
} }

View File

@ -598,8 +598,10 @@ bool CannedMessageModule::handleMessageSelectorInput(const InputEvent *event, bo
// Show confirmation dialog before sending canned message // Show confirmation dialog before sending canned message
NodeNum destNode = dest; NodeNum destNode = dest;
ChannelIndex chan = channel; ChannelIndex chan = channel;
#if CANNED_MESSAGE_ADD_CONFIRMATION
graphics::menuHandler::showConfirmationBanner( graphics::menuHandler::showConfirmationBanner(
"Send preset message?", [this, destNode, chan, current]() { this->sendText(destNode, chan, current, false); }); "Send message?", [this, destNode, chan, current]() { this->sendText(destNode, chan, current, false); });
#endif
// Do not immediately set runState; wait for confirmation // Do not immediately set runState; wait for confirmation
handled = true; handled = true;
} }