error-log button: acknowledge new errors w/o hiding Log
authorRobin Gareus <robin@gareus.org>
Fri, 20 Mar 2015 21:48:53 +0000 (22:48 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 20 Mar 2015 21:48:53 +0000 (22:48 +0100)
override toggle, in case new errors show up while
the log window is already visible

gtk2_ardour/ardour_ui2.cc

index 00e7cbc8199772351128b5f1575b4c0710f60b26..357067dc6ea3491b1ecb363a51ce4268d96c7a69 100644 (file)
@@ -549,12 +549,21 @@ ARDOUR_UI::feedback_alert_press (GdkEventButton *)
 bool
 ARDOUR_UI::error_alert_press (GdkEventButton* ev)
 {
+       bool do_toggle = true;
        if (ev->button == 1) {
+               if (_log_not_acknowledged == LogLevelError) {
+                       // just acknowledge the error, don't hide the log if it's already visible
+                       RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
+                       Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+                       if (tact && tact->get_active()) {
+                               do_toggle = false;
+                       }
+               }
                _log_not_acknowledged = LogLevelNone;
                error_blink (false); // immediate acknowledge
        }
-       // fall through to to button toggle
-       return false;
+       // maybe fall through to to button toggle
+       return !do_toggle;
 }
 
 void