From 7322c14d64b6a2580400443d005afd67a587432b Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 18 Jan 2018 20:20:49 +0100 Subject: [PATCH] Ref T225, utility function, messages can be directly shown as overlay --- src/blackgui/editors/form.cpp | 7 +++++++ src/blackgui/editors/form.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/blackgui/editors/form.cpp b/src/blackgui/editors/form.cpp index 34b6e4b99..13eae1fa9 100644 --- a/src/blackgui/editors/form.cpp +++ b/src/blackgui/editors/form.cpp @@ -36,6 +36,13 @@ namespace BlackGui return CStatusMessageList(); } + CStatusMessageList CForm::validateAsOverlayMessage(bool withNestedObjects, bool appendOldMessages, int timeOutMs) + { + const CStatusMessageList msgs = this->validate(withNestedObjects); + this->showOverlayMessages(msgs, appendOldMessages, timeOutMs); + return msgs; + } + void CForm::jsonPasted(const QString &json) { Q_UNUSED(json); diff --git a/src/blackgui/editors/form.h b/src/blackgui/editors/form.h index f09bb8777..e968ef991 100644 --- a/src/blackgui/editors/form.h +++ b/src/blackgui/editors/form.h @@ -48,6 +48,10 @@ namespace BlackGui //! Validate, empty list means OK virtual BlackMisc::CStatusMessageList validate(bool withNestedObjects = true) const; + //! Validate as overlay message + //! \note uses CForm::validate and displays the messages as overlay messages + BlackMisc::CStatusMessageList validateAsOverlayMessage(bool withNestedObjects = true, bool appendOldMessages = false, int timeOutMs = -1); + //! Is read only? bool isReadOnly() const { return m_readOnly; }