]> www.fi.muni.cz Git - evince.git/commitdiff
Make properties unsensitive if document backend doesn't provide info
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Thu, 23 Jun 2005 22:17:31 +0000 (22:17 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Thu, 23 Jun 2005 22:17:31 +0000 (22:17 +0000)
ChangeLog
shell/ev-window.c

index 72a0b71b9e94921d3a6623615487bee3f2fb1dad..689ab7bc7782c971f4203f9ad3c8f8fa29882081 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-24  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-window.c: (update_action_sensitivity):
+       
+       Make properties unsensitive if document backend doesn't provide
+       any info
+
 2005-06-24  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * dvi/mdvi-lib/bitmap.c: (bitmap_alloc), (bitmap_alloc_raw),
index d5164f1d67333e8d620f1054da34321af7e8aa7c..37531df608cbdcaa42cfd153b1875c8ede6abb1b 100644 (file)
@@ -213,13 +213,18 @@ update_action_sensitivity (EvWindow *ev_window)
        int n_pages = 0, page = -1;
        gboolean ok_to_print = TRUE;
        gboolean ok_to_copy = TRUE;
+       gboolean has_properties = TRUE;
 
        view = EV_VIEW (ev_window->priv->view);
+
        document = ev_window->priv->document;
+
        if (document)
                info = ev_page_cache_get_info (ev_window->priv->page_cache);
+
        page_mode = ev_window->priv->page_mode;
        has_document = document != NULL;
+
        if (has_document && ev_window->priv->page_cache) {
                page = ev_page_cache_get_current_page (ev_window->priv->page_cache);
                n_pages = ev_page_cache_get_n_pages (ev_window->priv->page_cache);
@@ -231,11 +236,15 @@ update_action_sensitivity (EvWindow *ev_window)
                ok_to_copy = (info->permissions & EV_DOCUMENT_PERMISSIONS_OK_TO_COPY);
        }
 
+       if (!info || info->fields_mask == 0) {
+               has_properties = FALSE;
+       }
+
        /* File menu */
        /* "FileOpen": always sensitive */
        set_action_sensitive (ev_window, "FileSaveAs", has_document && ok_to_copy);
        set_action_sensitive (ev_window, "FilePrint", has_pages && ok_to_print);
-       set_action_sensitive (ev_window, "FileProperties", has_document);
+       set_action_sensitive (ev_window, "FileProperties", has_document && has_properties);
        /* "FileCloseWindow": always sensitive */
 
         /* Edit menu */