aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-03-28 03:16:39 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:50 +0800
commit392973975c3e4a4e8fe17731b5e397ae10a91517 (patch)
tree40d5e138d9d116af9da0fbc58b304b2e4ffad774 /shell
parent6e996d8023dc195cb07290a729d7d8a3ccb76e65 (diff)
downloadgsoc2013-evolution-392973975c3e4a4e8fe17731b5e397ae10a91517.tar
gsoc2013-evolution-392973975c3e4a4e8fe17731b5e397ae10a91517.tar.gz
gsoc2013-evolution-392973975c3e4a4e8fe17731b5e397ae10a91517.tar.bz2
gsoc2013-evolution-392973975c3e4a4e8fe17731b5e397ae10a91517.tar.lz
gsoc2013-evolution-392973975c3e4a4e8fe17731b5e397ae10a91517.tar.xz
gsoc2013-evolution-392973975c3e4a4e8fe17731b5e397ae10a91517.tar.zst
gsoc2013-evolution-392973975c3e4a4e8fe17731b5e397ae10a91517.zip
Restore lockdown integration.
With lockdown settings available through GSettings, widgets can handle lockdown integration themselves without having to use EShellSettings. Also fixed a few places where printing or save-to-disk actions were either not properly wired up or not responding to lockdown settings, but much more work needs done. Attachments, for example, are not honoring the disable-save-to-disk setting at all. This too requires the recently-added gsettings-desktop-schemas dependency.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-utils.c36
-rw-r--r--shell/e-shell-utils.h3
-rw-r--r--shell/e-shell-window-private.c46
-rw-r--r--shell/e-shell.c26
4 files changed, 21 insertions, 90 deletions
diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c
index b1de7119a8..4676a2d2e9 100644
--- a/shell/e-shell-utils.c
+++ b/shell/e-shell-utils.c
@@ -54,42 +54,6 @@ e_shell_configure_ui_manager (EShell *shell,
}
/**
- * e_shell_configure_web_view:
- * @shell: an #EShell
- * @web_view: an #EWebView
- *
- * Adds shell integration to @web_view. In particular, it configures
- * @web_view to honor the printing and save-to-disk lockdown options.
- **/
-void
-e_shell_configure_web_view (EShell *shell,
- EWebView *web_view)
-{
-#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-scheams,
- * so disable lockdown integration until we're ready for
- * GSettings. */
- EShellSettings *shell_settings;
-
- g_return_if_fail (E_IS_SHELL (shell));
- g_return_if_fail (E_IS_WEB_VIEW (web_view));
-
- shell_settings = e_shell_get_shell_settings (shell);
-
-#ifndef G_OS_WIN32
- g_object_bind_property (
- shell_settings, "disable-printing",
- web_view, "disable-printing",
- G_BINDING_SYNC_CREATE);
-
- g_object_bind_property (
- shell_settings, "disable-save-to-disk",
- web_view, "disable-save-to-disk",
- G_BINDING_SYNC_CREATE);
-#endif
-#endif
-}
-
-/**
* e_shell_run_open_dialog:
* @shell: an #EShell
* @title: file chooser dialog title
diff --git a/shell/e-shell-utils.h b/shell/e-shell-utils.h
index a45ecdb1ca..178c26d20f 100644
--- a/shell/e-shell-utils.h
+++ b/shell/e-shell-utils.h
@@ -31,9 +31,6 @@ G_BEGIN_DECLS
void e_shell_configure_ui_manager (EShell *shell,
EUIManager *ui_manager);
-void e_shell_configure_web_view (EShell *shell,
- EWebView *web_view);
-
GFile * e_shell_run_open_dialog (EShell *shell,
const gchar *title,
GtkCallback customize_func,
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index db2bf069a9..613529419b 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -261,16 +261,10 @@ void
e_shell_window_private_constructed (EShellWindow *shell_window)
{
EShellWindowPrivate *priv = shell_window->priv;
-#if 0
- EShellSettings *shell_settings;
-#endif
EShell *shell;
GConfBridge *bridge;
GtkAction *action;
GtkAccelGroup *accel_group;
-#if 0
- GtkActionGroup *action_group;
-#endif
GtkUIManager *ui_manager;
GtkBox *box;
GtkPaned *paned;
@@ -281,12 +275,14 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
const gchar *key;
const gchar *id;
+#ifndef G_OS_WIN32
+ GSettings *settings;
+ GtkActionGroup *action_group;
+#endif
+
window = GTK_WINDOW (shell_window);
shell = e_shell_window_get_shell (shell_window);
-#if 0
- shell_settings = e_shell_get_shell_settings (shell);
-#endif
ui_manager = e_shell_window_get_ui_manager (shell_window);
e_shell_configure_ui_manager (shell, E_UI_MANAGER (ui_manager));
@@ -362,37 +358,37 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
shell_window, "notify::active-view",
G_CALLBACK (e_shell_window_update_search_menu), NULL);
-#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-schemas,
- * so disable lockdown integration until we're ready for
- * GSettings. */
#ifndef G_OS_WIN32
/* Support lockdown. */
+ settings = g_settings_new ("org.gnome.desktop.lockdown");
+
action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
- g_object_bind_property (
- shell_settings, "disable-printing",
+ g_settings_bind (
+ settings, "disable-printing",
action_group, "visible",
- G_BINDING_SYNC_CREATE |
- G_BINDING_INVERT_BOOLEAN);
+ G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN);
action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP);
- g_object_bind_property (
- shell_settings, "disable-print-setup",
+ g_settings_bind (
+ settings, "disable-print-setup",
action_group, "visible",
- G_BINDING_SYNC_CREATE |
- G_BINDING_INVERT_BOOLEAN);
+ G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN);
action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK);
- g_object_bind_property (
- shell_settings, "disable-save-to-disk",
+ g_settings_bind (
+ settings, "disable-save-to-disk",
action_group, "visible",
- G_BINDING_SYNC_CREATE |
- G_BINDING_INVERT_BOOLEAN);
+ G_SETTINGS_BIND_GET |
+ G_SETTINGS_BIND_INVERT_BOOLEAN);
+
+ g_object_unref (settings);
#endif /* G_OS_WIN32 */
-#endif
/* Bind GObject properties to GObject properties. */
diff --git a/shell/e-shell.c b/shell/e-shell.c
index d7ecf69d8c..d9c3508161 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -1244,32 +1244,6 @@ e_shell_init (EShell *shell)
"start-offline",
"/apps/evolution/shell/start_offline");
-#if 0 /* XXX Lockdown keys have moved to gsettings-desktop-schemas,
- * so disable lockdown integration until we're ready for
- * GSettings. */
-#ifndef G_OS_WIN32
- e_shell_settings_install_property_for_key (
- "disable-application-handlers",
- "/desktop/gnome/lockdown/disable_application_handlers");
-
- e_shell_settings_install_property_for_key (
- "disable-command-line",
- "/desktop/gnome/lockdown/disable_command_line");
-
- e_shell_settings_install_property_for_key (
- "disable-printing",
- "/desktop/gnome/lockdown/disable_printing");
-
- e_shell_settings_install_property_for_key (
- "disable-print-setup",
- "/desktop/gnome/lockdown/disable_print_setup");
-
- e_shell_settings_install_property_for_key (
- "disable-save-to-disk",
- "/desktop/gnome/lockdown/disable_save_to_disk");
-#endif /* G_OS_WIN32 */
-#endif
-
/*** Session Management ***/
sm_client = egg_sm_client_get ();