aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-12-19 05:02:55 +0800
committerChristian Persch <chpe@src.gnome.org>2004-12-19 05:02:55 +0800
commiteae3fc20b75aba36fead5def75d974062fc12507 (patch)
treeaf35f0d951cad7381602c3467fd9c033b663779d
parent0a389e07241775316dfb866341a1a3c9f6b8a441 (diff)
downloadgsoc2013-epiphany-eae3fc20b75aba36fead5def75d974062fc12507.tar
gsoc2013-epiphany-eae3fc20b75aba36fead5def75d974062fc12507.tar.gz
gsoc2013-epiphany-eae3fc20b75aba36fead5def75d974062fc12507.tar.bz2
gsoc2013-epiphany-eae3fc20b75aba36fead5def75d974062fc12507.tar.lz
gsoc2013-epiphany-eae3fc20b75aba36fead5def75d974062fc12507.tar.xz
gsoc2013-epiphany-eae3fc20b75aba36fead5def75d974062fc12507.tar.zst
gsoc2013-epiphany-eae3fc20b75aba36fead5def75d974062fc12507.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.
-rw-r--r--ChangeLog8
-rw-r--r--src/ephy-window.c40
2 files changed, 35 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 25e2fd8ea..59e53b8d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
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.
+
+2004-12-18 Christian Persch <chpe@cvs.gnome.org>
+
* embed/ephy-embed.c: (ephy_embed_chrome_get_type),
(ephy_embed_document_type_get_type), (ephy_embed_base_init):
* embed/ephy-embed.h:
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 75ab35961..72c3bfb20 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1044,13 +1044,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);
@@ -1088,17 +1108,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);
@@ -1112,6 +1121,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
@@ -1477,6 +1488,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);