From 4fc9b355075c0298b0306f43e5b73d136dcdf939 Mon Sep 17 00:00:00 2001 From: Giselle Machado Date: Sun, 22 Jun 2014 18:39:58 +0200 Subject: Refreshing annotations' sidebar upon deletion When an annotation is deleted, the sidebar needs to be refreshed so that the annotation is removed from the list See item 3 in this comment: https://bugzilla.gnome.org/show_bug.cgi?id=649044#c33 origin commit: https://git.gnome.org/browse/evince/commit/?id=13defb2 --- shell/ev-sidebar-annotations.c | 6 ++++++ shell/ev-sidebar-annotations.h | 9 +++++---- shell/ev-window.c | 11 +++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/ev-sidebar-annotations.c b/shell/ev-sidebar-annotations.c index 6cb98fef..ee605005 100644 --- a/shell/ev-sidebar-annotations.c +++ b/shell/ev-sidebar-annotations.c @@ -303,6 +303,12 @@ ev_sidebar_annotations_annot_added (EvSidebarAnnotations *sidebar_annots, ev_sidebar_annotations_load (sidebar_annots); } +void +ev_sidebar_annotations_annot_removed (EvSidebarAnnotations *sidebar_annots) +{ + ev_sidebar_annotations_load (sidebar_annots); +} + static void selection_changed_cb (GtkTreeSelection *selection, EvSidebarAnnotations *sidebar_annots) diff --git a/shell/ev-sidebar-annotations.h b/shell/ev-sidebar-annotations.h index 9aa7181c..db80983f 100644 --- a/shell/ev-sidebar-annotations.h +++ b/shell/ev-sidebar-annotations.h @@ -53,10 +53,11 @@ struct _EvSidebarAnnotationsClass { void (* annot_add_cancelled) (EvSidebarAnnotations *sidebar_annots); }; -GType ev_sidebar_annotations_get_type (void) G_GNUC_CONST; -GtkWidget *ev_sidebar_annotations_new (void); -void ev_sidebar_annotations_annot_added (EvSidebarAnnotations *sidebar_annots, - EvAnnotation *annot); +GType ev_sidebar_annotations_get_type (void) G_GNUC_CONST; +GtkWidget *ev_sidebar_annotations_new (void); +void ev_sidebar_annotations_annot_added (EvSidebarAnnotations *sidebar_annots, + EvAnnotation *annot); +void ev_sidebar_annotations_annot_removed (EvSidebarAnnotations *sidebar_annots); G_END_DECLS #endif /* __EV_SIDEBAR_ANNOTATIONS_H__ */ diff --git a/shell/ev-window.c b/shell/ev-window.c index 13870211..ecdc86bf 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -6441,6 +6441,14 @@ view_annot_added (EvView *view, annot); } +static void +view_annot_removed (EvView *view, + EvAnnotation *annot, + EvWindow *window) +{ + ev_sidebar_annotations_annot_removed (EV_SIDEBAR_ANNOTATIONS (window->priv->sidebar_annots)); +} + static void sidebar_annots_annot_add_cancelled (EvSidebarAnnotations *sidebar_annots, EvWindow *window) @@ -7870,6 +7878,9 @@ ev_window_init (EvWindow *ev_window) g_signal_connect_object (ev_window->priv->view, "annot-added", G_CALLBACK (view_annot_added), ev_window, 0); + g_signal_connect_object (ev_window->priv->view, "annot-removed", + G_CALLBACK (view_annot_removed), + ev_window, 0); g_signal_connect_object (ev_window->priv->view, "layers-changed", G_CALLBACK (view_layers_changed_cb), ev_window, 0); -- cgit v1.2.1