aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window-private.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-27 11:50:19 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-27 11:50:19 +0800
commit98d262b594caefd053a2d075e2d8482b2d8a12c8 (patch)
tree1474ebf4401477049436bf89a1432447995d0b00 /shell/e-shell-window-private.c
parente0f414941dd4e13ea074996d10606b0dae7e494b (diff)
downloadgsoc2013-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 'shell/e-shell-window-private.c')
-rw-r--r--shell/e-shell-window-private.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index a33f7b7852..2c2ebc5564 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -195,6 +195,12 @@ e_shell_window_private_init (EShellWindow *shell_window)
priv->new_source_actions = gtk_action_group_new ("new-source");
priv->custom_rule_actions = gtk_action_group_new ("custom-rules");
priv->switcher_actions = gtk_action_group_new ("switcher");
+ priv->lockdown_printing =
+ gtk_action_group_new ("lockdown-printing");
+ priv->lockdown_print_setup =
+ gtk_action_group_new ("lockdown-print-setup");
+ priv->lockdown_save_to_disk =
+ gtk_action_group_new ("lockdown-save-to-disk");
priv->loaded_views = loaded_views;
priv->active_view = "unknown";
priv->signal_handler_ids = signal_handler_ids;
@@ -325,15 +331,41 @@ void
e_shell_window_private_constructed (EShellWindow *shell_window)
{
EShellWindowPrivate *priv = shell_window->priv;
+ EShellSettings *shell_settings;
+ EShell *shell;
GConfBridge *bridge;
+ GtkActionGroup *action_group;
GObject *object;
const gchar *key;
+ shell = e_shell_window_get_shell (shell_window);
+ shell_settings = e_shell_get_shell_settings (shell);
+
/* Create the switcher actions before we set the initial
* shell view, because the shell view relies on them for
* default settings during construction. */
e_shell_window_create_switcher_actions (shell_window);
+ /* Support lockdown. */
+
+ action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+
+ e_binding_new_with_negation (
+ G_OBJECT (shell_settings), "disable-printing",
+ G_OBJECT (action_group), "sensitive");
+
+ action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP);
+
+ e_binding_new_with_negation (
+ G_OBJECT (shell_settings), "disable-print-setup",
+ G_OBJECT (action_group), "sensitive");
+
+ action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK);
+
+ e_binding_new_with_negation (
+ G_OBJECT (shell_settings), "disable-save-to-disk",
+ G_OBJECT (action_group), "sensitive");
+
/* Bind GObject properties to GConf keys. */
bridge = gconf_bridge_get ();
@@ -398,6 +430,9 @@ e_shell_window_private_dispose (EShellWindow *shell_window)
DISPOSE (priv->new_source_actions);
DISPOSE (priv->custom_rule_actions);
DISPOSE (priv->switcher_actions);
+ DISPOSE (priv->lockdown_printing);
+ DISPOSE (priv->lockdown_print_setup);
+ DISPOSE (priv->lockdown_save_to_disk);
g_hash_table_remove_all (priv->loaded_views);