]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
Updated Czech translation.
[evince.git] / shell / ev-window.c
index cef9c24284a1f29e38bfb7e873f05827c34e44c1..fac6047d77ac868369087cbf0c4818979df05085 100644 (file)
@@ -61,6 +61,7 @@
 #include "ev-application.h"
 #include "ev-stock-icons.h"
 #include "ev-metadata-manager.h"
+#include "ev-file-helpers.h"
 
 #include <poppler.h>
 
@@ -152,7 +153,8 @@ static const GtkTargetEntry ev_drop_types[] = {
 #define GCONF_CHROME_TOOLBAR   "/apps/evince/show_toolbar"
 #define GCONF_CHROME_SIDEBAR   "/apps/evince/show_sidebar"
 #define GCONF_CHROME_STATUSBAR "/apps/evince/show_statusbar"
-
+#define GCONF_LOCKDOWN_SAVE     "/desktop/gnome/lockdown/disable_save_to_disk"
+#define GCONF_LOCKDOWN_PRINT    "/desktop/gnome/lockdown/disable_printing"
 #define GCONF_SIDEBAR_SIZE      "/apps/evince/sidebar_size"
 
 #define SIDEBAR_DEFAULT_SIZE    132
@@ -212,6 +214,7 @@ update_action_sensitivity (EvWindow *ev_window)
        gboolean ok_to_print = TRUE;
        gboolean ok_to_copy = TRUE;
        gboolean has_properties = TRUE;
+       GConfClient *client;
 
        view = EV_VIEW (ev_window->priv->view);
 
@@ -240,6 +243,16 @@ update_action_sensitivity (EvWindow *ev_window)
        if (!info || info->fields_mask == 0) {
                has_properties = FALSE;
        }
+       
+       client = gconf_client_get_default ();
+
+       if (gconf_client_get_bool (client, GCONF_LOCKDOWN_SAVE, NULL)) {
+               ok_to_copy = FALSE;
+       }
+
+       if (gconf_client_get_bool (client, GCONF_LOCKDOWN_PRINT, NULL)) {
+               ok_to_print = FALSE;
+       }
 
        /* File menu */
        /* "FileOpen": always sensitive */
@@ -1334,8 +1347,12 @@ save_print_config_to_file (GnomePrintConfig *config)
        file_name = g_build_filename (ev_dot_dir (),
                                      PRINT_CONFIG_FILENAME,
                                      NULL);
-       
+
+#ifdef HAVE_G_FILE_SET_CONTENTS
        g_file_set_contents (file_name, str, -1, NULL);
+#else
+       ev_file_set_contents (file_name, str, -1, NULL);
+#endif
 
        g_free (file_name);
        g_free (str);