)
);
action_group->add(Gtk::Action::create(
)
);
action_group->add(Gtk::Action::create(
+ "clear-undo-and-redo",
+ Gtk::Stock::CLEAR,
+ _("Clear Undo and Redo Stacks"),
+ _("Clear the undo and redo stacks")
+ ),
+ sigc::mem_fun(
+ *this,
+ &Dock_History::clear_undo_and_redo
+ )
+ );
+ action_group->add(Gtk::Action::create(
"undo",
Gtk::StockID("gtk-undo"),
_("Undo"),
"undo",
Gtk::StockID("gtk-undo"),
_("Undo"),
" <toolitem action='redo' />"
" <toolitem action='clear-undo' />"
" <toolitem action='clear-redo' />"
" <toolitem action='redo' />"
" <toolitem action='clear-undo' />"
" <toolitem action='clear-redo' />"
+ " <toolitem action='clear-undo-and-redo' />"
void
Dock_History::clear_undo()
{
void
Dock_History::clear_undo()
{
- if(selected_instance && App::dialog_yes_no(_("Clear History"), _("You will not be able to undo any changes that you have made!\nAre you sure you want to clear the undo stack?")))
- {
+ if(selected_instance && App::dialog_yes_no(_("Clear History"),
+ _("You will not be able to undo any changes that you have made!\nAre you sure you want to clear the undo stack?")))
selected_instance->clear_undo_stack();
selected_instance->clear_undo_stack();
}
void
Dock_History::clear_redo()
{
}
void
Dock_History::clear_redo()
{
- if(selected_instance && App::dialog_yes_no(_("Clear History"), _("You will not be able to redo any changes that you have made!\nAre you sure you want to clear the redo stack?")))
+ if(selected_instance && App::dialog_yes_no(_("Clear History"),
+ _("You will not be able to redo any changes that you have made!\nAre you sure you want to clear the redo stack?")))
+ selected_instance->clear_redo_stack();
+}
+
+void
+Dock_History::clear_undo_and_redo()
+{
+ if(selected_instance && App::dialog_yes_no(_("Clear History"),
+ _("You will not be able to undo or redo any changes that you have made!\nAre you sure you want to clear the undo and redo stacks?")))
+ selected_instance->clear_undo_stack();
selected_instance->clear_redo_stack();
}
}
selected_instance->clear_redo_stack();
}
}
action_group->get_action("clear-undo")->set_sensitive(instance->get_undo_status());
action_group->get_action("redo")->set_sensitive(instance->get_redo_status());
action_group->get_action("clear-redo")->set_sensitive(instance->get_redo_status());
action_group->get_action("clear-undo")->set_sensitive(instance->get_undo_status());
action_group->get_action("redo")->set_sensitive(instance->get_redo_status());
action_group->get_action("clear-redo")->set_sensitive(instance->get_redo_status());
+ action_group->get_action("clear-undo-and-redo")->set_sensitive(instance->get_undo_status() || instance->get_redo_status());
void clear_undo();
void clear_redo();
void clear_undo();
void clear_redo();
+ void clear_undo_and_redo();
bool on_action_event(GdkEvent *event);
void on_action_toggle(const Glib::ustring& path);
bool on_action_event(GdkEvent *event);
void on_action_toggle(const Glib::ustring& path);