Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/widget/error-log-display.hpp"
Widget to display log and error messages.
Based on a multiline text display box with scrollbars. Warning and error messages are highlighted by special formatting. And error entries are treated specially, insofar they are tracked by an index, allowing to build additional convenience features later on...
Definition at line 123 of file error-log-display.hpp.
Public Member Functions | |
void | addError (string text) |
present an error notification prominently. More... | |
void | addInfo (string text) |
just add normal information message to buffer, without special markup and without expanding the widget | |
void | addWarn (string text) |
add an information message, formatted more prominent as warning | |
void | clearAll () |
empty text buffer and discard all error bookmarks | |
void | clearInfoMsg () |
clear all mere information messages; retain just the previously tagged errors More... | |
bool | isError () const |
SignalErrorChanged | signalErrorChanged () |
signal fired when error state changes | |
void | triggerFlash () |
temporarily change display style to prompt for attention; set callback-timeout for return to normal state. More... | |
void | turnError_into_InfoMsg () |
visit all errors and downgrade the markup; discard all bookmarks | |
Public Attributes | |
model::Expander | expand |
model::Revealer | reveal |
Private Types | |
using | Entry = std::pair< Mark, Mark > |
using | Mark = Glib::RefPtr< Gtk::TextBuffer::Mark > |
using | SignalErrorChanged = sigc::signal< void, bool > |
using | TextWidget = model::FlashDeco< Gtk::TextView > |
Private Member Functions | |
Entry | addEntry (string const &text, Literal markupTagName=nullptr) |
add message entry to the (ever growing) text buffer. More... | |
Private Attributes | |
SignalErrorChanged | errorChangedSignal_ |
vector< Entry > | errorMarks_ |
TextWidget | textLog_ |
|
inline |
present an error notification prominently.
Adds the error text, formatted accordingly to stand out, but also stores a Mark to bookmark the presence of this error entry. And finally expand the display if collapsed.
Definition at line 205 of file error-log-display.hpp.
References ErrorLogDisplay::addEntry().
Referenced by NotificationHub::buildMutator().
|
inline |
clear all mere information messages; retain just the previously tagged errors
Definition at line 224 of file error-log-display.hpp.
References ErrorLogDisplay::addInfo(), and steam::mobject::session::query::anonymous_namespace{fake-configrules.cpp}::entry().
|
inline |
temporarily change display style to prompt for attention; set callback-timeout for return to normal state.
Definition at line 281 of file error-log-display.hpp.
|
inlineprivate |
add message entry to the (ever growing) text buffer.
TextView::scroll_to(iter)
is not reliable; preferably we should use a text mark, which could e.g. be the insert position. The handling of marks and tags is described in the GTKmm tutorial. Definition at line 320 of file error-log-display.hpp.
Referenced by ErrorLogDisplay::addError(), ErrorLogDisplay::addInfo(), and ErrorLogDisplay::addWarn().