summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui2.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-03-16 19:04:17 +0100
committerRobin Gareus <robin@gareus.org>2015-03-16 19:04:36 +0100
commit3a1071e5e98f5ae632319c780209783a1f173bee (patch)
treed24f43ed29d9481134e4dfbd7aa9575baf1178dc /gtk2_ardour/ardour_ui2.cc
parent28e4708825c1093ab128856e22ed468635b64f54 (diff)
use tri-state text-less LED for error-log button.
Diffstat (limited to 'gtk2_ardour/ardour_ui2.cc')
-rw-r--r--gtk2_ardour/ardour_ui2.cc43
1 files changed, 31 insertions, 12 deletions
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;
}
}