diff --git a/src/gui/notification-interface-proxy.hpp b/src/gui/notification-interface-proxy.hpp index d7ca62e3d..cb8e3d52b 100644 --- a/src/gui/notification-interface-proxy.hpp +++ b/src/gui/notification-interface-proxy.hpp @@ -65,14 +65,15 @@ namespace facade { class Proxy : public Holder { + using Level = gui::NotifyLevel; //----Proxy-Implementation-of-GuiNotification-------- - void displayInfo (string const& text) override { _i_.displayInfo (cStr(text)); } - void markError (ID uiElement, string const& text) override { _i_.markError(uiElement.getHash().get(), cStr(text)); } - void markNote (ID uiElement, string const& text) override { _i_.markNote (uiElement.getHash().get(), cStr(text)); } - void mutate (ID uiElement, DiffMessage& diff) override { _i_.mutate (uiElement.getHash().get(), &diff); } - void triggerGuiShutdown (string const& cause) override { _i_.triggerGuiShutdown (cStr(cause)); } + void displayInfo (Level level, string const& text) override { _i_.displayInfo (level, cStr(text)); } + void markError (ID uiElement, string const& text) override { _i_.markError(uiElement.getHash().get(), cStr(text)); } + void markNote (ID uiElement, string const& text) override { _i_.markNote (uiElement.getHash().get(), cStr(text)); } + void mutate (ID uiElement, DiffMessage& diff) override { _i_.mutate (uiElement.getHash().get(), &diff); } + void triggerGuiShutdown (string const& cause) override { _i_.triggerGuiShutdown (cStr(cause)); } public: diff --git a/src/gui/notification-service.cpp b/src/gui/notification-service.cpp index 90b873943..82435b941 100644 --- a/src/gui/notification-service.cpp +++ b/src/gui/notification-service.cpp @@ -87,7 +87,7 @@ namespace gui { void - NotificationService::displayInfo (string const& text) + NotificationService::displayInfo (NotifyLevel severity, string const& text) { INFO (gui, "@GUI: display '%s' as notification message.", cStr(text)); ///////////////////////////////////TICKET #1102 : build a message display box in the UI ////////////////////////TODO actually push the information to the GUI ///////////////////////////////////TICKET #1098 : use a suitable Dispatcher @@ -215,11 +215,11 @@ namespace gui { , NULL /* on open */ , NULL /* on close */ , LUMIERA_INTERFACE_INLINE (displayInfo, - void, (const char* text), + void, (uint severity, const char* text), { if (!_instance) lumiera_error_set(LUMIERA_ERROR_FACADE_LIFECYCLE, text); else - _instance->displayInfo (text); + _instance->displayInfo (NotifyLevel(severity), text); } ) , LUMIERA_INTERFACE_INLINE (markError, diff --git a/src/gui/notification-service.hpp b/src/gui/notification-service.hpp index 1f7c1d3f1..55759ace7 100644 --- a/src/gui/notification-service.hpp +++ b/src/gui/notification-service.hpp @@ -80,7 +80,7 @@ namespace gui { /* === Implementation of the Facade Interface === */ - void displayInfo (string const& text) override; + void displayInfo (NotifyLevel,string const& text) override; void markError (ID uiElement, string const& text) override; void markNote (ID uiElement, string const& text) override; void mutate (ID uiElement, DiffMessage&) override; ////////////////////////////////////////TICKET #1066 : how to pass a diff message diff --git a/src/include/gui-notification-facade.h b/src/include/gui-notification-facade.h index 05dd898dc..976850aac 100644 --- a/src/include/gui-notification-facade.h +++ b/src/include/gui-notification-facade.h @@ -57,6 +57,12 @@ namespace gui { using ID = lib::idi::BareEntryID const&; + enum NotifyLevel { + NOTE_INFO, ///< possibly interesting info that can be safely ignored + NOTE_WARN, ///< something to be aware of, to be indicated unobtrusively + NOTE_ERROR ///< severe condition to be indicated prominently + }; + /*****************************************************************//** * Global access point to push state update and notification of events @@ -75,7 +81,7 @@ namespace gui { /** push a user visible notification text */ - virtual void displayInfo (string const& text) =0; + virtual void displayInfo (NotifyLevel, string const& text) =0; /** highlight an element in the UI as problem location */ virtual void markError (ID uiElement, string const& text) =0; @@ -121,7 +127,7 @@ extern "C" { LUMIERA_INTERFACE_DECLARE (lumieraorg_GuiNotification, 0, - LUMIERA_INTERFACE_SLOT (void, displayInfo, (const char*)), + LUMIERA_INTERFACE_SLOT (void, displayInfo, (uint, const char*)), LUMIERA_INTERFACE_SLOT (void, markError, (LumieraUid, const char*)), LUMIERA_INTERFACE_SLOT (void, markNote, (LumieraUid, const char*)), LUMIERA_INTERFACE_SLOT (void, mutate, (LumieraUid, void*)),