diff options
author | Christopher James Lahey <clahey@ximian.com> | 2004-01-11 05:59:25 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-01-11 05:59:25 +0800 |
commit | 09136af43c1074fb979578be2987cd0ae3a8852d (patch) | |
tree | e4673d8a9ad46a80a97002004426fad58e99841f /src | |
parent | d33c13d6d52a405ef9bec15b414904a9c2620380 (diff) | |
download | gsoc2013-epiphany-09136af43c1074fb979578be2987cd0ae3a8852d.tar gsoc2013-epiphany-09136af43c1074fb979578be2987cd0ae3a8852d.tar.gz gsoc2013-epiphany-09136af43c1074fb979578be2987cd0ae3a8852d.tar.bz2 gsoc2013-epiphany-09136af43c1074fb979578be2987cd0ae3a8852d.tar.lz gsoc2013-epiphany-09136af43c1074fb979578be2987cd0ae3a8852d.tar.xz gsoc2013-epiphany-09136af43c1074fb979578be2987cd0ae3a8852d.tar.zst gsoc2013-epiphany-09136af43c1074fb979578be2987cd0ae3a8852d.zip |
Implement print and print setup disabling for lockdown mode.
2004-01-10 Christopher James Lahey <clahey@ximian.com>
* embed/mozilla/PrintingPromptService.cpp:
* lib/ephy-prefs.h:
* src/ephy-main.c: (main):
* src/ephy-window.c: (update_actions), (ephy_window_init),
(ephy_window_finalize), (ephy_window_print):
Implement print and print setup disabling for lockdown mode.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-main.c | 3 | ||||
-rw-r--r-- | src/ephy-window.c | 52 |
2 files changed, 55 insertions, 0 deletions
diff --git a/src/ephy-main.c b/src/ephy-main.c index ccb349ee3..f2240e76b 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -156,6 +156,8 @@ main (int argc, char *argv[]) ephy_stock_icons_init (); eel_gconf_monitor_add ("/apps/epiphany/general"); eel_gconf_monitor_add ("/apps/epiphany/lockdown"); + eel_gconf_monitor_add ("/desktop/gnome/lockdown"); + bonobo_activate (); ephy_shell = ephy_shell_new (); @@ -182,6 +184,7 @@ main (int argc, char *argv[]) eel_gconf_monitor_remove ("/apps/epiphany/general"); eel_gconf_monitor_remove ("/apps/epiphany/lockdown"); + eel_gconf_monitor_remove ("/desktop/gnome/lockdown"); ephy_state_save (); ephy_file_helpers_shutdown (); gnome_vfs_shutdown (); diff --git a/src/ephy-window.c b/src/ephy-window.c index 8e3c0c91b..2e24e68e0 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -338,7 +338,10 @@ struct EphyWindowPrivate guint disable_bookmark_editing_notifier_id; guint disable_toolbar_editing_notifier_id; guint disable_history_notifier_id; + guint disable_printing_notifier_id; + guint disable_print_setup_notifier_id; guint disable_save_to_disk_notifier_id; + guint disable_command_line_notifier_id; guint browse_with_caret_notifier_id; }; @@ -1710,6 +1713,7 @@ update_actions (EphyWindow *window) GtkActionGroup *popups_action_group = GTK_ACTION_GROUP (window->priv->popups_action_group); GtkAction *action; gboolean bookmarks_editable, save_to_disk; + gboolean printing, print_setup; action = gtk_action_group_get_action (action_group, "ViewToolbar"); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), @@ -1752,6 +1756,16 @@ update_actions (EphyWindow *window) 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); @@ -1919,10 +1933,22 @@ ephy_window_init (EphyWindow *window) (CONF_LOCKDOWN_DISABLE_HISTORY, (GConfClientNotifyFunc)navigation_notifier, window); + window->priv->disable_printing_notifier_id = eel_gconf_notification_add + (CONF_LOCKDOWN_DISABLE_PRINTING, + (GConfClientNotifyFunc)actions_notifier, window); + + window->priv->disable_print_setup_notifier_id = eel_gconf_notification_add + (CONF_LOCKDOWN_DISABLE_PRINT_SETUP, + (GConfClientNotifyFunc)actions_notifier, window); + window->priv->disable_save_to_disk_notifier_id = eel_gconf_notification_add (CONF_LOCKDOWN_DISABLE_SAVE_TO_DISK, (GConfClientNotifyFunc)actions_notifier, window); + window->priv->disable_command_line_notifier_id = eel_gconf_notification_add + (CONF_LOCKDOWN_DISABLE_COMMAND_LINE, + (GConfClientNotifyFunc)actions_notifier, window); + /* other notifiers */ browse_with_caret_notifier (NULL, 0, NULL, window); window->priv->browse_with_caret_notifier_id = eel_gconf_notification_add @@ -1949,7 +1975,10 @@ ephy_window_finalize (GObject *object) eel_gconf_notification_remove (window->priv->disable_bookmark_editing_notifier_id); eel_gconf_notification_remove (window->priv->disable_toolbar_editing_notifier_id); eel_gconf_notification_remove (window->priv->disable_history_notifier_id); + eel_gconf_notification_remove (window->priv->disable_printing_notifier_id); + eel_gconf_notification_remove (window->priv->disable_print_setup_notifier_id); eel_gconf_notification_remove (window->priv->disable_save_to_disk_notifier_id); + eel_gconf_notification_remove (window->priv->disable_command_line_notifier_id); eel_gconf_notification_remove (window->priv->browse_with_caret_notifier_id); if (window->priv->find_dialog) @@ -2296,6 +2325,29 @@ ephy_window_find (EphyWindow *window) void ephy_window_print (EphyWindow *window) { + if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINTING)) + { + return; + } + + if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_PRINT_SETUP) || + eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_COMMAND_LINE)) + { + EphyEmbed *embed; + EmbedPrintInfo *info; + + info = ephy_print_get_print_info (); + + embed = ephy_window_get_active_embed (window); + g_return_if_fail (EPHY_IS_EMBED (embed)); + + ephy_embed_print (embed, info); + + ephy_print_info_free (info); + + return; + } + if (window->priv->print_dialog == NULL) { EphyDialog *dialog; |