aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-11-04 17:08:47 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-11-04 17:08:47 +0800
commitb446f6693c136813dd6ad780ab826a45939e89ce (patch)
treef37c82d24c2141f1b31ef22bf78d3bd675e1c844 /src/ephy-window.c
parent78c2e1a47c7fc6074a80c8b91dbdc1f57e3ba817 (diff)
downloadgsoc2013-epiphany-b446f6693c136813dd6ad780ab826a45939e89ce.tar
gsoc2013-epiphany-b446f6693c136813dd6ad780ab826a45939e89ce.tar.gz
gsoc2013-epiphany-b446f6693c136813dd6ad780ab826a45939e89ce.tar.bz2
gsoc2013-epiphany-b446f6693c136813dd6ad780ab826a45939e89ce.tar.lz
gsoc2013-epiphany-b446f6693c136813dd6ad780ab826a45939e89ce.tar.xz
gsoc2013-epiphany-b446f6693c136813dd6ad780ab826a45939e89ce.tar.zst
gsoc2013-epiphany-b446f6693c136813dd6ad780ab826a45939e89ce.zip
update undo/redo sensitivity
2003-11-04 Marco Pesenti Gritti <marco@gnome.org> * src/ephy-window.c: (window_cmd_edit): update undo/redo sensitivity 2003-11-04 David Adam Bordoley <bordoley@msu.edu> * data/ui/epiphany-ui.xml: * src/window-commands.c: (window_cmd_edit_undo), (window_cmd_edit_redo): * src/window-commands.h: Menus for Undo/Redo
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 03b1d70d2..cbc45f074 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -109,6 +109,12 @@ static GtkActionEntry ephy_menu_entries [] = {
G_CALLBACK (window_cmd_file_close_window) },
/* Edit menu */
+ { "EditUndo", GTK_STOCK_UNDO, N_("_Undo"), "<control>Z",
+ N_("Undo the last action"),
+ G_CALLBACK (window_cmd_edit_undo) },
+ { "EditRedo", GTK_STOCK_REDO, N_("Re_do"), "<shift><control>Z",
+ N_("Redo the last undone action"),
+ G_CALLBACK (window_cmd_edit_redo) },
{ "EditCut", GTK_STOCK_CUT, N_("Cu_t"), "<control>X",
N_("Cut the selection"),
G_CALLBACK (window_cmd_edit_cut) },
@@ -350,7 +356,7 @@ window_cmd_edit (GtkAction *action,
{
GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (window));
GtkActionGroup *action_group;
- gboolean can_copy, can_cut;
+ gboolean can_copy, can_cut, can_undo, can_redo;
if (GTK_IS_EDITABLE (widget))
{
@@ -361,6 +367,8 @@ window_cmd_edit (GtkAction *action,
can_copy = has_selection;
can_cut = has_selection;
+ can_undo = FALSE;
+ can_redo = FALSE;
}
else
{
@@ -373,6 +381,10 @@ window_cmd_edit (GtkAction *action,
(EPHY_COMMAND_MANAGER (embed), "cmd_copy", &can_copy);
ephy_command_manager_get_command_state
(EPHY_COMMAND_MANAGER (embed), "cmd_cut", &can_cut);
+ ephy_command_manager_get_command_state
+ (EPHY_COMMAND_MANAGER (embed), "cmd_undo", &can_undo);
+ ephy_command_manager_get_command_state
+ (EPHY_COMMAND_MANAGER (embed), "cmd_redo", &can_redo);
}
action_group = window->priv->action_group;
@@ -382,6 +394,12 @@ window_cmd_edit (GtkAction *action,
action = gtk_action_group_get_action (action_group, "EditCut");
g_object_set (action, "sensitive", can_cut, NULL);
+
+ action = gtk_action_group_get_action (action_group, "EditUndo");
+ g_object_set (action, "sensitive", can_undo, NULL);
+
+ action = gtk_action_group_get_action (action_group, "EditRedo");
+ g_object_set (action, "sensitive", can_redo, NULL);
}
static void