diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-27 11:50:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-27 11:50:19 +0800 |
commit | 98d262b594caefd053a2d075e2d8482b2d8a12c8 (patch) | |
tree | 1474ebf4401477049436bf89a1432447995d0b00 /mail/e-mail-reader.c | |
parent | e0f414941dd4e13ea074996d10606b0dae7e494b (diff) | |
download | gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar.gz gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar.zst gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.zip |
Add action groups to support lockdown, starting with printing.
Other categories to follow. Editors still need lockdown support.
svn path=/branches/kill-bonobo/; revision=37136
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r-- | mail/e-mail-reader.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 1d39309361..d1ea62857c 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -2300,6 +2300,9 @@ e_mail_reader_check_state (EMailReader *reader) void e_mail_reader_update_actions (EMailReader *reader) { + EShell *shell; + EShellModule *shell_module; + EShellSettings *shell_settings; GtkAction *action; GtkActionGroup *action_group; const gchar *action_name; @@ -2308,6 +2311,7 @@ e_mail_reader_update_actions (EMailReader *reader) /* Be descriptive. */ gboolean any_messages_selected; + gboolean disable_printing; gboolean enable_flag_clear; gboolean enable_flag_completed; gboolean enable_flag_for_followup; @@ -2328,6 +2332,13 @@ e_mail_reader_update_actions (EMailReader *reader) action_group = e_mail_reader_get_action_group (reader); state = e_mail_reader_check_state (reader); + shell_module = e_mail_reader_get_shell_module (reader); + shell = e_shell_module_get_shell (shell_module); + shell_settings = e_shell_get_shell_settings (shell); + + disable_printing = e_shell_settings_get_boolean ( + shell_settings, "disable-printing"); + single_message_selected = (state & E_MAIL_READER_SELECTION_SINGLE); multiple_messages_selected = @@ -2478,12 +2489,12 @@ e_mail_reader_update_actions (EMailReader *reader) gtk_action_set_sensitive (action, sensitive); action_name = "mail-print"; - sensitive = single_message_selected; + sensitive = single_message_selected && !disable_printing; action = e_mail_reader_get_action (reader, action_name); gtk_action_set_sensitive (action, sensitive); action_name = "mail-print-preview"; - sensitive = single_message_selected; + sensitive = single_message_selected && !disable_printing; action = e_mail_reader_get_action (reader, action_name); gtk_action_set_sensitive (action, sensitive); |