aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@src.gnome.org>2008-02-15 09:10:36 +0800
committerCosimo Cecchi <cosimoc@src.gnome.org>2008-02-15 09:10:36 +0800
commit7411f596afe064f52e49e778f81d0e88f0b13d3c (patch)
treef2e59f258b0fe768a9283e66917580f7c95ebce3 /src/ephy-window.c
parent3bb5f859cf406cec4e562c17afe276db2ef92b4b (diff)
downloadgsoc2013-epiphany-7411f596afe064f52e49e778f81d0e88f0b13d3c.tar
gsoc2013-epiphany-7411f596afe064f52e49e778f81d0e88f0b13d3c.tar.gz
gsoc2013-epiphany-7411f596afe064f52e49e778f81d0e88f0b13d3c.tar.bz2
gsoc2013-epiphany-7411f596afe064f52e49e778f81d0e88f0b13d3c.tar.lz
gsoc2013-epiphany-7411f596afe064f52e49e778f81d0e88f0b13d3c.tar.xz
gsoc2013-epiphany-7411f596afe064f52e49e778f81d0e88f0b13d3c.tar.zst
gsoc2013-epiphany-7411f596afe064f52e49e778f81d0e88f0b13d3c.zip
Add Undo/Redo commands to the location entry, both in the context menu
and linked to the main window commands. Bug #171179. svn path=/trunk/; revision=7945
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 93f9f16f7..46da33704 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -57,6 +57,7 @@
#include "ephy-find-toolbar.h"
#include "ephy-embed-persist.h"
#include "ephy-embed-factory.h"
+#include "ephy-location-entry.h"
#include <string.h>
#include <glib/gi18n.h>
@@ -1133,15 +1134,35 @@ update_edit_actions_sensitivity (EphyWindow *window, gboolean hide)
if (GTK_IS_EDITABLE (widget))
{
gboolean has_selection;
-
+ GtkActionGroup *action_group;
+ GtkAction *location_action;
+ GSList *proxies;
+ GtkWidget *proxy;
+
+ action_group = ephy_toolbar_get_action_group (window->priv->toolbar);
+ location_action = gtk_action_group_get_action (action_group,
+ "Location");
+ proxies = gtk_action_get_proxies (location_action);
+ proxy = GTK_WIDGET (proxies->data);
+
has_selection = gtk_editable_get_selection_bounds
(GTK_EDITABLE (widget), NULL, NULL);
can_copy = has_selection;
can_cut = has_selection;
can_paste = TRUE;
- can_undo = FALSE;
- can_redo = FALSE;
+ if (proxy != NULL &&
+ EPHY_IS_LOCATION_ENTRY (proxy) &&
+ widget == ephy_location_entry_get_entry (EPHY_LOCATION_ENTRY (proxy)))
+ {
+ can_undo = ephy_location_entry_get_can_undo (EPHY_LOCATION_ENTRY (proxy));
+ can_redo = ephy_location_entry_get_can_redo (EPHY_LOCATION_ENTRY (proxy));
+ }
+ else
+ {
+ can_undo = FALSE;
+ can_redo = FALSE;
+ }
}
else
{