X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-window.c;h=e9acb618f6add9e6f05eb6da6298853eb8cdd634;hb=2f2b19eb6549f825426fef94e281a62c306ee3a1;hp=e03978172fb2e7e8c39826588ac60f14463ea46f;hpb=5cc8e92ad9fb04792682b474a670aaa803666f78;p=evince.git diff --git a/shell/ev-window.c b/shell/ev-window.c index e0397817..e9acb618 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -153,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 @@ -213,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); @@ -241,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 */ @@ -944,6 +956,7 @@ setup_view_from_metadata (EvWindow *window) GValue dual_page = { 0, }; GValue presentation = { 0, }; GValue fullscreen = { 0, }; + GValue rotation = { 0, }; /* Window size */ if (!GTK_WIDGET_VISIBLE (window)) { @@ -1006,6 +1019,25 @@ setup_view_from_metadata (EvWindow *window) ev_window_run_fullscreen (window); } } + + /* Rotation */ + if (ev_metadata_manager_get (uri, "rotation", &rotation)) { + if (g_value_get_int (&rotation)) { + switch (g_value_get_int (&rotation)) { + case 90: + ev_view_set_rotation (view, 90); + break; + case 180: + ev_view_set_rotation (view, 180); + break; + case 270: + ev_view_set_rotation (view, 270); + break; + default: + break; + } + } + } } void @@ -1042,7 +1074,7 @@ ev_window_cmd_file_open (GtkAction *action, EvWindow *window) GtkWidget *chooser; static char *folder = NULL; - chooser = gtk_file_chooser_dialog_new (_("Open document"), + chooser = gtk_file_chooser_dialog_new (_("Open Document"), GTK_WINDOW (window), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, @@ -1560,6 +1592,9 @@ ev_window_update_fullscreen_popup (EvWindow *window) g_return_if_fail (popup != NULL); + if (GTK_WIDGET (window)->window == NULL) + return; + toolbar = (window->priv->chrome & EV_CHROME_TOOLBAR) != 0 || (window->priv->chrome & EV_CHROME_RAISE_TOOLBAR) != 0; popup_width = popup->requisition.width; @@ -2021,11 +2056,27 @@ ev_window_cmd_edit_toolbar_cb (GtkDialog *dialog, gint response, gpointer data) gtk_widget_destroy (GTK_WIDGET (dialog)); } +/* should these be hooked up to properties?? */ +static void +save_rotation_to_file (EvWindow *window) +{ + int rotation; + + if (window->priv->uri) { + rotation = ev_view_get_rotation (EV_VIEW (window->priv->view)); + ev_metadata_manager_set_int (window->priv->uri, "rotation", + rotation); + } + + +} + static void ev_window_cmd_edit_rotate_left (GtkAction *action, EvWindow *ev_window) { ev_view_rotate_left (EV_VIEW (ev_window->priv->view)); ev_sidebar_thumbnails_refresh (EV_SIDEBAR_THUMBNAILS (ev_window->priv->sidebar_thumbs)); + save_rotation_to_file (ev_window); } static void @@ -2033,6 +2084,7 @@ ev_window_cmd_edit_rotate_right (GtkAction *action, EvWindow *ev_window) { ev_view_rotate_right (EV_VIEW (ev_window->priv->view)); ev_sidebar_thumbnails_refresh (EV_SIDEBAR_THUMBNAILS (ev_window->priv->sidebar_thumbs)); + save_rotation_to_file (ev_window); } static void @@ -2807,16 +2859,16 @@ static const GtkActionEntry entries[] = { { "Help", NULL, N_("_Help") }, /* File menu */ - { "FileOpen", GTK_STOCK_OPEN, NULL, "O", + { "FileOpen", GTK_STOCK_OPEN, N_("_Open..."), "O", N_("Open an existing document"), G_CALLBACK (ev_window_cmd_file_open) }, { "FileSaveAs", GTK_STOCK_SAVE_AS, N_("_Save a Copy..."), NULL, N_("Save the current document with a new filename"), G_CALLBACK (ev_window_cmd_save_as) }, - { "FilePrint", GTK_STOCK_PRINT, N_("Print..."), "P", + { "FilePrint", GTK_STOCK_PRINT, N_("_Print..."), "P", N_("Print this document"), G_CALLBACK (ev_window_cmd_file_print) }, - { "FileProperties", GTK_STOCK_PROPERTIES, N_("Properties"), "Return", + { "FileProperties", GTK_STOCK_PROPERTIES, N_("P_roperties"), "Return", N_("View the properties of this document"), G_CALLBACK (ev_window_cmd_file_properties) }, { "FileCloseWindow", GTK_STOCK_CLOSE, NULL, "W", @@ -2944,7 +2996,7 @@ static const GtkToggleActionEntry toggle_entries[] = { { "ViewStatusbar", NULL, N_("_Statusbar"), NULL, N_("Show or hide the statusbar"), G_CALLBACK (ev_window_view_statusbar_cb), TRUE }, - { "ViewSidebar", NULL, N_("Side _pane"), "F9", + { "ViewSidebar", NULL, N_("Side _Pane"), "F9", N_("Show or hide the side pane"), G_CALLBACK (ev_window_view_sidebar_cb), TRUE }, { "ViewContinuous", EV_STOCK_VIEW_CONTINUOUS, N_("_Continuous"), NULL,