fix(color): can not exit Ghost module config page with no module attached (#7599)
This commit is contained in:
@@ -63,6 +63,8 @@ class GhostModuleConfigWindow : public Window
|
|||||||
|
|
||||||
void checkEvents() override
|
void checkEvents() override
|
||||||
{
|
{
|
||||||
|
Window::checkEvents();
|
||||||
|
|
||||||
for (uint8_t i = 0; i < GHST_MENU_LINES; i += 1) {
|
for (uint8_t i = 0; i < GHST_MENU_LINES; i += 1) {
|
||||||
menuLines[i][1]->setText("");
|
menuLines[i][1]->setText("");
|
||||||
|
|
||||||
@@ -167,6 +169,7 @@ void RadioGhostModuleConfig::onLongPressRTN()
|
|||||||
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_CLOSE;
|
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_CLOSE;
|
||||||
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
|
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
|
||||||
sleep_ms(10);
|
sleep_ms(10);
|
||||||
|
deleteLater();
|
||||||
#if defined(TRIMS_EMULATE_BUTTONS)
|
#if defined(TRIMS_EMULATE_BUTTONS)
|
||||||
setHatsAsKeys(false); // switch trims back to normal
|
setHatsAsKeys(false); // switch trims back to normal
|
||||||
#endif
|
#endif
|
||||||
@@ -195,6 +198,9 @@ void RadioGhostModuleConfig::checkEvents()
|
|||||||
void RadioGhostModuleConfig::init()
|
void RadioGhostModuleConfig::init()
|
||||||
{
|
{
|
||||||
memclear(&reusableBuffer.ghostMenu, sizeof(reusableBuffer.ghostMenu));
|
memclear(&reusableBuffer.ghostMenu, sizeof(reusableBuffer.ghostMenu));
|
||||||
|
strAppend((char *)&reusableBuffer.ghostMenu.line[1].menuText,
|
||||||
|
STR_WAITING_FOR_MODULE, 0);
|
||||||
|
reusableBuffer.ghostMenu.line[1].lineFlags = GHST_LINE_FLAGS_VALUE_EDIT;
|
||||||
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_NONE;
|
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_NONE;
|
||||||
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_OPEN;
|
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_OPEN;
|
||||||
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
|
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
|
||||||
|
|||||||
@@ -39,5 +39,6 @@ class RadioGhostModuleConfig: public Page
|
|||||||
void checkEvents() override;
|
void checkEvents() override;
|
||||||
void onCancel() override;
|
void onCancel() override;
|
||||||
void onLongPressRTN() override;
|
void onLongPressRTN() override;
|
||||||
|
void doKeyShortcut(event_t) override {}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user