request_width = MIN (request_width, gdk_screen_get_width (screen));
request_height = MIN (request_width, gdk_screen_get_height (screen));
}
-
- gtk_window_resize (GTK_WINDOW (window),
- request_width,
- request_height);
+
+ if (request_width > 0 && request_height > 0) {
+ gtk_window_resize (GTK_WINDOW (window),
+ request_width,
+ request_height);
+ }
g_value_unset (&width_ratio);
g_value_unset (&height_ratio);
}
EvDocument *document = ev_window->priv->document;
if (!EV_IS_DOCUMENT_THUMBNAILS (document) ||
- ev_page_cache_get_n_pages (ev_window->priv->page_cache) <= 0) {
+ ev_page_cache_get_n_pages (ev_window->priv->page_cache) <= 0 ||
+ ev_page_cache_check_dimensions (ev_window->priv->page_cache)) {
return;
}
ev_window->priv->dest = NULL;
}
- if (ev_page_cache_get_n_pages (ev_window->priv->page_cache) > 0) {
- ev_view_set_document (view, document);
- } else {
+ if (ev_page_cache_get_n_pages (ev_window->priv->page_cache) <= 0) {
ev_window_warning_message (ev_window, "%s",
_("The document contains no pages"));
+ } else if (ev_page_cache_check_dimensions (ev_window->priv->page_cache)) {
+ ev_window_warning_message (ev_window, "%s",
+ _("The document contains only empty pages"));
+ } else {
+ ev_view_set_document (view, document);
}
if (ev_window->priv->setup_document_idle > 0)
g_source_remove (ev_window->priv->setup_document_idle);
+
ev_window->priv->setup_document_idle = g_idle_add ((GSourceFunc)ev_window_setup_document, ev_window);
}
{
GtkWidget *area;
gchar *text;
+ gchar *display_name;
if (ev_window->priv->message_area)
return FALSE;
-
- text = g_strdup_printf (_("Loading document from %s"),
- ev_window->priv->uri);
+
+ display_name = escape_uri_for_display (ev_window->priv->uri);
+ text = g_strdup_printf (_("Loading document from ā%sā"),
+ display_name);
+
area = ev_progress_message_area_new (GTK_STOCK_OPEN,
text,
GTK_STOCK_CLOSE,
ev_window);
gtk_widget_show (area);
ev_window_set_message_area (ev_window, area);
+
g_free (text);
+ g_free (display_name);
return FALSE;
}
{ "FileSaveAs", GTK_STOCK_SAVE_AS, N_("_Save a Copy..."), "<control>S",
N_("Save a copy of the current document"),
G_CALLBACK (ev_window_cmd_save_as) },
- { "FilePageSetup", NULL, N_("Page Set_up..."), NULL,
+ { "FilePageSetup", GTK_STOCK_PAGE_SETUP, N_("Page Set_up..."), NULL,
N_("Setup the page settings for printing"),
G_CALLBACK (ev_window_cmd_file_print_setup) },
{ "FilePrint", GTK_STOCK_PRINT, N_("_Print..."), "<control>P",