#include "ev-document-fonts.h"
#include "ev-document-find.h"
#include "ev-document-security.h"
+#include "ev-document-types.h"
#include "ev-job-queue.h"
#include "ev-jobs.h"
#include "ev-statusbar.h"
#include "ev-application.h"
#include "ev-stock-icons.h"
#include "ev-file-helpers.h"
+
#include <poppler.h>
#include <glib/gi18n.h>
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 */
has_pages && EV_IS_DOCUMENT_FIND (document));
set_action_sensitive (ev_window, "EditFindNext",
ev_view_can_find_next (view));
+ set_action_sensitive (ev_window, "EditRotateLeft", has_document);
+ set_action_sensitive (ev_window, "EditRotateRight", has_document);
/* View menu */
set_action_sensitive (ev_window, "ViewContinuous", has_pages);
ev_window_cmd_save_as (GtkAction *action, EvWindow *ev_window)
{
GtkWidget *fc;
- GtkFileFilter *pdf_filter, *all_filter;
- gchar *uri = NULL;
+
+ gchar *uri;
+ gchar *basename;
+ static char* folder = NULL;
+
gboolean success;
fc = gtk_file_chooser_dialog_new (
NULL);
gtk_window_set_modal (GTK_WINDOW (fc), TRUE);
- pdf_filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (pdf_filter, _("PDF Documents"));
- gtk_file_filter_add_mime_type (pdf_filter, "application/pdf");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (fc), pdf_filter);
-
- all_filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (all_filter, _("All Files"));
- gtk_file_filter_add_pattern (all_filter, "*");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (fc), all_filter);
- gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (fc), pdf_filter);
-
+ ev_document_types_add_filters_for_type (fc, G_TYPE_FROM_INSTANCE (ev_window->priv->document));
gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
+
+ if (folder) {
+ gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER (fc),
+ folder);
+ }
+
+ basename = g_path_get_basename (ev_window->priv->uri);
+ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (fc), basename);
+ g_free (basename);
gtk_widget_show (fc);
else
save_error_dialog (GTK_WINDOW (fc), uri);
}
+
+ if (folder != NULL)
+ g_free (folder);
+
+ folder = gtk_file_chooser_get_current_folder_uri (GTK_FILE_CHOOSER (fc));
+
gtk_widget_destroy (fc);
}
"name", _("Evince"),
"version", VERSION,
"copyright",
- _("\xc2\xa9 1996-2004 The Evince authors"),
+ _("\xc2\xa9 1996-2005 The Evince authors"),
"license", license_trans,
"website", "http://www.gnome.org/projects/evince",
"comments", comments,
EvWindow *ev_window)
{
GtkAction *action;
- gboolean visible, fullscreen;
+ gboolean visible, fullscreen_mode;
+
+
+ fullscreen_mode = ev_view_get_presentation (EV_VIEW (ev_window->priv->view)) ||
+ ev_view_get_fullscreen (EV_VIEW (ev_window->priv->view));
- g_object_get (ev_window->priv->view,
- "fullscreen", &fullscreen,
- NULL);
visible = GTK_WIDGET_VISIBLE (ev_sidebar);
/* In fullscreen mode the sidebar is not visible,
* but we don't want to update the chrome
*/
- if (fullscreen)
+ if (fullscreen_mode)
return;
action = gtk_action_group_get_action (ev_window->priv->action_group, "ViewSidebar");