🎨 Refactor Host Actions as singleton

This commit is contained in:
Scott Lahteine
2021-10-15 00:24:08 -05:00
committed by Scott Lahteine
parent 1ead7ce681
commit f80bcdcc5c
26 changed files with 208 additions and 150 deletions

View File

@ -242,7 +242,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
if (ExtUI::isPrintingFromMedia())
ExtUI::pausePrint();
#ifdef ACTION_ON_PAUSE
else host_action_pause();
else hostui.pause();
#endif
GOTO_SCREEN(StatusScreen);
break;
@ -251,7 +251,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
if (ExtUI::isPrintingFromMedia())
ExtUI::resumePrint();
#ifdef ACTION_ON_RESUME
else host_action_resume();
else hostui.resume();
#endif
GOTO_SCREEN(StatusScreen);
break;

View File

@ -41,7 +41,7 @@ bool ConfirmAbortPrintDialogBox::onTouchEnd(uint8_t tag) {
if (ExtUI::isPrintingFromMedia())
ExtUI::stopPrint();
#ifdef ACTION_ON_CANCEL
else host_action_cancel();
else hostui.cancel();
#endif
return true;
default:

View File

@ -138,7 +138,7 @@ void TuneMenu::pausePrint() {
if (ExtUI::isPrintingFromMedia())
ExtUI::pausePrint();
#ifdef ACTION_ON_PAUSE
else host_action_pause();
else hostui.pause();
#endif
GOTO_SCREEN(StatusScreen);
}
@ -150,7 +150,7 @@ void TuneMenu::resumePrint() {
else if (ExtUI::isPrintingFromMedia())
ExtUI::resumePrint();
#ifdef ACTION_ON_RESUME
else host_action_resume();
else hostui.resume();
#endif
GOTO_SCREEN(StatusScreen);
}

View File

@ -918,7 +918,7 @@ namespace ExtUI {
#endif // HAS_LEVELING
#if ENABLED(HOST_PROMPT_SUPPORT)
void setHostResponse(const uint8_t response) { host_response_handler(response); }
void setHostResponse(const uint8_t response) { hostui.handle_response(response); }
#endif
#if ENABLED(PRINTCOUNTER)