|
@@ -72,22 +72,6 @@ inline void sdcard_start_selected_file() {
|
72
|
72
|
ui.reset_status();
|
73
|
73
|
}
|
74
|
74
|
|
75
|
|
-#if ENABLED(SD_MENU_CONFIRM_START)
|
76
|
|
-
|
77
|
|
- void menu_sd_confirm() {
|
78
|
|
- char * const longest = card.longest_filename();
|
79
|
|
- char buffer[strlen(longest) + 2];
|
80
|
|
- buffer[0] = ' ';
|
81
|
|
- strcpy(buffer + 1, longest);
|
82
|
|
- MenuItem_confirm::select_screen(
|
83
|
|
- GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL),
|
84
|
|
- sdcard_start_selected_file, ui.goto_previous_screen,
|
85
|
|
- GET_TEXT(MSG_START_PRINT), buffer, PSTR("?")
|
86
|
|
- );
|
87
|
|
- }
|
88
|
|
-
|
89
|
|
-#endif
|
90
|
|
-
|
91
|
75
|
class MenuItem_sdfile : public MenuItem_sdbase {
|
92
|
76
|
public:
|
93
|
77
|
static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) {
|
|
@@ -101,7 +85,17 @@ class MenuItem_sdfile : public MenuItem_sdbase {
|
101
|
85
|
sd_items = screen_items;
|
102
|
86
|
#endif
|
103
|
87
|
#if ENABLED(SD_MENU_CONFIRM_START)
|
104
|
|
- MenuItem_submenu::action(pstr, menu_sd_confirm);
|
|
88
|
+ MenuItem_submenu::action(pstr, []{
|
|
89
|
+ char * const longest = card.longest_filename();
|
|
90
|
+ char buffer[strlen(longest) + 2];
|
|
91
|
+ buffer[0] = ' ';
|
|
92
|
+ strcpy(buffer + 1, longest);
|
|
93
|
+ MenuItem_confirm::select_screen(
|
|
94
|
+ GET_TEXT(MSG_BUTTON_PRINT), GET_TEXT(MSG_BUTTON_CANCEL),
|
|
95
|
+ sdcard_start_selected_file, ui.goto_previous_screen,
|
|
96
|
+ GET_TEXT(MSG_START_PRINT), buffer, PSTR("?")
|
|
97
|
+ );
|
|
98
|
+ });
|
105
|
99
|
#else
|
106
|
100
|
sdcard_start_selected_file();
|
107
|
101
|
UNUSED(pstr);
|