Add card.longest_filename, more lcd_strlen updates
This commit is contained in:
parent
036f25e159
commit
7e648f3721
6 changed files with 39 additions and 44 deletions
|
|
@ -265,8 +265,8 @@ uint16_t max_display_update_time = 0;
|
|||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
void lcd_sdcard_menu();
|
||||
void menu_action_sdfile(const char* filename, char* longFilename);
|
||||
void menu_action_sddirectory(const char* filename, char* longFilename);
|
||||
void menu_action_sdfile(CardReader& theCard);
|
||||
void menu_action_sddirectory(CardReader& theCard);
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
|
@ -756,7 +756,7 @@ void lcd_reset_status() {
|
|||
msg = paused;
|
||||
#if ENABLED(SDSUPPORT)
|
||||
else if (card.sdprinting)
|
||||
return lcd_setstatus(card.longFilename[0] ? card.longFilename : card.filename, true);
|
||||
return lcd_setstatus(card.longest_filename(), true);
|
||||
#endif
|
||||
else if (print_job_timer.isRunning())
|
||||
msg = printing;
|
||||
|
|
@ -4031,9 +4031,9 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
|||
#endif
|
||||
|
||||
if (card.filenameIsDir)
|
||||
MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
|
||||
MENU_ITEM(sddirectory, MSG_CARD_MENU, card);
|
||||
else
|
||||
MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
|
||||
MENU_ITEM(sdfile, MSG_CARD_MENU, card);
|
||||
}
|
||||
else {
|
||||
MENU_ITEM_DUMMY();
|
||||
|
|
@ -4954,19 +4954,17 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
|||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
void menu_action_sdfile(const char* filename, char* longFilename) {
|
||||
void menu_action_sdfile(CardReader& theCard) {
|
||||
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
||||
last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use
|
||||
#endif
|
||||
UNUSED(longFilename);
|
||||
card.openAndPrintFile(filename);
|
||||
card.openAndPrintFile(theCard.filename);
|
||||
lcd_return_to_status();
|
||||
lcd_reset_status();
|
||||
}
|
||||
|
||||
void menu_action_sddirectory(const char* filename, char* longFilename) {
|
||||
UNUSED(longFilename);
|
||||
card.chdir(filename);
|
||||
void menu_action_sddirectory(CardReader& theCard) {
|
||||
card.chdir(theCard.filename);
|
||||
encoderTopLine = 0;
|
||||
encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM;
|
||||
screen_changed = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue