Merge upstream changes from Marlin 2.1.1
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
|
||||
#include "menu_item.h"
|
||||
#include "../../module/temperature.h"
|
||||
@@ -58,7 +58,7 @@
|
||||
#include "../../feature/password/password.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)
|
||||
#if (ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)) || (ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION))
|
||||
#include "../../feature/host_actions.h"
|
||||
#endif
|
||||
|
||||
@@ -106,8 +106,8 @@ void menu_configuration();
|
||||
|
||||
#if ENABLED(CUSTOM_MENU_MAIN)
|
||||
|
||||
void _lcd_custom_menu_main_gcode(PGM_P const cmd) {
|
||||
queue.inject_P(cmd);
|
||||
void _lcd_custom_menu_main_gcode(FSTR_P const fstr) {
|
||||
queue.inject(fstr);
|
||||
TERN_(CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK, ui.completion_feedback());
|
||||
TERN_(CUSTOM_MENU_MAIN_SCRIPT_RETURN, ui.return_to_status());
|
||||
}
|
||||
@@ -123,15 +123,14 @@ void menu_configuration();
|
||||
#else
|
||||
#define _DONE_SCRIPT ""
|
||||
#endif
|
||||
#define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(PSTR(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N));
|
||||
#define _CUSTOM_ITEM_MAIN_CONFIRM(N) \
|
||||
SUBMENU_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), []{ \
|
||||
MenuItem_confirm::confirm_screen( \
|
||||
GCODE_LAMBDA_MAIN(N), \
|
||||
ui.goto_previous_screen, \
|
||||
PSTR(MAIN_MENU_ITEM_##N##_DESC "?") \
|
||||
); \
|
||||
#define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(F(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_F(F(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N));
|
||||
#define _CUSTOM_ITEM_MAIN_CONFIRM(N) \
|
||||
SUBMENU_F(F(MAIN_MENU_ITEM_##N##_DESC), []{ \
|
||||
MenuItem_confirm::confirm_screen( \
|
||||
GCODE_LAMBDA_MAIN(N), nullptr, \
|
||||
F(MAIN_MENU_ITEM_##N##_DESC "?") \
|
||||
); \
|
||||
})
|
||||
|
||||
#define CUSTOM_ITEM_MAIN(N) do{ \
|
||||
@@ -247,19 +246,26 @@ void menu_main() {
|
||||
|
||||
if (card_detected) {
|
||||
if (!card_open) {
|
||||
#if PIN_EXISTS(SD_DETECT)
|
||||
GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21")); // M21 Change Media
|
||||
#else // - or -
|
||||
GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22")); // M22 Release Media
|
||||
#if HAS_SD_DETECT
|
||||
GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media
|
||||
#else // - or -
|
||||
ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media
|
||||
queue.inject(F("M22"));
|
||||
#if ENABLED(TFT_COLOR_UI)
|
||||
// Menu display issue on item removal with multi language selection menu
|
||||
if (encoderTopLine > 0) encoderTopLine--;
|
||||
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
#endif
|
||||
});
|
||||
#endif
|
||||
SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First)
|
||||
SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First)
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if PIN_EXISTS(SD_DETECT)
|
||||
ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media"
|
||||
#if HAS_SD_DETECT
|
||||
ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media"
|
||||
#else
|
||||
GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21")); // M21 Attach Media
|
||||
GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media
|
||||
#endif
|
||||
}
|
||||
};
|
||||
@@ -273,9 +279,9 @@ void menu_main() {
|
||||
#if MACHINE_CAN_STOP
|
||||
SUBMENU(MSG_STOP_PRINT, []{
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT(MSG_BUTTON_STOP), GET_TEXT(MSG_BACK),
|
||||
ui.abort_print, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_STOP_PRINT), (const char *)nullptr, PSTR("?")
|
||||
GET_TEXT_F(MSG_BUTTON_STOP), GET_TEXT_F(MSG_BACK),
|
||||
ui.abort_print, nullptr,
|
||||
GET_TEXT_F(MSG_STOP_PRINT), (const char *)nullptr, F("?")
|
||||
);
|
||||
});
|
||||
#endif
|
||||
@@ -301,7 +307,7 @@ void menu_main() {
|
||||
ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
|
||||
|
||||
#if ENABLED(HOST_START_MENU_ITEM) && defined(ACTION_ON_START)
|
||||
ACTION_ITEM(MSG_HOST_START_PRINT, host_action_start);
|
||||
ACTION_ITEM(MSG_HOST_START_PRINT, hostui.start);
|
||||
#endif
|
||||
|
||||
#if ENABLED(PREHEAT_SHORTCUT_MENU_ITEM)
|
||||
@@ -336,7 +342,7 @@ void menu_main() {
|
||||
#if ENABLED(CUSTOM_MENU_MAIN)
|
||||
if (TERN1(CUSTOM_MENU_MAIN_ONLY_IDLE, !busy)) {
|
||||
#ifdef CUSTOM_MENU_MAIN_TITLE
|
||||
SUBMENU_P(PSTR(CUSTOM_MENU_MAIN_TITLE), custom_menus_main);
|
||||
SUBMENU_F(F(CUSTOM_MENU_MAIN_TITLE), custom_menus_main);
|
||||
#else
|
||||
SUBMENU(MSG_CUSTOM_COMMANDS, custom_menus_main);
|
||||
#endif
|
||||
@@ -346,8 +352,8 @@ void menu_main() {
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
#if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
||||
YESNO_ITEM(MSG_FILAMENTCHANGE,
|
||||
menu_change_filament, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_FILAMENTCHANGE), (const char *)nullptr, PSTR("?")
|
||||
menu_change_filament, nullptr,
|
||||
GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")
|
||||
);
|
||||
#else
|
||||
SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
|
||||
@@ -370,14 +376,14 @@ void menu_main() {
|
||||
#if ENABLED(PS_OFF_CONFIRM)
|
||||
CONFIRM_ITEM(MSG_SWITCH_PS_OFF,
|
||||
MSG_YES, MSG_NO,
|
||||
ui.poweroff, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SWITCH_PS_OFF), (const char *)nullptr, PSTR("?")
|
||||
ui.poweroff, nullptr,
|
||||
GET_TEXT_F(MSG_SWITCH_PS_OFF), (const char *)nullptr, F("?")
|
||||
);
|
||||
#else
|
||||
GCODES_ITEM(MSG_SWITCH_PS_OFF, PSTR("M81"));
|
||||
ACTION_ITEM(MSG_SWITCH_PS_OFF, ui.poweroff);
|
||||
#endif
|
||||
else
|
||||
GCODES_ITEM(MSG_SWITCH_PS_ON, PSTR("M80"));
|
||||
GCODES_ITEM(MSG_SWITCH_PS_ON, F("M80"));
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP)
|
||||
@@ -392,24 +398,24 @@ void menu_main() {
|
||||
ui.return_to_status();
|
||||
};
|
||||
#if SERVICE_INTERVAL_1 > 0
|
||||
CONFIRM_ITEM_P(PSTR(SERVICE_NAME_1),
|
||||
CONFIRM_ITEM_F(F(SERVICE_NAME_1),
|
||||
MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
|
||||
[]{ _service_reset(1); }, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_1), PSTR("?")
|
||||
[]{ _service_reset(1); }, nullptr,
|
||||
GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_1), F("?")
|
||||
);
|
||||
#endif
|
||||
#if SERVICE_INTERVAL_2 > 0
|
||||
CONFIRM_ITEM_P(PSTR(SERVICE_NAME_2),
|
||||
CONFIRM_ITEM_F(F(SERVICE_NAME_2),
|
||||
MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
|
||||
[]{ _service_reset(2); }, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_2), PSTR("?")
|
||||
[]{ _service_reset(2); }, nullptr,
|
||||
GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_2), F("?")
|
||||
);
|
||||
#endif
|
||||
#if SERVICE_INTERVAL_3 > 0
|
||||
CONFIRM_ITEM_P(PSTR(SERVICE_NAME_3),
|
||||
CONFIRM_ITEM_F(F(SERVICE_NAME_3),
|
||||
MSG_BUTTON_RESET, MSG_BUTTON_CANCEL,
|
||||
[]{ _service_reset(3); }, ui.goto_previous_screen,
|
||||
GET_TEXT(MSG_SERVICE_RESET), F(SERVICE_NAME_3), PSTR("?")
|
||||
[]{ _service_reset(3); }, nullptr,
|
||||
GET_TEXT_F(MSG_SERVICE_RESET), F(SERVICE_NAME_3), F("?")
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
@@ -442,7 +448,17 @@ void menu_main() {
|
||||
SUBMENU(LANGUAGE, menu_language);
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION)
|
||||
SUBMENU(MSG_HOST_SHUTDOWN, []{
|
||||
MenuItem_confirm::select_screen(
|
||||
GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BUTTON_CANCEL),
|
||||
[]{ ui.return_to_status(); hostui.shutdown(); }, nullptr,
|
||||
GET_TEXT_F(MSG_HOST_SHUTDOWN), (const char *)nullptr, F("?")
|
||||
);
|
||||
});
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
Reference in New Issue
Block a user