Make editor undo/redo actions sensitive at appropriate times.
[ardour.git] / gtk2_ardour / editor_ops.cc
index a99da327db93b90b050bff2a9649283e437d1d5c..7c8d3efb73cca1282e20fca1b51547d1a1a96615 100644 (file)
@@ -122,6 +122,9 @@ Editor::undo (uint32_t n)
        
        if (_session) {
                _session->undo (n);
+               if (_session->undo_depth() == 0) {
+                       undo_action->set_sensitive(false);
+               }
                redo_action->set_sensitive(true);
                begin_selection_op_history ();
        }
@@ -136,10 +139,10 @@ Editor::redo (uint32_t n)
        
        if (_session) {
                _session->redo (n);
-               cerr << "redo depth is : " << _session->redo_depth() << endl;
                if (_session->redo_depth() == 0) {
                        redo_action->set_sensitive(false);
                }
+               undo_action->set_sensitive(true);
                begin_selection_op_history ();
        }
 }