parent
b2709c12ac
commit
e1c8795c16
1
.gitignore
vendored
1
.gitignore
vendored
@ -98,3 +98,4 @@ evince-3.0.0.tar.bz2
|
||||
/evince-3.39.2.tar.xz
|
||||
/evince-40.0.tar.xz
|
||||
/evince-40.1.tar.xz
|
||||
/evince-40.2.tar.xz
|
||||
|
@ -1,190 +0,0 @@
|
||||
From 1f250861fa2ec6a7117f183459e62ac285d85db6 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Tue, 2 Mar 2021 18:40:56 +0100
|
||||
Subject: [PATCH] window: Show password dialog again
|
||||
|
||||
Show password dialog when trying to open a document for which we've
|
||||
cancelled a password dialog before in recent view.
|
||||
|
||||
This is achieved by adding a signal "cancelled" to EvPasswordView since
|
||||
only successfull entering of password was signaled before by "unlock" signal.
|
||||
|
||||
We also need to unregister current document with EvApplication and clear its uri
|
||||
there to be able to open other documents in current window.
|
||||
---
|
||||
shell/ev-application.c | 16 ++++++++++++++++
|
||||
shell/ev-application.h | 1 +
|
||||
shell/ev-password-view.c | 14 ++++++++++++++
|
||||
shell/ev-password-view.h | 3 ++-
|
||||
shell/ev-window.c | 23 ++++++++++++++++++++++-
|
||||
5 files changed, 55 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/shell/ev-application.c b/shell/ev-application.c
|
||||
index 23871d9a..7a3b69ba 100644
|
||||
--- a/shell/ev-application.c
|
||||
+++ b/shell/ev-application.c
|
||||
@@ -539,6 +539,7 @@ ev_application_unregister_uri (EvApplication *application,
|
||||
g_error_free (error);
|
||||
} else {
|
||||
g_variant_unref (value);
|
||||
+ application->doc_registered = FALSE;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLE_DBUS */
|
||||
@@ -1166,6 +1167,21 @@ ev_application_get_uri (EvApplication *application)
|
||||
return application->uri;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * ev_application_clear_uri:
|
||||
+ * @application: The instance of the application.
|
||||
+ *
|
||||
+ * This unregisters current uri and clears it so that another document
|
||||
+ * can be opened in this instance. E.g. after cancelled password dialog
|
||||
+ * in recent view.
|
||||
+ */
|
||||
+void
|
||||
+ev_application_clear_uri (EvApplication *application)
|
||||
+{
|
||||
+ ev_application_unregister_uri (application, application->uri);
|
||||
+ g_clear_pointer (&application->uri, g_free);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* ev_application_get_media_keys:
|
||||
* @application: The instance of the application.
|
||||
diff --git a/shell/ev-application.h b/shell/ev-application.h
|
||||
index 00a7a18b..f9b43ab3 100644
|
||||
--- a/shell/ev-application.h
|
||||
+++ b/shell/ev-application.h
|
||||
@@ -66,6 +66,7 @@ void ev_application_open_uri_list (EvApplication *application,
|
||||
gboolean ev_application_has_window (EvApplication *application);
|
||||
guint ev_application_get_n_windows (EvApplication *application);
|
||||
const gchar * ev_application_get_uri (EvApplication *application);
|
||||
+void ev_application_clear_uri (EvApplication *application);
|
||||
GObject *ev_application_get_media_keys (EvApplication *application);
|
||||
|
||||
const gchar *ev_application_get_dot_dir (EvApplication *application,
|
||||
diff --git a/shell/ev-password-view.c b/shell/ev-password-view.c
|
||||
index 9a916d55..0dab3c51 100644
|
||||
--- a/shell/ev-password-view.c
|
||||
+++ b/shell/ev-password-view.c
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
enum {
|
||||
UNLOCK,
|
||||
+ CANCELLED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
typedef struct {
|
||||
@@ -91,6 +92,15 @@ ev_password_view_class_init (EvPasswordViewClass *class)
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
+ password_view_signals[CANCELLED] =
|
||||
+ g_signal_new ("cancelled",
|
||||
+ G_TYPE_FROM_CLASS (g_object_class),
|
||||
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
||||
+ G_STRUCT_OFFSET (EvPasswordViewClass, cancelled),
|
||||
+ NULL, NULL,
|
||||
+ g_cclosure_marshal_VOID__VOID,
|
||||
+ G_TYPE_NONE, 0);
|
||||
+
|
||||
g_object_class->finalize = ev_password_view_finalize;
|
||||
}
|
||||
|
||||
@@ -183,6 +193,10 @@ ev_password_dialog_got_response (GtkDialog *dialog,
|
||||
g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->password_entry)));
|
||||
|
||||
g_signal_emit (password_view, password_view_signals[UNLOCK], 0);
|
||||
+ } else if (response_id == GTK_RESPONSE_CANCEL ||
|
||||
+ response_id == GTK_RESPONSE_CLOSE ||
|
||||
+ response_id == GTK_RESPONSE_DELETE_EVENT) {
|
||||
+ g_signal_emit (password_view, password_view_signals[CANCELLED], 0);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
diff --git a/shell/ev-password-view.h b/shell/ev-password-view.h
|
||||
index c3fc5bbc..e279c612 100644
|
||||
--- a/shell/ev-password-view.h
|
||||
+++ b/shell/ev-password-view.h
|
||||
@@ -40,7 +40,8 @@ struct _EvPasswordViewClass {
|
||||
GtkViewportClass parent_class;
|
||||
|
||||
/* signals */
|
||||
- void (*unlock) (EvPasswordView *self);
|
||||
+ void (*unlock) (EvPasswordView *self);
|
||||
+ void (*cancelled) (EvPasswordView *self);
|
||||
};
|
||||
|
||||
GType ev_password_view_get_type (void) G_GNUC_CONST;
|
||||
diff --git a/shell/ev-window.c b/shell/ev-window.c
|
||||
index 077d577d..f728fa77 100644
|
||||
--- a/shell/ev-window.c
|
||||
+++ b/shell/ev-window.c
|
||||
@@ -239,6 +239,8 @@ typedef struct {
|
||||
|
||||
/* Send to */
|
||||
gboolean has_mailto_handler;
|
||||
+
|
||||
+ gboolean password_view_cancelled;
|
||||
} EvWindowPrivate;
|
||||
|
||||
#define GET_PRIVATE(o) ev_window_get_instance_private (o)
|
||||
@@ -1804,6 +1806,7 @@ ev_window_password_view_unlock (EvWindow *ev_window)
|
||||
password = ev_password_view_get_password (EV_PASSWORD_VIEW (priv->password_view));
|
||||
ev_job_load_set_password (EV_JOB_LOAD (priv->load_job), password);
|
||||
ev_job_scheduler_push_job (priv->load_job, EV_JOB_PRIORITY_NONE);
|
||||
+ priv->password_view_cancelled = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1821,6 +1824,18 @@ ev_window_clear_load_job (EvWindow *ev_window)
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+ev_window_password_view_cancelled (EvWindow *ev_window)
|
||||
+{
|
||||
+ EvWindowPrivate *priv = GET_PRIVATE (ev_window);
|
||||
+
|
||||
+ priv->password_view_cancelled = TRUE;
|
||||
+ if (ev_window_is_recent_view (ev_window)) {
|
||||
+ ev_window_clear_load_job (ev_window);
|
||||
+ ev_application_clear_uri (EV_APP);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void
|
||||
ev_window_clear_reload_job (EvWindow *ev_window)
|
||||
{
|
||||
@@ -2395,7 +2410,8 @@ ev_window_open_uri (EvWindow *ev_window,
|
||||
g_strdup (search_string) : NULL;
|
||||
|
||||
if (priv->uri &&
|
||||
- g_ascii_strcasecmp (priv->uri, uri) == 0) {
|
||||
+ g_ascii_strcasecmp (priv->uri, uri) == 0 &&
|
||||
+ !priv->password_view_cancelled) {
|
||||
if (ev_window_check_document_modified (ev_window, EV_WINDOW_ACTION_RELOAD))
|
||||
return;
|
||||
ev_window_reload_document (ev_window, dest);
|
||||
@@ -7643,11 +7659,16 @@ ev_window_init (EvWindow *ev_window)
|
||||
allow_links_change_zoom);
|
||||
ev_view_set_model (EV_VIEW (priv->view), priv->model);
|
||||
|
||||
+ priv->password_view_cancelled = FALSE;
|
||||
priv->password_view = ev_password_view_new (GTK_WINDOW (ev_window));
|
||||
g_signal_connect_swapped (priv->password_view,
|
||||
"unlock",
|
||||
G_CALLBACK (ev_window_password_view_unlock),
|
||||
ev_window);
|
||||
+ g_signal_connect_swapped (priv->password_view,
|
||||
+ "cancelled",
|
||||
+ G_CALLBACK (ev_window_password_view_cancelled),
|
||||
+ ev_window);
|
||||
g_signal_connect_object (priv->view, "focus_in_event",
|
||||
G_CALLBACK (view_actions_focus_in_cb),
|
||||
ev_window, 0);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 9756fdca2efe71738d02792e839862cb5f0a0244 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Tue, 16 Feb 2021 17:15:20 +0100
|
||||
Subject: [PATCH] window: Use tmp dir as containing folder for non-native file
|
||||
|
||||
Show the temporary directory containing the downloaded document
|
||||
as containing folder for documents from remote URIs.
|
||||
|
||||
It fails currently since it can not open remote URIs.
|
||||
---
|
||||
shell/ev-window.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/shell/ev-window.c b/shell/ev-window.c
|
||||
index ba282e18..a1bc55f0 100644
|
||||
--- a/shell/ev-window.c
|
||||
+++ b/shell/ev-window.c
|
||||
@@ -3290,6 +3290,10 @@ ev_window_cmd_open_containing_folder (GSimpleAction *action,
|
||||
|
||||
app = g_app_info_get_default_for_type ("inode/directory", FALSE);
|
||||
file = g_file_new_for_uri (priv->uri);
|
||||
+ if (!g_file_is_native (file)) {
|
||||
+ g_object_unref (file);
|
||||
+ file = g_file_new_for_uri (ev_document_get_uri (priv->document));
|
||||
+ }
|
||||
if (app == NULL) {
|
||||
dzl_file_manager_show (file, &error);
|
||||
if (error) {
|
||||
--
|
||||
2.30.2
|
||||
|
12
evince.spec
12
evince.spec
@ -3,20 +3,16 @@
|
||||
%global __requires_exclude ^(%%(find %{buildroot}%{_libdir}/evince/ -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -))
|
||||
|
||||
Name: evince
|
||||
Version: 40.1
|
||||
Release: 5%{?dist}
|
||||
Version: 40.2
|
||||
Release: 1%{?dist}
|
||||
Summary: Document viewer
|
||||
|
||||
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
|
||||
URL: https://wiki.gnome.org/Apps/Evince
|
||||
Source0: https://download.gnome.org/sources/%{name}/40/%{name}-%{version}.tar.xz
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1927705
|
||||
Patch0: evince-40.1-Show-password-dialog-again.patch
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1975150
|
||||
Patch1: evince-40.1-covscan.patch
|
||||
Patch2: evince-40.1-containing-folder.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: gcc
|
||||
@ -270,6 +266,10 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
|
||||
%{_mandir}/man1/evince-previewer.1*
|
||||
|
||||
%changelog
|
||||
* Tue Jun 29 2021 Marek Kasik <mkasik@redhat.com> - 40.2-1
|
||||
- Update to 40.2
|
||||
- Resolves: #1976711
|
||||
|
||||
* Thu Jun 24 2021 Marek Kasik <mkasik@redhat.com> - 40.1-5
|
||||
- Use tmp dir as containing folder for non-native files
|
||||
- Backport fixes for issues found by Coverity Scan
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (evince-40.1.tar.xz) = c688ee962cfff8b024b572161bae689d25b5b566ac623abeff38b4b8e6e541ce343023ed2c1ba0df1f65d6ec9a631aac3a748c940db556dbb89ab45ac565147d
|
||||
SHA512 (evince-40.2.tar.xz) = f3ee19053a0bc6989a50fc790d1d54747d7aac5cbf0cd1e0eaea6cb743c0ebbbdf2565e88ea995fbba31c7f97e4279f9c0fa44c386bcf635a500033f6105ca9f
|
||||
|
Loading…
Reference in New Issue
Block a user