| 205 | } |
| 206 | |
| 207 | void Menu::LoadError(const char *_ecv_array msg, unsigned int line) noexcept |
| 208 | { |
| 209 | // Remove selectable items that may obscure view of the error message |
| 210 | ResetCache(); |
| 211 | |
| 212 | lcd.ClearAll(); |
| 213 | lcd.SetFont(0); |
| 214 | lcd.printf("Error loading menu\nFile: %s", (numNestedMenus > 0) ? filenames[numNestedMenus - 1].c_str() : "(none)"); |
| 215 | if (line != 0) |
| 216 | { |
| 217 | lcd.printf("\nLine %u", line); |
| 218 | if (errorColumn != 0) |
| 219 | { |
| 220 | lcd.printf(" column %u", errorColumn); |
| 221 | } |
| 222 | } |
| 223 | lcd.printf("\n%s", msg); |
| 224 | |
| 225 | lastActionTime = millis(); |
| 226 | timeoutValue = ErrorTimeout; |
| 227 | displayingErrorMessage = true; |
| 228 | } |
| 229 | |
| 230 | // Parse a line in a menu layout file returning any error message, or nullptr if there was no error. |
| 231 | // Leading whitespace has already been skipped. |