summaryrefslogtreecommitdiff
path: root/shell/ev-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c87
1 files changed, 48 insertions, 39 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index b26795e1..9f9576f6 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -418,7 +418,6 @@ ev_window_set_action_sensitive (EvWindow *ev_window,
G_GNUC_END_IGNORE_DEPRECATIONS;
}
-
static void
ev_window_setup_action_sensitivity (EvWindow *ev_window)
{
@@ -1555,7 +1554,6 @@ ev_window_setup_default (EvWindow *ev_window)
ev_document_model_set_scale (model, g_settings_get_double (settings, "zoom"));
}
-
static void
ev_window_clear_thumbnail_job (EvWindow *ev_window)
{
@@ -1787,6 +1785,14 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document)
ev_view_disconnect_handlers(EV_VIEW(ev_window->priv->view));
g_object_unref(ev_window->priv->view);
ev_window->priv->view = NULL;
+
+ if (ev_window->priv->webview == NULL)
+ {
+ ev_window->priv->webview = ev_web_view_new();
+ ev_web_view_set_model(EV_WEB_VIEW(ev_window->priv->webview),ev_window->priv->model);
+ ev_web_view_reload(EV_WEB_VIEW(ev_window->priv->webview));
+ }
+
gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window),
ev_window->priv->webview);
gtk_widget_show(ev_window->priv->webview);
@@ -2166,6 +2172,19 @@ show_loading_progress (EvWindow *ev_window)
return FALSE;
}
+#if !GLIB_CHECK_VERSION(2, 62, 0)
+/* Non-year-2038-proof compatibility with GLib < 2.62 */
+static GDateTime *
+_g_file_info_get_modification_date_time (GFileInfo *info)
+{
+ GTimeVal mtime;
+
+ g_file_info_get_modification_time (info, &mtime);
+ return g_date_time_new_from_timeval_utc (&mtime);
+}
+#define g_file_info_get_modification_date_time _g_file_info_get_modification_date_time
+#endif
+
static void
ev_window_load_remote_failed (EvWindow *ev_window,
GError *error)
@@ -3580,9 +3599,12 @@ ev_window_print_update_pending_jobs_message (EvWindow *ev_window,
}
if (n_jobs > 1) {
- text = g_strdup_printf (ngettext ("%d pending job in queue",
- "%d pending jobs in queue",
- n_jobs - 1), n_jobs - 1);
+ gulong n = (gulong) (n_jobs - 1);
+ text = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
+ "%lu pending job in queue",
+ "%lu pending jobs in queue",
+ n),
+ n);
}
ev_message_area_set_secondary_text (EV_MESSAGE_AREA (ev_window->priv->message_area),
@@ -3625,7 +3647,6 @@ ev_window_print_operation_done (EvPrintOperation *op,
GtkWidget *dialog;
GError *error = NULL;
-
ev_print_operation_get_error (op, &error);
/* The message area is already used by
@@ -3880,7 +3901,6 @@ ev_window_check_document_modified (EvWindow *ev_window)
return FALSE;
}
-
text = g_markup_printf_escaped (_("Save a copy of document “%s” before closing?"),
gtk_window_get_title (GTK_WINDOW (ev_window)));
@@ -3979,12 +3999,13 @@ ev_window_check_print_queue (EvWindow *ev_window)
/* TRANS: the singular form is not really used as n_print_jobs > 1
but some languages distinguish between different plurals forms,
so the ngettext is needed. */
- text = g_strdup_printf (ngettext("There is %d print job active. "
- "Wait until print finishes before closing?",
- "There are %d print jobs active. "
- "Wait until print finishes before closing?",
- n_print_jobs),
- n_print_jobs);
+ text = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
+ "There is %d print job active. "
+ "Wait until print finishes before closing?",
+ "There are %d print jobs active. "
+ "Wait until print finishes before closing?",
+ (gulong) n_print_jobs),
+ n_print_jobs);
}
markup = g_strdup_printf ("<b>%s</b>", text);
@@ -4402,7 +4423,6 @@ ev_window_inhibit_screensaver (EvWindow *window)
_("Running in presentation mode"));
}
-
static void
ev_window_uninhibit_screensaver (EvWindow *window)
{
@@ -4715,7 +4735,6 @@ ev_window_set_page_mode (EvWindow *window,
ev_window_update_actions (window);
}
-
static void
ev_window_cmd_edit_rotate_left (GtkAction *action, EvWindow *ev_window)
{
@@ -5446,7 +5465,7 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window)
"copyright", _("Copyright \xc2\xa9 1996–2009 The Evince authors\n"
"Copyright \xc2\xa9 2012–2021 The MATE developers"),
"license", license_trans,
- "website", "https://mate-desktop.org/",
+ "website", PACKAGE_URL,
"comments", comments,
"authors", authors,
"documenters", documenters,
@@ -5744,10 +5763,11 @@ ev_window_update_find_status_message (EvWindow *ev_window)
/* TRANS: Sometimes this could be better translated as
"%d hit(s) on this page". Therefore this string
contains plural cases. */
- message = g_strdup_printf (ngettext ("%d found on this page",
- "%d found on this page",
- n_results),
- n_results);
+ message = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
+ "%d found on this page",
+ "%d found on this page",
+ (gulong) n_results),
+ n_results);
} else {
message = g_strdup (_("Not found"));
}
@@ -5964,7 +5984,6 @@ zoom_control_changed_cb (EphyZoomAction *action,
* the new expanded window size.
*/
-
if (ev_window->priv->chrome & EV_CHROME_SIDEBAR)
{
GtkAllocation alloc;
@@ -6429,12 +6448,12 @@ ev_window_class_init (EvWindowClass *ev_window_class)
/* Normal items */
static const GtkActionEntry entries[] = {
- { "File", NULL, N_("_File") },
- { "Edit", NULL, N_("_Edit") },
- { "View", NULL, N_("_View") },
- { "Go", NULL, N_("_Go") },
- { "Bookmarks", NULL, N_("_Bookmarks") },
- { "Help", NULL, N_("_Help") },
+ { "File", NULL, N_("_File"), NULL, NULL, NULL },
+ { "Edit", NULL, N_("_Edit"), NULL, NULL, NULL },
+ { "View", NULL, N_("_View"), NULL, NULL, NULL },
+ { "Go", NULL, N_("_Go"), NULL, NULL, NULL },
+ { "Bookmarks", NULL, N_("_Bookmarks"), NULL, NULL, NULL },
+ { "Help", NULL, N_("_Help"), NULL, NULL, NULL },
/* File menu */
{ "FileOpen", "document-open", N_("_Open…"), "<control>O",
@@ -6478,7 +6497,6 @@ static const GtkActionEntry entries[] = {
{ "EditSaveSettings", NULL, N_("Save Current Settings as _Default"), "<control>T", NULL,
G_CALLBACK (ev_window_cmd_edit_save_settings) },
-
/* View menu */
{ "ViewZoomIn", "zoom-in", N_("Zoom _In"), "<control>plus",
N_("Enlarge the document"),
@@ -7733,7 +7751,6 @@ ev_window_emit_doc_loaded (EvWindow *window)
ev_atril_window_emit_document_loaded (window->priv->skeleton, window->priv->uri);
}
-
#ifdef ENABLE_SYNCTEX
static gboolean
handle_sync_view_cb (EvAtrilWindow *object,
@@ -7787,7 +7804,6 @@ ev_window_init (EvWindow *ev_window)
GtkCssProvider *css_provider;
GError *error = NULL;
GtkWidget *sidebar_widget;
- GtkWidget *menuitem;
GtkWidget *overlay;
GObject *mpkeys;
guint page_cache_mb;
@@ -7923,12 +7939,6 @@ ev_window_init (EvWindow *ev_window)
gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box),
ev_window->priv->menubar,
FALSE, FALSE, 0);
- menuitem = gtk_ui_manager_get_widget (ev_window->priv->ui_manager,
- "/MainMenu/EditMenu/EditRotateLeftMenu");
- gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
- menuitem = gtk_ui_manager_get_widget (ev_window->priv->ui_manager,
- "/MainMenu/EditMenu/EditRotateRightMenu");
- gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
ev_window->priv->toolbars_model = get_toolbars_model ();
ev_window->priv->toolbar = GTK_WIDGET
@@ -8084,9 +8094,8 @@ ev_window_init (EvWindow *ev_window)
ev_window->priv->view = ev_view_new ();
-#if ENABLE_EPUB /*The webview, we won't add it now but it will replace the atril-view if a web(epub) document is encountered.*/
- ev_window->priv->webview = ev_web_view_new();
- ev_web_view_set_model(EV_WEB_VIEW(ev_window->priv->webview),ev_window->priv->model);
+#if ENABLE_EPUB /* The webview is created in ev_window_set_document only if the document is a webdocument. */
+ ev_window->priv->webview = NULL;
#endif
page_cache_mb = g_settings_get_uint (ev_window_ensure_settings (ev_window),
GS_PAGE_CACHE_SIZE);