Make editor undo/redo actions sensitive at appropriate times.
This commit is contained in:
parent
792f9ff37b
commit
61315c314d
|
@ -5018,6 +5018,10 @@ Editor::first_idle ()
|
|||
|
||||
delete dialog;
|
||||
|
||||
if (_session->undo_depth() == 0) {
|
||||
undo_action->set_sensitive(false);
|
||||
}
|
||||
redo_action->set_sensitive(false);
|
||||
begin_selection_op_history ();
|
||||
|
||||
_have_idled = true;
|
||||
|
|
|
@ -2075,6 +2075,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
|
||||
Glib::RefPtr<Gtk::Action> undo_action;
|
||||
Glib::RefPtr<Gtk::Action> redo_action;
|
||||
Glib::RefPtr<Gtk::Action> alternate_redo_action;
|
||||
Glib::RefPtr<Gtk::Action> alternate_alternate_redo_action;
|
||||
Glib::RefPtr<Gtk::Action> selection_undo_action;
|
||||
Glib::RefPtr<Gtk::Action> selection_redo_action;
|
||||
|
||||
|
|
|
@ -314,8 +314,8 @@ Editor::register_actions ()
|
|||
undo_action = reg_sens (editor_actions, "undo", S_("Command|Undo"), sigc::bind (sigc::mem_fun(*this, &Editor::undo), 1U));
|
||||
|
||||
redo_action = reg_sens (editor_actions, "redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
|
||||
redo_action = reg_sens (editor_actions, "alternate-redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
|
||||
redo_action = reg_sens (editor_actions, "alternate-alternate-redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
|
||||
alternate_redo_action = reg_sens (editor_actions, "alternate-redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
|
||||
alternate_alternate_redo_action = reg_sens (editor_actions, "alternate-alternate-redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
|
||||
|
||||
selection_undo_action = reg_sens (editor_actions, "undo-last-selection-op", _("Undo Last Selection Op"), sigc::mem_fun(*this, &Editor::undo_reversible_selection_op));
|
||||
selection_redo_action = reg_sens (editor_actions, "redo-last-selection-op", _("Redo Last Selection Op"), sigc::mem_fun(*this, &Editor::redo_reversible_selection_op));
|
||||
|
|
|
@ -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 ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user