From 0c8151cb2f6d26b1920011298d01525a50549377 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 9 Aug 2018 01:23:20 +0200 Subject: [PATCH] NotificationDisplay: decide upon the architecture for handling notification messages (#1102) * have a dedicated "information hub" controller, which acts a receiver of "error log messages" on the UI-Bus * let that controller in turn allocate an apropriate view on demand --- src/gui/ctrl/notification-hub.hpp | 81 ++++++++++ src/gui/interact/wizard.cpp | 1 + src/gui/interact/wizard.hpp | 6 +- wiki/thinkPad.ichthyo.mm | 259 +++++++++++++++++++++++------- 4 files changed, 288 insertions(+), 59 deletions(-) create mode 100644 src/gui/ctrl/notification-hub.hpp diff --git a/src/gui/ctrl/notification-hub.hpp b/src/gui/ctrl/notification-hub.hpp new file mode 100644 index 000000000..0676f742e --- /dev/null +++ b/src/gui/ctrl/notification-hub.hpp @@ -0,0 +1,81 @@ +/* + NOTIFICATION-HUB.hpp - receive and reroute notification messages + + Copyright (C) Lumiera.org + 2018, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +/** @file notification-hub.hpp + ** Controller to receive and handle notification messages for the user. + ** This component is addressed in order to show error, warning and notification messages + ** in the UI. It is responsible for maintaining a local log of these messages, and to + ** allocate an appropriate display widgets, to show such notifications asynchronously. + ** On first use, an InfoboxPanel is allocated to hold an ErrorlogWidget for presentation + ** of those messages + ** + ** @see error-log-widget.hpp + ** @see notification-service.hpp + */ + + +#ifndef GUI_CTRL_NOTIFICATION_HUB_H +#define GUI_CTRL_NOTIFICATION_HUB_H + +#include "gui/gtk-base.hpp" +#include "lib/nocopy.hpp" + +#include +#include + + +namespace gui { +namespace workspace { class WorkspaceWindow; } +namespace ctrl { + + + using std::list; + + + + /** + * Service to receive and display error, warning and notification messages. + * These are sent over the UI-Bus through the NotificationService; after receiving + * such a message, this controller ensures to display the message and altert the + * user, while not blocking the overall UI. + */ + class NotificationHub + : util::NonCopyable + { + + + public: + NotificationHub (); + + private: + + }; + + + + /** */ + + + +}}// namespace gui::ctrl +#endif /*GUI_CTRL_NOTIFICATION_HUB_H*/ diff --git a/src/gui/interact/wizard.cpp b/src/gui/interact/wizard.cpp index 8585092fa..7996eb744 100644 --- a/src/gui/interact/wizard.cpp +++ b/src/gui/interact/wizard.cpp @@ -33,6 +33,7 @@ #include "gui/interact/wizard.hpp" #include "gui/interact/spot-locator.hpp" #include "gui/workspace/workspace-window.hpp" +#include "gui/ctrl/notification-hub.hpp" #include "gui/ctrl/global-ctx.hpp" #include "lib/format-string.hpp" //#include "lib/util.hpp" diff --git a/src/gui/interact/wizard.hpp b/src/gui/interact/wizard.hpp index 0d541616b..2d12f9733 100644 --- a/src/gui/interact/wizard.hpp +++ b/src/gui/interact/wizard.hpp @@ -46,16 +46,17 @@ #include "lib/nocopy.hpp" //#include -//#include +#include namespace gui { namespace ctrl { class GlobalCtx; + class NotificationHub; } namespace interact { -// using std::unique_ptr; + using std::unique_ptr; // using std::string; // class GlobalCtx; @@ -73,6 +74,7 @@ namespace interact { : util::NonCopyable { ctrl::GlobalCtx& globalCtx_; + unique_ptr notificationHub_; public: Wizard (ctrl::GlobalCtx&); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 59bc81953..94882dfe8 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -949,6 +949,12 @@ + + + + + + @@ -1463,6 +1469,27 @@ + + + + + + + +

+ das ist schon die endgültige Lösung +

+ + +
+ +
+ + + + + + @@ -1480,6 +1507,13 @@

+ + + + + + + @@ -1502,8 +1536,7 @@ und daß man ihn via InteractionDirector erreicht

- - +
@@ -1560,6 +1593,87 @@
+ + + + + + + + + + + + + + + + + +

+ weil so sichergestellt ist, daß er stets existiert, +

+

+ und er trotzdem vom konkreten Widget entkoppelt bleibt +

+ + +
+
+ + + + + + +

+ besserer Name: NotificationHub +

+ + +
+
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -3666,6 +3780,7 @@ + @@ -4303,7 +4418,7 @@ - + @@ -4463,7 +4578,7 @@ - + @@ -4476,7 +4591,7 @@ - + @@ -4597,7 +4712,7 @@ - + @@ -4724,7 +4839,7 @@ - + @@ -4809,7 +4924,7 @@ - + @@ -4832,7 +4947,7 @@ - + @@ -9203,7 +9318,7 @@ - + @@ -9234,7 +9349,7 @@ - + @@ -9248,7 +9363,7 @@ - + @@ -9375,7 +9490,7 @@ - + @@ -9536,7 +9651,7 @@ - + @@ -10239,7 +10354,7 @@ - + @@ -11275,7 +11390,7 @@ - + @@ -11368,7 +11483,7 @@ - + @@ -11378,7 +11493,7 @@ - + @@ -11428,7 +11543,7 @@ - + @@ -11900,7 +12015,7 @@ - + @@ -12234,7 +12349,7 @@ - + @@ -12620,7 +12735,7 @@ - + @@ -12850,7 +12965,7 @@ - + @@ -12896,7 +13011,7 @@ - + @@ -13613,7 +13728,8 @@ - + + @@ -13939,7 +14055,8 @@ - + + @@ -14117,6 +14234,7 @@ + @@ -14209,6 +14327,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16941,7 +17086,7 @@ - + @@ -17365,7 +17510,7 @@ - + @@ -17385,7 +17530,7 @@ - + @@ -17411,7 +17556,7 @@ - + @@ -17479,7 +17624,7 @@ - + @@ -17535,7 +17680,7 @@ - + @@ -17610,7 +17755,7 @@ - + @@ -17639,7 +17784,7 @@ - + @@ -17710,7 +17855,7 @@ - + @@ -17798,7 +17943,7 @@ - + @@ -18195,7 +18340,7 @@ - + @@ -18213,7 +18358,7 @@ - + @@ -18340,7 +18485,7 @@ - + @@ -18757,7 +18902,7 @@ - + @@ -18982,7 +19127,7 @@ - + @@ -19023,7 +19168,7 @@ - + @@ -19270,7 +19415,7 @@ - + @@ -19316,7 +19461,7 @@ - + @@ -19353,7 +19498,7 @@ - + @@ -19529,7 +19674,7 @@ - + @@ -19747,7 +19892,7 @@ - + @@ -19806,7 +19951,7 @@ - + @@ -20442,8 +20587,8 @@ - - + + @@ -20931,7 +21076,7 @@ - + @@ -21183,7 +21328,7 @@ - + @@ -21256,7 +21401,7 @@ - + @@ -21523,7 +21668,7 @@ - + @@ -21536,7 +21681,7 @@

- + @@ -21986,7 +22131,7 @@ - + @@ -22031,7 +22176,7 @@ - +