From 0be0f77c160dc545b6c68c3beb1b04d2a15e8d88 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 21 Sep 2018 14:38:38 +0200 Subject: [PATCH] NotificationDisplay: wire up simple message display --- src/gui/panel/infobox-panel.cpp | 2 +- src/gui/widget/error-log-display.hpp | 39 ++++++------ wiki/thinkPad.ichthyo.mm | 88 +++++++++++++++++++++++----- 3 files changed, 94 insertions(+), 35 deletions(-) diff --git a/src/gui/panel/infobox-panel.cpp b/src/gui/panel/infobox-panel.cpp index c17910b73..215689e97 100644 --- a/src/gui/panel/infobox-panel.cpp +++ b/src/gui/panel/infobox-panel.cpp @@ -117,7 +117,7 @@ namespace panel{ static uint bangNo{0}; static _Fmt msgTemplate{"Bang #%d\n"}; - getLog().showMsg(NOTE_WARN, msgTemplate % ++bangNo); + getLog().addMsg (msgTemplate % ++bangNo); } diff --git a/src/gui/widget/error-log-display.hpp b/src/gui/widget/error-log-display.hpp index 7e4d59a7e..01ae3ad54 100644 --- a/src/gui/widget/error-log-display.hpp +++ b/src/gui/widget/error-log-display.hpp @@ -101,33 +101,18 @@ namespace widget { model::Revealer reveal; - void - showMsg (NotifyLevel severity, string const& text) - { - //////////////////////////////////////////////////TICKET #1102 : add formatting according to the error level - switch (severity) { - case NOTE_ERROR: - addEntry ("ERROR: "+text); - break; - case NOTE_WARN: - addEntry ("WARN: "+text); - break; - default: - addEntry (text); - break; - } - } - void clearAll() { UNIMPLEMENTED ("empty buffer and discard all error bookmarks"); } + /** just add normal information message to buffer, + * without special markup and without expanding the widget */ void addMsg (string text) { - UNIMPLEMENTED ("add normal information message to buffer"); + showMsg (NOTE_INFO, text); } void @@ -158,6 +143,24 @@ namespace widget { private:/* ===== Internals ===== */ + void + showMsg (NotifyLevel severity, string const& text) + { + //////////////////////////////////////////////////TICKET #1102 : add formatting according to the error level + switch (severity) { + case NOTE_ERROR: + addEntry ("ERROR: "+text); + break; + case NOTE_WARN: + addEntry ("WARN: "+text); + break; + default: + addEntry (text); + break; + } + } + + Gtk::TextView textLog_; /** add message entry to the (ever growing) text buffer. diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index b77d5ef85..e87c25dd7 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -320,8 +320,8 @@ - - + + @@ -329,7 +329,7 @@ - + @@ -415,7 +415,7 @@ - + @@ -530,8 +530,8 @@ - - + + @@ -930,7 +930,8 @@ - + + @@ -1329,7 +1330,7 @@ - + @@ -1343,6 +1344,7 @@

+
@@ -1960,8 +1962,8 @@ - - + + @@ -1972,6 +1974,12 @@ + + + + + + @@ -2071,7 +2079,8 @@
- + + @@ -2147,7 +2156,7 @@ - + @@ -2473,8 +2482,8 @@ - - + + @@ -2498,8 +2507,8 @@ - - + + @@ -2543,6 +2552,12 @@ + + + + + + @@ -2593,6 +2608,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +