aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-01-30 22:42:17 +0800
committerXan Lopez <xan@igalia.com>2012-01-30 22:42:17 +0800
commit5fd01e8495dc80438591332df9794ea321d8102e (patch)
tree21adede26c1dc398f47b1444e31794733987ab52 /src
parent4220f80676712492175b64cc1eeaef9541b9d8c6 (diff)
downloadgsoc2013-epiphany-5fd01e8495dc80438591332df9794ea321d8102e.tar
gsoc2013-epiphany-5fd01e8495dc80438591332df9794ea321d8102e.tar.gz
gsoc2013-epiphany-5fd01e8495dc80438591332df9794ea321d8102e.tar.bz2
gsoc2013-epiphany-5fd01e8495dc80438591332df9794ea321d8102e.tar.lz
gsoc2013-epiphany-5fd01e8495dc80438591332df9794ea321d8102e.tar.xz
gsoc2013-epiphany-5fd01e8495dc80438591332df9794ea321d8102e.tar.zst
gsoc2013-epiphany-5fd01e8495dc80438591332df9794ea321d8102e.zip
ephy-window: do not duplicate tons of code in sync_tab_is_blank
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c72
1 files changed, 13 insertions, 59 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 06df2dd5f..9db1d59c9 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1544,6 +1544,12 @@ sync_tab_is_blank (EphyWebView *view,
GtkActionGroup *action_group;
GtkAction *action;
gboolean is_blank = TRUE;
+ int i;
+ const char *action_group_actions[] = { "FileSaveAs", "FileSaveAsApplication", "FilePrint",
+ "FileSendTo", "FileBookmarkPage", "EditFind",
+ "EditFindPrev", "EditFindNext", "ViewEncoding",
+ "ViewZoomIn", "ViewZoomOut", "ViewPageSource",
+ NULL };
if (window->priv->closing) return;
@@ -1551,65 +1557,13 @@ sync_tab_is_blank (EphyWebView *view,
action_group = priv->action_group;
/* Page menu */
- action = gtk_action_group_get_action (action_group,
- "FileSaveAs");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "FileSaveAsApplication");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "FilePrint");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "FileSendTo");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "FileBookmarkPage");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "EditFind");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "EditFindNext");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "EditFindPrev");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "ViewEncoding");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "ViewZoomIn");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "ViewZoomOut");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
-
- action = gtk_action_group_get_action (action_group,
- "ViewPageSource");
- ephy_action_change_sensitivity_flags (action,
- SENS_FLAG_IS_BLANK, is_blank);
+ for (i = 0; action_group_actions[i] != NULL; i++)
+ {
+ action = gtk_action_group_get_action (action_group,
+ action_group_actions[i]);
+ ephy_action_change_sensitivity_flags (action,
+ SENS_FLAG_IS_BLANK, is_blank);
+ }
/* Page context popup */
action = gtk_action_group_get_action (priv->popups_action_group,