[epiphany] ephy-window: Add update_link_actions_sensitivity()
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-window: Add update_link_actions_sensitivity()
- Date: Tue, 14 Aug 2012 07:10:55 +0000 (UTC)
commit 4fb2d11028bb659fe4b6f85cdfe5f79f702c8434
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Wed Jul 4 12:30:42 2012 +0200
ephy-window: Add update_link_actions_sensitivity()
Helper function that will be shared with the WebKit2 implementation.
src/ephy-window.c | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index c9113c2..0177e51 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1044,6 +1044,22 @@ ephy_window_delete_event (GtkWidget *widget,
#define MAX_SPELL_CHECK_GUESSES 4
static void
+update_link_actions_sensitivity (EphyWindow *window,
+ gboolean link_has_web_scheme)
+{
+ GtkAction *action;
+ GtkActionGroup *action_group;
+
+ action_group = window->priv->popups_action_group;
+
+ action = gtk_action_group_get_action (action_group, "OpenLinkInNewWindow");
+ gtk_action_set_sensitive (action, link_has_web_scheme);
+
+ action = gtk_action_group_get_action (action_group, "OpenLinkInNewTab");
+ ephy_action_change_sensitivity_flags (action, SENS_FLAG_CONTEXT, !link_has_web_scheme);
+}
+
+static void
update_popup_actions_visibility (EphyWindow *window,
WebKitWebView *view,
guint context)
@@ -1833,8 +1849,6 @@ show_embed_popup (EphyWindow *window,
WebKitHitTestResult *hit_test_result)
{
EphyWindowPrivate *priv = window->priv;
- GtkActionGroup *action_group;
- GtkAction *action;
guint context;
const char *popup;
gboolean can_open_in_new;
@@ -1870,14 +1884,7 @@ show_embed_popup (EphyWindow *window,
widget = gtk_ui_manager_get_widget (priv->manager, popup);
g_return_if_fail (widget != NULL);
- action_group = window->priv->popups_action_group;
-
- action = gtk_action_group_get_action (action_group, "OpenLinkInNewWindow");
- gtk_action_set_sensitive (action, can_open_in_new);
-
- action = gtk_action_group_get_action (action_group, "OpenLinkInNewTab");
- ephy_action_change_sensitivity_flags (action, SENS_FLAG_CONTEXT, !can_open_in_new);
-
+ update_link_actions_sensitivity (window, can_open_in_new);
update_popup_actions_visibility (window,
view,
context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]