From 8b36a2780bbd9ab80bdd05ff00d25b1f6ba02193 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 18 Dec 2022 09:31:55 +0100 Subject: [PATCH] App: New signal to notify user messages ======================================= Document provides a new functionality, to signal subscribed user code of messages intended for the user. The main motivation is critical messages of broken forward compatibility during restoring a document into a new version of FreeCAD. However, the framework may be used in many other ways. --- src/App/Document.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/App/Document.h b/src/App/Document.h index 1a81d28033..f0d7cabfc0 100644 --- a/src/App/Document.h +++ b/src/App/Document.h @@ -29,6 +29,7 @@ #include #include +#include namespace Base { class Writer; @@ -70,6 +71,13 @@ public: IgnoreErrorOnRecompute = 12, // Don't report errors if the recompute failed }; + enum class NotificationType { + Information, + Warning, + Error, + Critical, + }; + /** @name Properties */ //@{ /// holds the long name of the document (utf-8 coded) @@ -172,6 +180,8 @@ public: boost::signals2::signal&)> signalSkipRecompute; boost::signals2::signal signalFinishRestoreObject; boost::signals2::signal signalChangePropertyEditor; + // signal user message + boost::signals2::signal signalUserMessage; //@} boost::signals2::signal signalLinkXsetValue;