Work for making select all work as expected in
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 14 Jun 2007 10:13:38 +0000 (10:13 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 14 Jun 2007 10:13:38 +0000 (10:13 +0000)
message view (body). Fixes NB#58104.
* src/widgets/modest-msg-view.[ch]:
        * New method ..._grab_focus, that grabs the
          focus on the body.
* src/modest-msg-view-window.c:
        * Use new method modest_msg_view_grab_focus to
          put the default focus instead of just using
          gtk_widget_grab_focus. This should fix the
          default focus when the window is created (that
          should be in the message body).
* src/modest-ui-actions.c:
        * Add an implementation of select all for
          gtkhtml widgets.

pmo-trunk-r2223

src/maemo/modest-msg-view-window.c
src/modest-ui-actions.c
src/widgets/modest-msg-view.c
src/widgets/modest-msg-view.h

index 50d001b..5494a49 100644 (file)
@@ -619,7 +619,7 @@ modest_msg_view_window_new (TnyMsg *msg,
        gtk_window_set_icon (GTK_WINDOW (obj), window_icon);
 
        /* Init the clipboard actions dim status */
-       gtk_widget_grab_focus (priv->msg_view);
+       modest_msg_view_grab_focus(MODEST_MSG_VIEW (priv->msg_view));
 
        update_window_title (MODEST_MSG_VIEW_WINDOW (obj));
 
@@ -1125,7 +1125,7 @@ view_msg_cb (ModestMailOperation *mail_op,
        modest_msg_view_set_message (MODEST_MSG_VIEW (priv->msg_view), msg);
        modest_msg_view_window_update_priority (self);
        update_window_title (MODEST_MSG_VIEW_WINDOW (self));
-       gtk_widget_grab_focus (priv->msg_view);
+       modest_msg_view_grab_focus (MODEST_MSG_VIEW (priv->msg_view));
 }
 
 TnyFolderType
index 38fdd3d..f8035d5 100644 (file)
@@ -73,6 +73,8 @@
 #include <tny-device.h>
 #include <tny-merge-folder.h>
 
+#include <gtkhtml/gtkhtml.h>
+
 typedef struct _GetMsgAsyncHelper {    
        ModestWindow *window;
        ModestMailOperation *mail_op;
@@ -2242,6 +2244,8 @@ modest_ui_actions_on_select_all (GtkAction *action,
                /* Select all messages */
                selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(header_view));
                gtk_tree_selection_select_all (selection);
+       } else if (GTK_IS_HTML (focused_widget)) {
+               gtk_html_select_all (GTK_HTML (focused_widget));
        }
 }
 
index 6c7f40a..b0ab8d3 100644 (file)
@@ -1535,3 +1535,14 @@ modest_msg_view_get_selected_attachments (ModestMsgView *self)
        return modest_attachments_view_get_selection (MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
        
 }
+
+void
+modest_msg_view_grab_focus (ModestMsgView *view)
+{
+       ModestMsgViewPrivate *priv = NULL;
+
+       g_return_if_fail (MODEST_IS_MSG_VIEW (view));
+       priv = MODEST_MSG_VIEW_GET_PRIVATE (view);
+
+       gtk_widget_grab_focus (priv->gtkhtml);
+}
index d5dc11a..29596af 100644 (file)
@@ -134,6 +134,7 @@ gdouble modest_msg_view_get_zoom (ModestMsgView *self);
 TnyHeaderFlags modest_msg_view_get_priority (ModestMsgView *self);
 void modest_msg_view_set_priority (ModestMsgView *self, TnyHeaderFlags flags);
 GList *modest_msg_view_get_selected_attachments (ModestMsgView *self);
+void modest_msg_view_grab_focus (ModestMsgView *self);
 
 
 G_END_DECLS