]> www.fi.muni.cz Git - evince.git/commitdiff
Cleanup and add select all.
authorMarco Pesenti Gritti <marco@gnome.org>
Fri, 7 Jan 2005 10:30:52 +0000 (10:30 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Fri, 7 Jan 2005 10:30:52 +0000 (10:30 +0000)
2005-01-07  Marco Pesenti Gritti  <marco@gnome.org>

        * data/evince-ui.xml:

        Cleanup and add select all.

        * shell/ev-view.c: (ev_view_select_all),
        (ev_view_button_press_event):
        * shell/ev-view.h:
        * shell/ev-window.c: (ev_window_cmd_edit_select_all):

        Add select all.
        Clear selection on click.

ChangeLog
data/evince-ui.xml
shell/ev-view.c
shell/ev-view.h
shell/ev-window.c

index 08647d4176ffb06d718dec6e8c97124e3ebfccf4..a9ec90e602b85ee805523035161a53ea63ba680d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2005-01-07  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * data/evince-ui.xml:
+
+       Cleanup and add select all.
+
+       * shell/ev-view.c: (ev_view_select_all),
+       (ev_view_button_press_event):
+       * shell/ev-view.h:
+       * shell/ev-window.c: (ev_window_cmd_edit_select_all):
+
+       Add select all.
+       Clear selection on click.
+
 Fri Jan  7 01:28:58 2005  Jonathan Blandford  <jrb@redhat.com>
 
        * shell/ev-sidebar-thumbnails.c
index 8452c689235e11701b2e3de26a47878d5fd04b0f..ffeb696bb768f61360869111cb58a46d0ceda19b 100644 (file)
@@ -12,6 +12,9 @@
 
     <menu name="EditMenu" action="Edit">
       <menuitem name="EditCopyMenu" action="EditCopy"/>
+      <separator/>
+      <menuitem name="EditSelectAllMenu" action="EditSelectAll"/>
+      <separator/>
       <menuitem name="EditFindMenu" action="EditFind"/>
     </menu>
 
@@ -19,9 +22,9 @@
       <menuitem name="ViewToolbarMenu" action="ViewToolbar"/>
       <menuitem name="ViewStatusbarMenu" action="ViewStatusbar"/>
       <menuitem name="ViewSidebarMenu" action="ViewSidebar"/>
-      <separator name="ViewSep1"/>
+      <separator/>
       <menuitem name="ViewFullscreenMenu" action="ViewFullscreen"/>
-      <separator name="ViewSep2"/>
+      <separator/>
       <menuitem name="ViewZoomInMenu" action="ViewZoomIn"/>
       <menuitem name="ViewZoomOutMenu" action="ViewZoomOut"/>
       <menuitem name="ViewNormalSizeMenu" action="ViewNormalSize"/>
     <menu name="GoMenu" action="Go">
       <menuitem name="GoBackMenu" action="GoBack"/>
       <menuitem name="GoForwardMenu" action="GoForward"/>
-      <separator name="GoSep1"/>
+      <separator/>
       <menuitem name="GoPageUpMenu" action="GoPageUp"/>
       <menuitem name="GoPageDownMenu" action="GoPageDown"/>
-      <separator name="GoSep2"/>
+      <separator/>
       <menuitem name="GoFirstPageMenu" action="GoFirstPage"/>
       <menuitem name="GoLastPageMenu" action="GoLastPage"/>
     </menu>
index 9936ce1efb251646492a5ae35e7317005662f04c..f878812d852d5c03c5938b21ed11ffccaa38ddc9 100644 (file)
@@ -421,6 +421,21 @@ ev_view_expose_event (GtkWidget      *widget,
        return FALSE;
 }
 
+void
+ev_view_select_all (EvView *ev_view)
+{
+       GtkWidget *widget = GTK_WIDGET (ev_view);
+
+       g_return_if_fail (EV_IS_VIEW (ev_view));
+
+       ev_view->has_selection = TRUE;
+       ev_view->selection.x = ev_view->selection.y = 0;
+       ev_view->selection.width = widget->requisition.width;
+       ev_view->selection.height = widget->requisition.height;
+
+       gtk_widget_queue_draw (widget);
+}
+
 void
 ev_view_copy (EvView *ev_view)
 {
@@ -490,6 +505,11 @@ ev_view_button_press_event (GtkWidget      *widget,
 
        switch (event->button) {
                case 1:
+                       if (view->has_selection) {
+                               view->has_selection = FALSE;
+                               gtk_widget_queue_draw (widget);
+                       }
+
                        view->selection.x = event->x;
                        view->selection.y = event->y;
                        view->selection.width = 0;
index cddd27453d620ddcc44c8dbfe5da25a8da249c0a..c68bf9fe424a89bc3f092ebf69ee87af09629e47 100644 (file)
@@ -37,6 +37,7 @@ typedef struct _EvViewClass  EvViewClass;
 GType          ev_view_get_type        (void) G_GNUC_CONST;
 GtkWidget*     ev_view_new             (void);
 void           ev_view_copy            (EvView     *view);
+void           ev_view_select_all      (EvView     *view);
 void           ev_view_set_document    (EvView     *view,
                                         EvDocument *document);
 void           ev_view_set_page        (EvView     *view,
index e110e1db984484ecef74d025227976997c2d5831..8f01111b89f93d4112674febcb1a19958d39376c 100644 (file)
@@ -583,6 +583,14 @@ find_not_supported_dialog (EvWindow   *ev_window)
        gtk_widget_destroy (dialog);
 }
 
+static void
+ev_window_cmd_edit_select_all (GtkAction *action, EvWindow *ev_window)
+{
+       g_return_if_fail (EV_IS_WINDOW (ev_window));
+
+       ev_view_select_all (EV_VIEW (ev_window->priv->view));
+}
+
 static void
 ev_window_cmd_edit_find (GtkAction *action, EvWindow *ev_window)
 {
@@ -1239,7 +1247,9 @@ static GtkActionEntry entries[] = {
         { "EditCopy", GTK_STOCK_COPY, N_("_Copy"), "<control>C",
           N_("Copy text from the document"),
           G_CALLBACK (ev_window_cmd_edit_copy) },
-        
+       { "EditSelectAll", NULL, N_("Select _All"), "<control>A",
+         N_("Select the entire page"),
+         G_CALLBACK (ev_window_cmd_edit_select_all) }, 
         { "EditFind", GTK_STOCK_FIND, N_("_Find"), "<control>F",
           N_("Find a word or phrase in the document"),
           G_CALLBACK (ev_window_cmd_edit_find) },