+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),
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);
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 */