summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/gtk_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gtkmm2ext/gtk_ui.cc')
-rw-r--r--libs/gtkmm2ext/gtk_ui.cc32
1 files changed, 28 insertions, 4 deletions
diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc
index e38ba71d45..067f712198 100644
--- a/libs/gtkmm2ext/gtk_ui.cc
+++ b/libs/gtkmm2ext/gtk_ui.cc
@@ -514,16 +514,40 @@ void
UI::dump_errors (std::ostream& ostr, size_t limit)
{
Glib::Threads::Mutex::Lock lm (error_lock);
- ostr << endl << X_("Errors/Messages:") << endl;
- for (list<string>::const_iterator i = error_stack.begin(); i != error_stack.end(); ++i) {
- ostr << *i << endl;
- if (limit > 0) {
+ bool first = true;
+
+ if (limit > 0) {
+ /* reverse listing, Errors only */
+ for (list<string>::const_reverse_iterator i = error_stack.rbegin(); i != error_stack.rend(); ++i) {
+ if ((*i).substr (0, 9) == X_("WARNING: ") || (*i).substr (0, 6) == X_("INFO: ")) {
+ continue;
+ }
+ if (first) {
+ first = false;
+ }
+ ostr << *i << endl;
if (--limit == 0) {
ostr << "..." << endl;
break;
}
}
}
+
+ if (first) {
+ for (list<string>::const_iterator i = error_stack.begin(); i != error_stack.end(); ++i) {
+ if (first) {
+ ostr << endl << X_("Log Messages:") << endl;
+ first = false;
+ }
+ ostr << *i << endl;
+ if (limit > 0) {
+ if (--limit == 0) {
+ ostr << "..." << endl;
+ break;
+ }
+ }
+ }
+ }
ostr << endl;
}