More work on 2.4 sdmanager (#7445)

SD Manager continued
This commit is contained in:
3djc
2020-03-18 17:47:32 +01:00
committed by GitHub
parent 1d96af49c4
commit f03429f49e
19 changed files with 180 additions and 98 deletions
+13 -11
View File
@@ -73,7 +73,7 @@ enum
#if !defined(GUI)
#define DISPLAY_WARNING(...)
inline void POPUP_WAIT(const char * s) { }
inline void POPUP_WARNING(const char * s) { }
inline void POPUP_WARNING(const char *, const char * = nullptr) { }
inline void POPUP_CONFIRMATION(const char * s, PopupMenuHandler handler) { }
inline void POPUP_INPUT(const char * s, PopupFunc func) { }
inline void SET_WARNING_INFO(const char * info, uint8_t length, uint8_t flags) { }
@@ -103,14 +103,23 @@ enum
popupFunc = runPopupWarning;
}
inline void POPUP_WARNING(const char * s)
inline void POPUP_WARNING(const char * message, const char * info = nullptr)
{
warningText = s;
warningInfoText = nullptr;
warningText = message;
warningInfoText = info;
warningInfoLength = strlen(info);
warningInfoFlags = 0;
warningType = WARNING_TYPE_ASTERISK;
popupFunc = runPopupWarning;
}
inline void SET_WARNING_INFO(const char * info, uint8_t length, uint8_t flags)
{
warningInfoText = info;
warningInfoLength = length;
warningInfoFlags = flags;
}
inline void POPUP_CONFIRMATION(const char * s, PopupMenuHandler handler)
{
if (s != warningText) {
@@ -131,13 +140,6 @@ enum
popupFunc = func;
}
inline void SET_WARNING_INFO(const char * info, uint8_t length, uint8_t flags)
{
warningInfoText = info;
warningInfoLength = length;
warningInfoFlags = flags;
}
inline bool isEventCaughtByPopup()
{
if (warningText && warningType != WARNING_TYPE_WAIT)