...
 
Commits (28)
================
Evince 3.10.3
================
Bug fixes:
* Fix a regression in accessibility code causing the wrong page to
be used when caret navigation is enabled (#711862, Alejandro
Piñeiro)
================
Evince 3.10.2
================
Bug fixes:
* Fix the size of buttons in the toolbar (#709005, Yosef Or
Boczko, Carlos Garcia Campos)
* Fix page size always reported as 0x0 in properties dialog
(#711093, Carlos Garcia Campos)
* Fix a crash in djvu backend due to a double free (#710977, José
Aliste)
* Fix annotation window focus change after creation (#668446,
Nelson Benitez Leon)
* Fix content exposed to assistive technologies when document
changes in EvView (#709375, Joanmarie Diggs)
Translation updates:
* Gil Forcada (ca)
* Gil Forcada (ca@valencia)
* Arash Mousavi (fa)
* Rūdolfs Mazurs (lv)
* Kjartan Maraas (nb)
* Hannie Dumoleyn (nl)
* Miroslav Nikolić (sr@latin)
* Мирослав Николић (sr)
* Theppitak Karoonboonyanan (th)
* Gökhan Gurbetoğlu (tr)
================ ================
Evince 3.10.0 Evince 3.10.0
================ ================
......
...@@ -248,7 +248,6 @@ djvu_document_load (EvDocument *document, ...@@ -248,7 +248,6 @@ djvu_document_load (EvDocument *document,
file = g_build_filename (base, fileinfo.id, NULL); file = g_build_filename (base, fileinfo.id, NULL);
if (!g_file_test (file, G_FILE_TEST_EXISTS)) { if (!g_file_test (file, G_FILE_TEST_EXISTS)) {
missing_files = TRUE; missing_files = TRUE;
g_free (file);
} }
g_free (file); g_free (file);
} }
......
...@@ -795,12 +795,15 @@ pdf_document_get_info (EvDocument *document) ...@@ -795,12 +795,15 @@ pdf_document_get_info (EvDocument *document)
g_free (metadata); g_free (metadata);
} }
info->n_pages = ev_document_get_n_pages (document); info->n_pages = poppler_document_get_n_pages (PDF_DOCUMENT (document)->document);
if (info->n_pages > 0) { if (info->n_pages > 0) {
ev_document_get_page_size (document, 0, PopplerPage *poppler_page;
&(info->paper_width),
&(info->paper_height)); poppler_page = poppler_document_get_page (PDF_DOCUMENT (document)->document, 0);
poppler_page_get_size (poppler_page, &(info->paper_width), &(info->paper_height));
g_object_unref (poppler_page);
// Convert to mm. // Convert to mm.
info->paper_width = info->paper_width / 72.0f * 25.4f; info->paper_width = info->paper_width / 72.0f * 25.4f;
info->paper_height = info->paper_height / 72.0f * 25.4f; info->paper_height = info->paper_height / 72.0f * 25.4f;
......
...@@ -171,16 +171,18 @@ xps_document_get_info (EvDocument *document) ...@@ -171,16 +171,18 @@ xps_document_get_info (EvDocument *document)
EV_DOCUMENT_INFO_PAPER_SIZE; EV_DOCUMENT_INFO_PAPER_SIZE;
if (gxps_document_get_n_pages (xps->doc) > 0) { info->n_pages = gxps_document_get_n_pages (xps->doc);
ev_document_get_page_size (document, 0, if (info->n_pages > 0) {
&(info->paper_width), GXPSPage *gxps_page;
&(info->paper_height));
gxps_page = gxps_document_get_page (xps->doc, 0, NULL);
gxps_page_get_size (gxps_page, &(info->paper_width), &(info->paper_height));
g_object_unref (gxps_page);
info->paper_width = info->paper_width / 96.0f * 25.4f; info->paper_width = info->paper_width / 96.0f * 25.4f;
info->paper_height = info->paper_height / 96.0f * 25.4f; info->paper_height = info->paper_height / 96.0f * 25.4f;
} }
info->n_pages = gxps_document_get_n_pages (xps->doc);
return info; return info;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
m4_define([ev_major_version],[3]) m4_define([ev_major_version],[3])
m4_define([ev_minor_version],[10]) m4_define([ev_minor_version],[10])
m4_define([ev_micro_version],[0]) m4_define([ev_micro_version],[3])
m4_define([ev_extra_version],[]) m4_define([ev_extra_version],[])
m4_define([ev_version],[ev_major_version.ev_minor_version.ev_micro_version()ev_extra_version]) m4_define([ev_version],[ev_major_version.ev_minor_version.ev_micro_version()ev_extra_version])
......
...@@ -258,14 +258,14 @@ ev_annotation_window_set_resize_cursor (GtkWidget *widget, ...@@ -258,14 +258,14 @@ ev_annotation_window_set_resize_cursor (GtkWidget *widget,
} }
} }
static gboolean static void
text_view_button_press (GtkWidget *widget, text_view_state_flags_changed (GtkWidget *widget,
GdkEventButton *event, GtkStateFlags previous_flags)
EvAnnotationWindow *window)
{ {
ev_annotation_window_grab_focus (window); GtkStateFlags current_flags = gtk_widget_get_state_flags (widget);
return FALSE; if (current_flags & GTK_STATE_FLAG_BACKDROP)
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (widget), FALSE);
} }
static void static void
...@@ -317,8 +317,8 @@ ev_annotation_window_init (EvAnnotationWindow *window) ...@@ -317,8 +317,8 @@ ev_annotation_window_init (EvAnnotationWindow *window)
swindow = gtk_scrolled_window_new (NULL, NULL); swindow = gtk_scrolled_window_new (NULL, NULL);
window->text_view = gtk_text_view_new (); window->text_view = gtk_text_view_new ();
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (window->text_view), GTK_WRAP_WORD); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (window->text_view), GTK_WRAP_WORD);
g_signal_connect (window->text_view, "button_press_event", g_signal_connect (window->text_view, "state-flags-changed",
G_CALLBACK (text_view_button_press), G_CALLBACK (text_view_state_flags_changed),
window); window);
gtk_container_add (GTK_CONTAINER (swindow), window->text_view); gtk_container_add (GTK_CONTAINER (swindow), window->text_view);
gtk_widget_show (window->text_view); gtk_widget_show (window->text_view);
...@@ -492,6 +492,10 @@ ev_annotation_window_focus_in_event (GtkWidget *widget, ...@@ -492,6 +492,10 @@ ev_annotation_window_focus_in_event (GtkWidget *widget,
window->in_move = FALSE; window->in_move = FALSE;
} }
gtk_widget_grab_focus (window->text_view);
send_focus_change (window->text_view, TRUE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (window->text_view), TRUE);
return FALSE; return FALSE;
} }
......
...@@ -67,6 +67,8 @@ struct _EvViewAccessiblePrivate { ...@@ -67,6 +67,8 @@ struct _EvViewAccessiblePrivate {
/* AtkHypertext */ /* AtkHypertext */
GHashTable *links; GHashTable *links;
gint previous_cursor_page;
}; };
G_DEFINE_TYPE_WITH_CODE (EvViewAccessible, ev_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE, G_DEFINE_TYPE_WITH_CODE (EvViewAccessible, ev_view_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
...@@ -75,6 +77,12 @@ G_DEFINE_TYPE_WITH_CODE (EvViewAccessible, ev_view_accessible, GTK_TYPE_CONTAINE ...@@ -75,6 +77,12 @@ G_DEFINE_TYPE_WITH_CODE (EvViewAccessible, ev_view_accessible, GTK_TYPE_CONTAINE
G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERTEXT, ev_view_accessible_hypertext_iface_init) G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERTEXT, ev_view_accessible_hypertext_iface_init)
) )
static gint
get_relevant_page (EvView *view)
{
return ev_view_is_caret_navigation_enabled (view) ? view->cursor_page : view->current_page;
}
static void static void
clear_cache (EvViewAccessible *accessible) clear_cache (EvViewAccessible *accessible)
{ {
...@@ -152,7 +160,7 @@ ev_view_accessible_get_text_buffer (EvViewAccessible *accessible, EvView *view) ...@@ -152,7 +160,7 @@ ev_view_accessible_get_text_buffer (EvViewAccessible *accessible, EvView *view)
} }
priv->buffer = gtk_text_buffer_new (NULL); priv->buffer = gtk_text_buffer_new (NULL);
retval = ev_page_cache_get_text (page_cache, view->current_page); retval = ev_page_cache_get_text (page_cache, get_relevant_page (view));
if (retval) if (retval)
gtk_text_buffer_set_text (priv->buffer, retval, -1); gtk_text_buffer_set_text (priv->buffer, retval, -1);
...@@ -325,12 +333,8 @@ ev_view_accessible_get_caret_offset (AtkText *text) ...@@ -325,12 +333,8 @@ ev_view_accessible_get_caret_offset (AtkText *text)
view = EV_VIEW (widget); view = EV_VIEW (widget);
if (view->caret_enabled) { if (view->caret_enabled)
if (view->cursor_page == view->current_page) return view->cursor_offset;
return view->cursor_offset;
else
return -1;
}
buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget)); buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget));
if (!buffer) if (!buffer)
...@@ -477,11 +481,11 @@ ev_view_accessible_get_run_attributes (AtkText *text, ...@@ -477,11 +481,11 @@ ev_view_accessible_get_run_attributes (AtkText *text,
if (!view->page_cache) if (!view->page_cache)
return NULL; return NULL;
page_text = ev_page_cache_get_text (view->page_cache, view->current_page); page_text = ev_page_cache_get_text (view->page_cache, get_relevant_page (view));
if (!page_text) if (!page_text)
return NULL; return NULL;
attrs = ev_page_cache_get_text_attrs (view->page_cache, view->current_page); attrs = ev_page_cache_get_text_attrs (view->page_cache, get_relevant_page (view));
if (!attrs) if (!attrs)
return NULL; return NULL;
...@@ -526,12 +530,12 @@ ev_view_accessible_get_character_extents (AtkText *text, ...@@ -526,12 +530,12 @@ ev_view_accessible_get_character_extents (AtkText *text,
if (!view->page_cache) if (!view->page_cache)
return; return;
ev_page_cache_get_text_layout (view->page_cache, view->current_page, &areas, &n_areas); ev_page_cache_get_text_layout (view->page_cache, get_relevant_page (view), &areas, &n_areas);
if (!areas || offset >= n_areas) if (!areas || offset >= n_areas)
return; return;
doc_rect = areas + offset; doc_rect = areas + offset;
_ev_view_transform_doc_rect_to_view_rect (view, view->current_page, doc_rect, &view_rect); _ev_view_transform_doc_rect_to_view_rect (view, get_relevant_page (view), doc_rect, &view_rect);
view_rect.x -= view->scroll_x; view_rect.x -= view->scroll_x;
view_rect.y -= view->scroll_y; view_rect.y -= view->scroll_y;
...@@ -582,7 +586,7 @@ ev_view_accessible_get_offset_at_point (AtkText *text, ...@@ -582,7 +586,7 @@ ev_view_accessible_get_offset_at_point (AtkText *text,
if (!view->page_cache) if (!view->page_cache)
return -1; return -1;
ev_page_cache_get_text_layout (view->page_cache, view->current_page, &areas, &n_areas); ev_page_cache_get_text_layout (view->page_cache, get_relevant_page (view), &areas, &n_areas);
if (!areas) if (!areas)
return -1; return -1;
...@@ -601,7 +605,7 @@ ev_view_accessible_get_offset_at_point (AtkText *text, ...@@ -601,7 +605,7 @@ ev_view_accessible_get_offset_at_point (AtkText *text,
view_point.y -= y_window; view_point.y -= y_window;
} }
ev_view_get_page_extents (view, view->current_page, &page_area, &border); ev_view_get_page_extents (view, get_relevant_page (view), &page_area, &border);
_ev_view_transform_view_point_to_doc_point (view, &view_point, &page_area, &doc_x, &doc_y); _ev_view_transform_view_point_to_doc_point (view, &view_point, &page_area, &doc_x, &doc_y);
for (i = 0; i < n_areas; i++) { for (i = 0; i < n_areas; i++) {
...@@ -700,7 +704,7 @@ ev_view_accessible_get_selection (AtkText *text, ...@@ -700,7 +704,7 @@ ev_view_accessible_get_selection (AtkText *text,
EvViewSelection *selection = (EvViewSelection *)l->data; EvViewSelection *selection = (EvViewSelection *)l->data;
gint start, end; gint start, end;
if (selection->page != view->current_page) if (selection->page != get_relevant_page (view))
continue; continue;
if (get_selection_bounds (view, selection, &start, &end) && start != end) { if (get_selection_bounds (view, selection, &start, &end) && start != end) {
...@@ -1016,7 +1020,7 @@ ev_view_accessible_get_link (AtkHypertext *hypertext, ...@@ -1016,7 +1020,7 @@ ev_view_accessible_get_link (AtkHypertext *hypertext,
if (atk_link) if (atk_link)
return atk_hyperlink_impl_get_hyperlink (ATK_HYPERLINK_IMPL (atk_link)); return atk_hyperlink_impl_get_hyperlink (ATK_HYPERLINK_IMPL (atk_link));
link_mapping = ev_page_cache_get_link_mapping (view->page_cache, view->current_page); link_mapping = ev_page_cache_get_link_mapping (view->page_cache, get_relevant_page (view));
if (!link_mapping) if (!link_mapping)
return NULL; return NULL;
...@@ -1049,7 +1053,7 @@ ev_view_accessible_get_n_links (AtkHypertext *hypertext) ...@@ -1049,7 +1053,7 @@ ev_view_accessible_get_n_links (AtkHypertext *hypertext)
if (!EV_IS_DOCUMENT_LINKS (view->document)) if (!EV_IS_DOCUMENT_LINKS (view->document))
return 0; return 0;
link_mapping = ev_page_cache_get_link_mapping (view->page_cache, view->current_page); link_mapping = ev_page_cache_get_link_mapping (view->page_cache, get_relevant_page (view));
return link_mapping ? ev_mapping_list_length (link_mapping) : 0; return link_mapping ? ev_mapping_list_length (link_mapping) : 0;
} }
...@@ -1089,6 +1093,13 @@ ev_view_accessible_cursor_moved (EvView *view, ...@@ -1089,6 +1093,13 @@ ev_view_accessible_cursor_moved (EvView *view,
gint offset, gint offset,
EvViewAccessible *accessible) EvViewAccessible *accessible)
{ {
EvViewAccessiblePrivate* priv = accessible->priv;
if (priv->previous_cursor_page != page) {
priv->previous_cursor_page = page;
clear_cache (accessible);
}
g_signal_emit_by_name (accessible, "text-caret-moved", offset); g_signal_emit_by_name (accessible, "text-caret-moved", offset);
} }
...@@ -1113,6 +1124,11 @@ document_changed_cb (EvDocumentModel *model, ...@@ -1113,6 +1124,11 @@ document_changed_cb (EvDocumentModel *model,
GParamSpec *pspec, GParamSpec *pspec,
EvViewAccessible *accessible) EvViewAccessible *accessible)
{ {
EvDocument *document = ev_document_model_get_document (model);
if (document == NULL)
return;
clear_cache (accessible); clear_cache (accessible);
} }
...@@ -1132,6 +1148,7 @@ ev_view_accessible_set_model (EvViewAccessible *accessible, ...@@ -1132,6 +1148,7 @@ ev_view_accessible_set_model (EvViewAccessible *accessible,
priv->model = g_object_ref (model); priv->model = g_object_ref (model);
document_changed_cb (model, NULL, accessible);
g_signal_connect (priv->model, "page-changed", g_signal_connect (priv->model, "page-changed",
G_CALLBACK (page_changed_cb), G_CALLBACK (page_changed_cb),
accessible); accessible);
......
...@@ -29,6 +29,7 @@ fa ...@@ -29,6 +29,7 @@ fa
fi fi
fr fr
ga ga
gd
gl gl
gu gu
he he
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -15,8 +15,8 @@ msgstr "" ...@@ -15,8 +15,8 @@ msgstr ""
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=evince&keywords=I18N+L10N&component=general\n" "product=evince&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2013-09-17 16:11+0000\n" "POT-Creation-Date: 2013-09-17 16:11+0000\n"
"PO-Revision-Date: 2013-09-18 20:19+0300\n" "PO-Revision-Date: 2014-02-05 01:32+0200\n"
"Last-Translator: Jiri Grönroos <jiri.gronroos+l10n@iki.fi>\n" "Last-Translator: Timo Jyrinki <timo.jyrinki@iki.fi>\n"
"Language-Team: suomi <gnome-fi-laatu@lists.sourceforge.net>\n" "Language-Team: suomi <gnome-fi-laatu@lists.sourceforge.net>\n"
"Language: fi\n" "Language: fi\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
...@@ -163,7 +163,7 @@ msgstr "" ...@@ -163,7 +163,7 @@ msgstr ""
#: ../backend/pdf/ev-poppler.cc:1088 #: ../backend/pdf/ev-poppler.cc:1088
msgid "All fonts are either standard or embedded." msgid "All fonts are either standard or embedded."
msgstr "Kaikki kirjasimat ovat joko vakioita ta upotettuja." msgstr "Kaikki kirjasimet ovat joko vakioita tai upotettuja."
#: ../backend/pdf/ev-poppler.cc:1120 #: ../backend/pdf/ev-poppler.cc:1120
msgid "No name" msgid "No name"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -189,18 +189,6 @@ button_pressed (GtkWidget *button, ...@@ -189,18 +189,6 @@ button_pressed (GtkWidget *button,
return GDK_EVENT_PROPAGATE; return GDK_EVENT_PROPAGATE;
} }
static gint
get_icon_margin (EvHistoryActionWidget *history_widget)
{
gint toolbar_size_px, menu_size_px;
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (history_widget));
gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &menu_size_px, NULL);
gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_LARGE_TOOLBAR, &toolbar_size_px, NULL);
return (gint)floor ((toolbar_size_px - menu_size_px) / 2.0);
}
static GtkWidget * static GtkWidget *
ev_history_action_widget_create_button (EvHistoryActionWidget *history_widget, ev_history_action_widget_create_button (EvHistoryActionWidget *history_widget,
EvHistoryActionButton action_button) EvHistoryActionButton action_button)
...@@ -214,6 +202,7 @@ ev_history_action_widget_create_button (EvHistoryActionWidget *history_widget, ...@@ -214,6 +202,7 @@ ev_history_action_widget_create_button (EvHistoryActionWidget *history_widget,
rtl = (gtk_widget_get_direction (GTK_WIDGET (history_widget)) == GTK_TEXT_DIR_RTL); rtl = (gtk_widget_get_direction (GTK_WIDGET (history_widget)) == GTK_TEXT_DIR_RTL);
button = gtk_button_new (); button = gtk_button_new ();
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
g_signal_connect (button, "clicked", g_signal_connect (button, "clicked",
G_CALLBACK (button_clicked), G_CALLBACK (button_clicked),
history_widget); history_widget);
...@@ -233,7 +222,6 @@ ev_history_action_widget_create_button (EvHistoryActionWidget *history_widget, ...@@ -233,7 +222,6 @@ ev_history_action_widget_create_button (EvHistoryActionWidget *history_widget,
} }
image = gtk_image_new (); image = gtk_image_new ();
g_object_set (image, "margin", get_icon_margin (history_widget), NULL);
gtk_button_set_image (GTK_BUTTON (button), image); gtk_button_set_image (GTK_BUTTON (button), image);
gtk_image_set_from_icon_name (GTK_IMAGE (image), icon_name, GTK_ICON_SIZE_MENU); gtk_image_set_from_icon_name (GTK_IMAGE (image), icon_name, GTK_ICON_SIZE_MENU);
gtk_widget_set_tooltip_text (button, tooltip_text); gtk_widget_set_tooltip_text (button, tooltip_text);
......
...@@ -61,32 +61,6 @@ ev_toolbar_set_property (GObject *object, ...@@ -61,32 +61,6 @@ ev_toolbar_set_property (GObject *object,
} }
} }
static gint
get_icon_margin (EvToolbar *ev_toolbar)
{
GtkIconSize toolbar_size;
gint toolbar_size_px, menu_size_px;
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (ev_toolbar));
toolbar_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (ev_toolbar));
gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &menu_size_px, NULL);
gtk_icon_size_lookup_for_settings (settings, toolbar_size, &toolbar_size_px, NULL);
return (gint)floor ((toolbar_size_px - menu_size_px) / 2.0);
}
static void
ev_toolbar_set_button_image (EvToolbar *ev_toolbar,
GtkButton *button)
{
GtkWidget *image;
image = gtk_image_new ();
g_object_set (image, "margin", get_icon_margin (ev_toolbar), NULL);
gtk_button_set_image (button, image);
}
static void static void
ev_toolbar_set_button_action (EvToolbar *ev_toolbar, ev_toolbar_set_button_action (EvToolbar *ev_toolbar,
GtkButton *button, GtkButton *button,
...@@ -104,7 +78,8 @@ ev_toolbar_create_button (EvToolbar *ev_toolbar, ...@@ -104,7 +78,8 @@ ev_toolbar_create_button (EvToolbar *ev_toolbar,
{ {
GtkWidget *button = gtk_button_new (); GtkWidget *button = gtk_button_new ();
ev_toolbar_set_button_image (ev_toolbar, GTK_BUTTON (button)); gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action); ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
return button; return button;
...@@ -116,7 +91,8 @@ ev_toolbar_create_toggle_button (EvToolbar *ev_toolbar, ...@@ -116,7 +91,8 @@ ev_toolbar_create_toggle_button (EvToolbar *ev_toolbar,
{ {
GtkWidget *button = gtk_toggle_button_new (); GtkWidget *button = gtk_toggle_button_new ();
ev_toolbar_set_button_image (ev_toolbar, GTK_BUTTON (button)); gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action); ev_toolbar_set_button_action (ev_toolbar, GTK_BUTTON (button), action);
return button; return button;
...@@ -130,7 +106,8 @@ ev_toolbar_create_menu_button (EvToolbar *ev_toolbar, ...@@ -130,7 +106,8 @@ ev_toolbar_create_menu_button (EvToolbar *ev_toolbar,
{ {
GtkWidget *button = gtk_menu_button_new (); GtkWidget *button = gtk_menu_button_new ();
ev_toolbar_set_button_image (ev_toolbar, GTK_BUTTON (button)); gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new ());
gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON (button))), gtk_image_set_from_icon_name (GTK_IMAGE (gtk_button_get_image (GTK_BUTTON (button))),
icon_name, GTK_ICON_SIZE_MENU); icon_name, GTK_ICON_SIZE_MENU);
gtk_widget_set_halign (menu, menu_align); gtk_widget_set_halign (menu, menu_align);
......
...@@ -234,6 +234,9 @@ struct _EvWindowPrivate { ...@@ -234,6 +234,9 @@ struct _EvWindowPrivate {
/* Caret navigation */ /* Caret navigation */
GtkWidget *ask_caret_navigation_check; GtkWidget *ask_caret_navigation_check;
/* Send to */
gboolean has_mailto_handler;
}; };
#define EV_WINDOW_GET_PRIVATE(object) \ #define EV_WINDOW_GET_PRIVATE(object) \
...@@ -465,7 +468,8 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) ...@@ -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, "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, "FileProperties", has_document && has_properties);
ev_window_set_action_sensitive (ev_window, "FileOpenContainingFolder", has_document); 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); ev_window_set_action_sensitive (ev_window, "ViewPresentation", has_document);
/* Edit menu */ /* Edit menu */
...@@ -7288,6 +7292,7 @@ ev_window_init (EvWindow *ev_window) ...@@ -7288,6 +7292,7 @@ ev_window_init (EvWindow *ev_window)
GDBusConnection *connection; GDBusConnection *connection;
static gint window_id = 0; static gint window_id = 0;
#endif #endif
GAppInfo *app_info;
g_signal_connect (ev_window, "configure_event", g_signal_connect (ev_window, "configure_event",
G_CALLBACK (window_configure_event_cb), NULL); G_CALLBACK (window_configure_event_cb), NULL);
...@@ -7338,6 +7343,10 @@ ev_window_init (EvWindow *ev_window) ...@@ -7338,6 +7343,10 @@ ev_window_init (EvWindow *ev_window)
G_CALLBACK (activate_link_cb), G_CALLBACK (activate_link_cb),
ev_window); 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); 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_container_add (GTK_CONTAINER (ev_window), ev_window->priv->main_box);
gtk_widget_show (ev_window->priv->main_box); gtk_widget_show (ev_window->priv->main_box);
......