My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

restore_failsafe_dialog_box.cpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /***********************************
  2. * restore_failsafe_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: <http://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #if ENABLED(LULZBOT_TOUCH_UI)
  23. #include "screens.h"
  24. using namespace ExtUI;
  25. void RestoreFailsafeDialogBox::onRedraw(draw_mode_t) {
  26. drawMessage(GET_TEXTF(EEPROM_RESET_WARNING));
  27. drawYesNoButtons();
  28. }
  29. bool RestoreFailsafeDialogBox::onTouchEnd(uint8_t tag) {
  30. switch (tag) {
  31. case 1:
  32. ExtUI::injectCommands_P(PSTR("M502"));
  33. AlertDialogBox::show(GET_TEXTF(EEPROM_RESET));
  34. // Remove RestoreFailsafeDialogBox from the stack
  35. // so the alert box doesn't return to it.
  36. current_screen.forget();
  37. SaveSettingsDialogBox::settingsChanged();
  38. return true;
  39. default:
  40. return DialogBoxBaseClass::onTouchEnd(tag);
  41. }
  42. }
  43. #endif // LULZBOT_TOUCH_UI