[epiphany/overview: 19/30] ephy-window: add a method to toggle visibility of default actions
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/overview: 19/30] ephy-window: add a method to toggle visibility of default actions
- Date: Wed, 13 Jun 2012 08:22:37 +0000 (UTC)
commit ebb76cfe2f9fed48b82d6048ae7fd0f53ff1477d
Author: Claudio Saavedra <csaavedra igalia com>
Date: Wed May 9 19:06:18 2012 +0300
ephy-window: add a method to toggle visibility of default actions
Where default actions are the ones that should be disabled when the
overview or a blank page are visible.
src/ephy-window.c | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 0c2b05d..9eff5b4 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1537,14 +1537,13 @@ sync_tab_navigation (EphyWebView *view,
}
static void
-sync_tab_is_blank (EphyWebView *view,
- GParamSpec *pspec,
- EphyWindow *window)
+_ephy_window_set_default_actions_sensitive (EphyWindow *window,
+ guint flags,
+ gboolean set)
{
EphyWindowPrivate *priv = window->priv;
GtkActionGroup *action_group;
GtkAction *action;
- gboolean is_blank = TRUE;
int i;
const char *action_group_actions[] = { "FileSaveAs", "FileSaveAsApplication", "FilePrint",
"FileSendTo", "FileBookmarkPage", "EditFind",
@@ -1552,9 +1551,6 @@ sync_tab_is_blank (EphyWebView *view,
"ViewZoomIn", "ViewZoomOut", "ViewPageSource",
NULL };
- if (window->priv->closing) return;
-
- is_blank = ephy_web_view_get_is_blank (view);
action_group = priv->action_group;
/* Page menu */
@@ -1563,25 +1559,37 @@ sync_tab_is_blank (EphyWebView *view,
action = gtk_action_group_get_action (action_group,
action_group_actions[i]);
ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
+ flags, set);
}
/* Page context popup */
action = gtk_action_group_get_action (priv->popups_action_group,
"ContextBookmarkPage");
ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
+ flags, set);
action = gtk_action_group_get_action (priv->popups_action_group,
"InspectElement");
ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
+ flags, set);
/* Toolbar */
action = gtk_action_group_get_action (priv->toolbar_action_group,
"ViewCombinedStopReload");
ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
+ flags, set);
+}
+
+static void
+sync_tab_is_blank (EphyWebView *view,
+ GParamSpec *pspec,
+ EphyWindow *window)
+{
+ if (window->priv->closing) return;
+
+ _ephy_window_set_default_actions_sensitive (window,
+ SENS_FLAG_IS_BLANK,
+ ephy_web_view_get_is_blank (view));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]