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.
This commit is contained in:
Abdullah Tahiri
2022-12-18 09:31:55 +01:00
committed by abdullahtahiriyo
parent 793a70b0e2
commit 8b36a2780b

View File

@@ -29,6 +29,7 @@
#include <map>
#include <vector>
#include <QString>
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<void (const App::Document&, const std::vector<App::DocumentObject*>&)> signalSkipRecompute;
boost::signals2::signal<void (const App::DocumentObject&)> signalFinishRestoreObject;
boost::signals2::signal<void (const App::Document&,const App::Property&)> signalChangePropertyEditor;
// signal user message
boost::signals2::signal<void (const App::DocumentObject&, const QString &, NotificationType)> signalUserMessage;
//@}
boost::signals2::signal<void (std::string)> signalLinkXsetValue;