My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

confirm_start_print_dialog_box.cpp 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**************************************
  2. * confirm_start_print_dialog_box.cpp *
  3. **************************************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  7. * *
  8. * This program is free software: you can redistribute it and/or modify *
  9. * it under the terms of the GNU General Public License as published by *
  10. * the Free Software Foundation, either version 3 of the License, or *
  11. * (at your option) any later version. *
  12. * *
  13. * This program is distributed in the hope that it will be useful, *
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  16. * GNU General Public License for more details. *
  17. * *
  18. * To view a copy of the GNU General Public License, go to the following *
  19. * location: <https://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #if ENABLED(TOUCH_UI_FTDI_EVE)
  23. #include "screens.h"
  24. #include "screen_data.h"
  25. using namespace FTDI;
  26. using namespace Theme;
  27. using namespace ExtUI;
  28. void ConfirmStartPrintDialogBox::onRedraw(draw_mode_t) {
  29. const char *filename = getLongFilename();
  30. char buffer[strlen_P(GET_TEXT(MSG_START_PRINT_CONFIRMATION)) + strlen(filename) + 1];
  31. sprintf_P(buffer, GET_TEXT(MSG_START_PRINT_CONFIRMATION), filename);
  32. drawMessage((const char *)buffer);
  33. drawYesNoButtons(1);
  34. }
  35. bool ConfirmStartPrintDialogBox::onTouchEnd(uint8_t tag) {
  36. switch (tag) {
  37. case 1:
  38. printFile(getShortFilename());
  39. StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PRINT_STARTING));
  40. GOTO_SCREEN(StatusScreen);
  41. return true;
  42. case 2: GOTO_PREVIOUS(); return true;
  43. default: return false;
  44. }
  45. }
  46. const char *ConfirmStartPrintDialogBox::getFilename(bool longName) {
  47. FileList files;
  48. files.seek(screen_data.ConfirmStartPrintDialogBox.file_index, true);
  49. return longName ? files.longFilename() : files.shortFilename();
  50. }
  51. void ConfirmStartPrintDialogBox::show(uint8_t file_index) {
  52. screen_data.ConfirmStartPrintDialogBox.file_index = file_index;
  53. GOTO_SCREEN(ConfirmStartPrintDialogBox);
  54. }
  55. #endif // TOUCH_UI_FTDI_EVE