[evince/wip/remove-annotations: 3/6] shell: Add RemoveAnnot action to the view popup.



commit c67b1265bb9d4d128d8799d03f3c171244a7a3aa
Author: José Aliste <jaliste gnome org>
Date:   Wed Jun 27 08:58:59 2012 -0400

    shell: Add RemoveAnnot action to the view popup.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=649044

 shell/ev-window.c   |   21 ++++++++++++++++++++-
 shell/evince-ui.xml |    1 +
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 174284a..0bea829 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -344,6 +344,8 @@ static void     ev_view_popup_cmd_save_image_as         (GtkAction        *actio
                                                         EvWindow         *window);
 static void     ev_view_popup_cmd_copy_image            (GtkAction        *action,
                                                         EvWindow         *window);
+static void     ev_view_popup_cmd_remove_annot          (GtkAction        *action,
+                                                         EvWindow         *window);
 static void     ev_view_popup_cmd_annot_properties      (GtkAction        *action,
                                                         EvWindow         *window);
 static void    ev_attachment_popup_cmd_open_attachment (GtkAction        *action,
@@ -5161,6 +5163,13 @@ view_menu_annot_popup (EvWindow     *ev_window,
                                              "AnnotProperties");
        gtk_action_set_visible (action, (annot != NULL && EV_IS_ANNOTATION_MARKUP (annot)));
 
+       action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
+                                             "AnnotRemove");
+       show_annot = ev_document_annotations_can_remove_annotation (EV_DOCUMENT_ANNOTATIONS 
(ev_window->priv->document));
+       
+       gtk_action_set_visible (action, (annot != NULL) && show_annot);
+       show_annot = FALSE;
+
        if (annot && EV_IS_ANNOTATION_ATTACHMENT (annot)) {
                EvAttachment *attachment;
 
@@ -6124,7 +6133,9 @@ static const GtkActionEntry view_popup_entries [] = {
        { "CopyImage", NULL, N_("Copy _Image"), NULL,
          NULL, G_CALLBACK (ev_view_popup_cmd_copy_image) },
        { "AnnotProperties", NULL, N_("Annotation Properties…"), NULL,
-         NULL, G_CALLBACK (ev_view_popup_cmd_annot_properties) }
+         NULL, G_CALLBACK (ev_view_popup_cmd_annot_properties) },
+       { "AnnotRemove", NULL, N_("Remove Annotation"), NULL,
+         NULL, G_CALLBACK (ev_view_popup_cmd_remove_annot) }
 };
 
 static const GtkActionEntry attachment_popup_entries [] = {
@@ -6849,6 +6860,14 @@ ev_view_popup_cmd_copy_image (GtkAction *action, EvWindow *window)
 }
 
 static void
+ev_view_popup_cmd_remove_annot (GtkAction *action,
+                              EvWindow  *window)
+{
+       ev_view_remove_annotation (EV_VIEW (window->priv->view),
+                                  window->priv->annot);
+}
+
+static void
 ev_view_popup_cmd_annot_properties (GtkAction *action,
                                    EvWindow  *window)
 {
diff --git a/shell/evince-ui.xml b/shell/evince-ui.xml
index bf84b4a..15551e0 100644
--- a/shell/evince-ui.xml
+++ b/shell/evince-ui.xml
@@ -70,6 +70,7 @@
     <menuitem name="SaveAttachmentAs" action="SaveAttachmentAs"/>
     <separator/>
     <menuitem name="AnnotProperties" action="AnnotProperties"/>
+    <menuitem name="AnnotRemove" action="AnnotRemove"/>
     <menuitem name="FileOpenContainingFolder" action="FileOpenContainingFolder"/>
   </popup>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]