summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-06-28 17:15:56 +0200
committerStefano Karapetsas <[email protected]>2014-06-28 17:15:56 +0200
commit1bdae54253b68f2042f1d7f43ac0f36654c9b432 (patch)
tree086100301b82a8c91e58610398c82a0d44a6f364 /shell
parent4e796748f1079ac71fc0496da49e3ee219b98d2e (diff)
downloadatril-1bdae54253b68f2042f1d7f43ac0f36654c9b432.tar.bz2
atril-1bdae54253b68f2042f1d7f43ac0f36654c9b432.tar.xz
Dont require org.mate.lockdown GSettings schema
Closes https://github.com/mate-desktop/atril/issues/75
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-window.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 5b046ae7..d3a8181d 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -42,6 +42,7 @@
#include <gtk/gtk.h>
#include <libmate-desktop/mate-aboutdialog.h>
+#include <libmate-desktop/mate-gsettings.h>
#include "egg-editable-toolbar.h"
#include "egg-toolbar-editor.h"
@@ -424,12 +425,12 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
if (has_document && !ev_print_operation_exists_for_document(document))
ok_to_print = FALSE;
- if (has_document &&
+ if (has_document && ev_window->priv->lockdown_settings &&
g_settings_get_boolean (ev_window->priv->lockdown_settings, MATE_LOCKDOWN_SAVE)) {
ok_to_copy = FALSE;
}
- if (has_document &&
+ if (has_document && ev_window->priv->lockdown_settings &&
g_settings_get_boolean (ev_window->priv->lockdown_settings, MATE_LOCKDOWN_PRINT)) {
ok_to_print = FALSE;
}
@@ -1377,12 +1378,14 @@ ev_window_setup_document (EvWindow *ev_window)
ev_window);
}
- if (!ev_window->priv->lockdown_settings)
- ev_window->priv->lockdown_settings = g_settings_new (MATE_LOCKDOWN_SCHEMA);
- g_signal_connect (ev_window->priv->lockdown_settings,
- "changed",
- G_CALLBACK (lockdown_changed),
- ev_window);
+ if (mate_gsettings_schema_exists (MATE_LOCKDOWN_SCHEMA)) {
+ if (!ev_window->priv->lockdown_settings)
+ ev_window->priv->lockdown_settings = g_settings_new (MATE_LOCKDOWN_SCHEMA);
+ g_signal_connect (ev_window->priv->lockdown_settings,
+ "changed",
+ G_CALLBACK (lockdown_changed),
+ ev_window);
+ }
ev_window_setup_action_sensitivity (ev_window);
@@ -3330,8 +3333,11 @@ ev_window_print_range (EvWindow *ev_window,
ev_print_operation_set_print_settings (op, print_settings);
ev_print_operation_set_default_page_setup (op, print_page_setup);
- ev_print_operation_set_embed_page_setup (op, !g_settings_get_boolean (ev_window->priv->lockdown_settings,
- MATE_LOCKDOWN_PRINT_SETUP));
+ if (ev_window->priv->lockdown_settings)
+ ev_print_operation_set_embed_page_setup (op, !g_settings_get_boolean (ev_window->priv->lockdown_settings,
+ MATE_LOCKDOWN_PRINT_SETUP));
+ else
+ ev_print_operation_set_embed_page_setup (op, TRUE);
g_object_unref (print_settings);
g_object_unref (print_page_setup);