aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-12-19 05:03:37 +0800
committerChristian Persch <chpe@src.gnome.org>2004-12-19 05:03:37 +0800
commit75c9289b87c94322caf554327ca79154439d98f2 (patch)
tree8ab2b92f572501dd42d0c087b1033a2178bf074b /src
parent0394ea9dfc7b661c58754433f5ce49bf2ac273e1 (diff)
downloadgsoc2013-epiphany-75c9289b87c94322caf554327ca79154439d98f2.tar
gsoc2013-epiphany-75c9289b87c94322caf554327ca79154439d98f2.tar.gz
gsoc2013-epiphany-75c9289b87c94322caf554327ca79154439d98f2.tar.bz2
gsoc2013-epiphany-75c9289b87c94322caf554327ca79154439d98f2.tar.lz
gsoc2013-epiphany-75c9289b87c94322caf554327ca79154439d98f2.tar.xz
gsoc2013-epiphany-75c9289b87c94322caf554327ca79154439d98f2.tar.zst
gsoc2013-epiphany-75c9289b87c94322caf554327ca79154439d98f2.zip
Disable Print and Print Preview while still loading the page. Fixes bug
2004-12-18 Christian Persch <chpe@cvs.gnome.org> * src/ephy-window.c: (update_print_actions), (update_actions_sensitivity), (sync_tab_load_status): Disable Print and Print Preview while still loading the page. Fixes bug #116344.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index da4785148..e9a0878be 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1009,13 +1009,33 @@ update_chromes_actions (EphyWindow *window)
}
static void
+update_print_actions (EphyWindow *window,
+ gboolean enable)
+{
+ GtkActionGroup *action_group = window->priv->action_group;
+ GtkAction *action;
+ gboolean printing, print_setup;
+
+ printing = !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINTING);
+ print_setup = !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINT_SETUP) &&
+ !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_COMMAND_LINE);
+
+ action = gtk_action_group_get_action (action_group, "FilePrintSetup");
+ g_object_set (action, "sensitive", printing && print_setup, NULL);
+ action = gtk_action_group_get_action (action_group, "FilePrintPreview");
+ g_object_set (action, "sensitive", enable && printing && print_setup, NULL);
+ action = gtk_action_group_get_action (action_group, "FilePrint");
+ g_object_set (action, "sensitive", enable && printing, NULL);
+
+}
+
+static void
update_actions_sensitivity (EphyWindow *window)
{
GtkActionGroup *action_group = window->priv->action_group;
GtkActionGroup *popups_action_group = window->priv->popups_action_group;
GtkAction *action;
- gboolean bookmarks_editable, save_to_disk;
- gboolean printing, print_setup, fullscreen;
+ gboolean bookmarks_editable, save_to_disk, fullscreen;
action = gtk_action_group_get_action (action_group, "ViewToolbar");
g_object_set (action, "sensitive", eel_gconf_key_is_writable (CONF_WINDOWS_SHOW_TOOLBARS), NULL);
@@ -1053,17 +1073,6 @@ update_actions_sensitivity (EphyWindow *window)
g_object_set (action, "sensitive", save_to_disk, NULL);
action = gtk_action_group_get_action (popups_action_group, "SaveImageAs");
g_object_set (action, "sensitive", save_to_disk, NULL);
-
- printing = !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINTING);
- print_setup = !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINT_SETUP) &&
- !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_COMMAND_LINE);
- action = gtk_action_group_get_action (action_group, "FilePrintSetup");
- g_object_set (action, "sensitive", printing && print_setup, NULL);
- action = gtk_action_group_get_action (action_group, "FilePrintPreview");
- g_object_set (action, "sensitive", printing && print_setup, NULL);
- action = gtk_action_group_get_action (action_group, "FilePrint");
- g_object_set (action, "sensitive", printing, NULL);
-
action = gtk_action_group_get_action (popups_action_group, "SetImageAsBackground");
g_object_set (action, "sensitive", eel_gconf_key_is_writable (CONF_DESKTOP_BG_PICTURE), NULL);
@@ -1077,6 +1086,8 @@ update_actions_sensitivity (EphyWindow *window)
g_object_set (action, "sensitive", !fullscreen, NULL);
action = gtk_action_group_get_action (action_group, "TabsDetach");
g_object_set (action, "sensitive", !fullscreen, NULL);
+
+ update_print_actions (window, TRUE);
}
static void
@@ -1419,6 +1430,9 @@ sync_tab_load_status (EphyTab *tab, GParamSpec *pspec, EphyWindow *window)
status = ephy_tab_get_load_status (tab);
g_object_set (action, "sensitive", status, NULL);
+ /* disable print while loading, see bug #116344 */
+ update_print_actions (window, !status);
+
if (status)
{
toolbar_spinner_start (window->priv->toolbar);