From 29246621df56243a8eead4422c07e902339f1da1 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 31 Aug 2017 14:53:15 +0200 Subject: [PATCH] UI-Dispatch: remove unnecessary intermediary function ...since the generateErrorResponse() in UiDispatcher already adds some explanatory boilerplate to the message; and we can not do anything beyond publishing the message into the UI message box --- src/gui/notification-service.cpp | 21 ++++++++------------- src/gui/notification-service.hpp | 1 - 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/gui/notification-service.cpp b/src/gui/notification-service.cpp index 6eae6ce78..23e6d0277 100644 --- a/src/gui/notification-service.cpp +++ b/src/gui/notification-service.cpp @@ -85,12 +85,6 @@ namespace gui { }); } - void - NotificationService::showErrorUI (string errorMsg) - { - UNIMPLEMENTED ("forward error message to the error log"); - } - void NotificationService::displayInfo (NotifyLevel severity, string const& text) @@ -130,7 +124,7 @@ namespace gui { { NOTICE (gui, "@GUI: shutdown triggered with explanation '%s'....", cStr(cause)); displayInfo (NOTE_ERROR, cause); - dispatch_->event ([=]() + dispatch_->event ([this]() { uiManager_.terminateUI(); }); @@ -275,15 +269,16 @@ namespace gui { /** - * When started, NotificationService connects to the [UI-Bus](ui-bus.hpp) via - * the provided connection. This is a simple, unidirectional up-link connection, - * without actively adding NotificationService into the routing tables in [Nexus]. - * Yet this simple connection is sufficient to implement this service by talking - * to other facilities within the UI layer. + * When started, NotificationService connects to the [UI-Bus](ui-bus.hpp) via the provided connection. + * This is a simple, unidirectional up-link connection, without actively adding NotificationService + * into the routing tables in [Nexus]. Yet this simple connection is sufficient to implement this + * service by talking to other facilities within the UI layer. + * @remark internally this service relies on a UiDispatcher queue to hand over any invocations + * into the GTK event loop thread. */ NotificationService::NotificationService (ctrl::BusTerm& upLink, ctrl::UiManager& uiManager) : BusTerm{lib::idi::EntryID{}, upLink} - , dispatch_{new UiDispatcher{[this](string msg){ showErrorUI(msg); }}} + , dispatch_{new UiDispatcher{[this](string msg){ displayInfo (NOTE_ERROR, msg); }}} , uiManager_{uiManager} , implInstance_(this,_instance) , serviceInstance_( LUMIERA_INTERFACE_REF (lumieraorg_GuiNotification, 0,lumieraorg_GuiNotificationService)) diff --git a/src/gui/notification-service.hpp b/src/gui/notification-service.hpp index 78911c702..355b735cd 100644 --- a/src/gui/notification-service.hpp +++ b/src/gui/notification-service.hpp @@ -91,7 +91,6 @@ namespace gui { ctrl::UiManager& uiManager_; void dispatchMsg (ID, lib::diff::GenNode&&); - void showErrorUI (string errorMsg); /* === Interface Lifecycle === */