[evince/gnome-3-10] Don't allow "Send To" when there is no mail client available
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/gnome-3-10] Don't allow "Send To" when there is no mail client available
- Date: Mon, 16 Dec 2013 16:50:51 +0000 (UTC)
commit 1156fddaefd6e9da26f024986382f3505ebfdebe
Author: Marek Kasik <mkasik redhat com>
Date: Mon Dec 16 17:29:15 2013 +0100
Don't allow "Send To" when there is no mail client available
Check for availability of handler of "mailto" scheme and
make "Send To..." menu entry sensitive / insensitive
accordingly during initialization of EvWindow.
Based on patch of Plamena Manolova.
https://bugzilla.gnome.org/show_bug.cgi?id=701654
shell/ev-window.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index a11fe50..3d35d6b 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -234,6 +234,9 @@ struct _EvWindowPrivate {
/* Caret navigation */
GtkWidget *ask_caret_navigation_check;
+
+ /* Send to */
+ gboolean has_mailto_handler;
};
#define EV_WINDOW_GET_PRIVATE(object) \
@@ -465,7 +468,8 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
ev_window_set_action_sensitive (ev_window, "FilePrint", has_pages && ok_to_print);
ev_window_set_action_sensitive (ev_window, "FileProperties", has_document && has_properties);
ev_window_set_action_sensitive (ev_window, "FileOpenContainingFolder", has_document);
- ev_window_set_action_sensitive (ev_window, "FileSendTo", has_document);
+ ev_window_set_action_sensitive (ev_window, "FileSendTo",
+ has_document && ev_window->priv->has_mailto_handler);
ev_window_set_action_sensitive (ev_window, "ViewPresentation", has_document);
/* Edit menu */
@@ -7288,6 +7292,7 @@ ev_window_init (EvWindow *ev_window)
GDBusConnection *connection;
static gint window_id = 0;
#endif
+ GAppInfo *app_info;
g_signal_connect (ev_window, "configure_event",
G_CALLBACK (window_configure_event_cb), NULL);
@@ -7338,6 +7343,10 @@ ev_window_init (EvWindow *ev_window)
G_CALLBACK (activate_link_cb),
ev_window);
+ app_info = g_app_info_get_default_for_uri_scheme ("mailto");
+ ev_window->priv->has_mailto_handler = app_info != NULL;
+ g_clear_object (&app_info);
+
ev_window->priv->main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (ev_window), ev_window->priv->main_box);
gtk_widget_show (ev_window->priv->main_box);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]