diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-11-16 13:27:44 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-11-16 13:28:50 (GMT) |
commit | 786629e9bcbb8790973cc8ec083bd9d8be704b8f (patch) | |
tree | 786b6749b20f6661aef360451859b012dc94fac3 /libview/ev-view.c | |
parent | a4bae5a203bdaff80f3001fba17bd2e93bca4ea5 (diff) |
[libview] Handle file attachment annotations
Attachment is opened when annotation is clicked.
Diffstat (limited to 'libview/ev-view.c')
-rw-r--r-- | libview/ev-view.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c index 6417a43..effbd36 100644 --- a/libview/ev-view.c +++ b/libview/ev-view.c @@ -2701,7 +2701,8 @@ static void ev_view_handle_annotation (EvView *view, EvAnnotation *annot, gdouble x, - gdouble y) + gdouble y, + guint32 timestamp) { if (EV_IS_ANNOTATION_MARKUP (annot)) { GtkWidget *window; @@ -2718,6 +2719,24 @@ ev_view_handle_annotation (EvView *view, } } } + + if (EV_IS_ANNOTATION_ATTACHMENT (annot)) { + EvAttachment *attachment = EV_ANNOTATION_ATTACHMENT (annot)->attachment; + + if (attachment) { + GError *error = NULL; + + ev_attachment_open (attachment, + gtk_widget_get_screen (GTK_WIDGET (view)), + timestamp, + &error); + + if (error) { + g_warning ("%s", error->message); + g_error_free (error); + } + } + } } /*** GtkWidget implementation ***/ @@ -3380,7 +3399,7 @@ ev_view_button_press_event (GtkWidget *widget, gtk_widget_queue_draw (widget); } else if ((annot = ev_view_get_annotation_at_location (view, event->x, event->y))) { - ev_view_handle_annotation (view, annot, event->x, event->y); + ev_view_handle_annotation (view, annot, event->x, event->y, event->time); } else if ((field = ev_view_get_form_field_at_location (view, event->x, event->y))) { ev_view_remove_all (view); ev_view_handle_form_field (view, field, event->x, event->y); |