diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-16 19:04:17 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-16 19:04:36 +0100 |
commit | 3a1071e5e98f5ae632319c780209783a1f173bee (patch) | |
tree | d24f43ed29d9481134e4dfbd7aa9575baf1178dc | |
parent | 28e4708825c1093ab128856e22ed468635b64f54 (diff) |
use tri-state text-less LED for error-log button.
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 10 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui2.cc | 43 |
3 files changed, 42 insertions, 14 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index c67ba6d9cb..3b303b254c 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -211,7 +211,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) , auditioning_alert_button (_("Audition")) , solo_alert_button (_("Solo")) , feedback_alert_button (_("Feedback")) - , error_alert_button (_("Errors")) + , error_alert_button ( ArdourButton::Element (ArdourButton::Edge | ArdourButton::Indicator) ) , editor_meter(0) , editor_meter_peak_display() @@ -234,6 +234,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) , _status_bar_visibility (X_("status-bar")) , _feedback_exists (false) + , _log_not_acknowledged (LogLevelNone) { Gtkmm2ext::init(localedir); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index de0688dfbb..00d31d9c0c 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -770,7 +770,15 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void successful_graph_sort (); bool _feedback_exists; - bool _error_not_acknowledged; + + enum ArdourLogLevel { + LogLevelNone = 0, + LogLevelInfo, + LogLevelWarning, + LogLevelError + }; + + ArdourLogLevel _log_not_acknowledged; void resize_text_widgets (); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index e5fdc20423..57bcca34da 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -145,6 +145,7 @@ ARDOUR_UI::setup_tooltips () set_tip (primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n")); set_tip (secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n")); set_tip (editor_meter_peak_display, _("Reset All Peak Indicators")); + set_tip (error_alert_button, _("Show Error Log and acknowledge warnings")); synchronize_sync_source_and_video_pullup (); @@ -175,22 +176,24 @@ ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuff UI::display_message (prefix, prefix_len, ptag, mtag, msg); - if (!strcmp (prefix, _("[ERROR]: ")) || !strcmp (prefix, _("[WARNING]: "))) { - _error_not_acknowledged = true; - } - -#ifdef TOP_MENUBAR + ArdourLogLevel ll = LogLevelNone; if (strcmp (prefix, _("[ERROR]: ")) == 0) { text = "<span color=\"red\" weight=\"bold\">"; + ll = LogLevelError; } else if (strcmp (prefix, _("[WARNING]: ")) == 0) { text = "<span color=\"yellow\" weight=\"bold\">"; + ll = LogLevelWarning; } else if (strcmp (prefix, _("[INFO]: ")) == 0) { text = "<span color=\"green\" weight=\"bold\">"; + ll = LogLevelInfo; } else { text = "<span color=\"white\" weight=\"bold\">???"; } + _log_not_acknowledged = std::max(_log_not_acknowledged, ll); + +#ifdef TOP_MENUBAR text += prefix; text += "</span>"; text += msg; @@ -545,7 +548,8 @@ ARDOUR_UI::feedback_alert_press (GdkEventButton *) bool ARDOUR_UI::error_alert_press (GdkEventButton*) { - _error_not_acknowledged = false; + _log_not_acknowledged = LogLevelNone; + error_blink (false); // immediate acknowledge UI::show_errors(); return true; } @@ -626,14 +630,29 @@ ARDOUR_UI::feedback_blink (bool onoff) void ARDOUR_UI::error_blink (bool onoff) { - if (_error_not_acknowledged) { - if (onoff) { + switch (_log_not_acknowledged) { + case LogLevelError: + // blink + if (onoff) { + error_alert_button.set_custom_led_color(0xff0000ff); // bright red + error_alert_button.set_active (true); + } else { + error_alert_button.set_custom_led_color(0x880000ff); // dark red + error_alert_button.set_active (false); + } + break; + case LogLevelWarning: + error_alert_button.set_custom_led_color(0xccaa00ff); // yellow error_alert_button.set_active (true); - } else { + break; + case LogLevelInfo: + error_alert_button.set_custom_led_color(0x88cc00ff); // lime green + error_alert_button.set_active (true); + break; + default: + error_alert_button.set_custom_led_color(0x333333ff); // gray error_alert_button.set_active (false); - } - } else { - error_alert_button.set_active (false); + break; } } |