mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
Allow to limit error dump
This is in preparation of displaying verbose errors to the user.
This commit is contained in:
parent
a485195453
commit
fa0a7d6739
2 changed files with 9 additions and 2 deletions
|
|
@ -511,12 +511,18 @@ UI::do_request (UIRequest* req)
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
void
|
void
|
||||||
UI::dump_errors (std::ostream& ostr)
|
UI::dump_errors (std::ostream& ostr, size_t limit)
|
||||||
{
|
{
|
||||||
Glib::Threads::Mutex::Lock lm (error_lock);
|
Glib::Threads::Mutex::Lock lm (error_lock);
|
||||||
ostr << endl << X_("Errors/Messages:") << endl;
|
ostr << endl << X_("Errors/Messages:") << endl;
|
||||||
for (list<string>::const_iterator i = error_stack.begin(); i != error_stack.end(); ++i) {
|
for (list<string>::const_iterator i = error_stack.begin(); i != error_stack.end(); ++i) {
|
||||||
ostr << *i << endl;
|
ostr << *i << endl;
|
||||||
|
if (limit > 0) {
|
||||||
|
if (--limit == 0) {
|
||||||
|
ostr << "..." << endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ostr << endl;
|
ostr << endl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,8 @@ public:
|
||||||
void flush_pending (float timeout = 0);
|
void flush_pending (float timeout = 0);
|
||||||
void toggle_errors ();
|
void toggle_errors ();
|
||||||
void show_errors ();
|
void show_errors ();
|
||||||
void dump_errors (std::ostream&);
|
void dump_errors (std::ostream&, size_t limit = 0);
|
||||||
|
void clear_errors () { error_stack.clear (); }
|
||||||
void touch_display (Touchable *);
|
void touch_display (Touchable *);
|
||||||
void set_tip (Gtk::Widget &w, const gchar *tip);
|
void set_tip (Gtk::Widget &w, const gchar *tip);
|
||||||
void set_tip (Gtk::Widget &w, const std::string &tip);
|
void set_tip (Gtk::Widget &w, const std::string &tip);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue