* src/modest-ui-actions.c:
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 5 Jul 2007 15:43:06 +0000 (15:43 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 5 Jul 2007 15:43:06 +0000 (15:43 +0000)
        * Now we add set_can_store to copy actions, so that the buffer
          survives application end.
        * Removed a typo using a call to header view in clipboard
          handler of text view (removes a runtime warning).
* src/modest-msg-edit-window.c:
        * Register serialize and deserialize target for wp-text-buffer.
          This way we can cut/copy/paste rich text among buffers
          (fixes NB#62365).
        * Now the dimming detection for copy simply detects there's a
          selection available. This way we can properly copy a selection
          with only an image (fixes NB#62416).
* src/modest-main-window.c:
        * Remove rules hint of header view (this way it does not show
          alternate colors for rows, as stated in specs).

pmo-trunk-r2595

src/maemo/modest-main-window.c
src/maemo/modest-msg-edit-window.c
src/modest-ui-actions.c

index da10328..d64d65d 100644 (file)
@@ -893,6 +893,11 @@ modest_main_window_new (void)
        modest_widget_memory_restore (modest_runtime_get_conf (), G_OBJECT(priv->header_view),
                                      MODEST_CONF_HEADER_VIEW_KEY);
 
+       /* Other style properties of header view */
+       g_object_set (G_OBJECT (priv->header_view), 
+                     "rules-hint", FALSE,
+                     NULL);
+
        /* Empty view */ 
        priv->empty_view = create_empty_view ();
                 
index 106295c..7c4934b 100644 (file)
@@ -436,7 +436,9 @@ init_window (ModestMsgEditWindow *obj)
        priv->text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->msg_body));
        g_object_set (priv->text_buffer, "font_scale", 1.0, NULL);
        wp_text_buffer_enable_rich_text (WP_TEXT_BUFFER (priv->text_buffer), TRUE);
-/*     gtk_text_buffer_set_can_paste_rich_text (priv->text_buffer, TRUE); */
+       gtk_text_buffer_register_serialize_tagset(GTK_TEXT_BUFFER(priv->text_buffer), "wp-text-buffer");
+       gtk_text_buffer_register_deserialize_tagset(GTK_TEXT_BUFFER(priv->text_buffer), "wp-text-buffer");
+
        wp_text_buffer_reset_buffer (WP_TEXT_BUFFER (priv->text_buffer), TRUE);
 
        priv->find_toolbar = hildon_find_toolbar_new (NULL);
@@ -626,7 +628,6 @@ set_msg (ModestMsgEditWindow *self, TnyMsg *msg)
 
        update_window_title (self);
 
-/*     gtk_text_buffer_set_can_paste_rich_text (priv->text_buffer, TRUE); */
        wp_text_buffer_reset_buffer (WP_TEXT_BUFFER (priv->text_buffer), TRUE);
        body = modest_tny_msg_get_body (msg, TRUE);
 
@@ -2687,20 +2688,20 @@ modest_msg_edit_window_clipboard_owner_change (GtkClipboard *clipboard,
        ModestWindowPrivate *parent_priv;
        ModestMsgEditWindowPrivate *priv;
        GtkAction *action;
-       gchar *selection;
+       gboolean has_selection;
        GtkWidget *focused;
        GList *selected_attachments = NULL;
        gint n_att_selected = 0;
 
        priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
        parent_priv = MODEST_WINDOW_GET_PRIVATE (window);
-       selection = gtk_clipboard_wait_for_text (clipboard);
+       has_selection = gtk_clipboard_wait_for_targets (clipboard, NULL, NULL);
        focused = gtk_window_get_focus (GTK_WINDOW (window));
 
        action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/EditMenu/CutMenu");
-       gtk_action_set_sensitive (action, (selection != NULL) && (!MODEST_IS_ATTACHMENTS_VIEW (focused)));
+       gtk_action_set_sensitive (action, (has_selection) && (!MODEST_IS_ATTACHMENTS_VIEW (focused)));
        action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/EditMenu/CopyMenu");
-       gtk_action_set_sensitive (action, (selection != NULL) && (!MODEST_IS_ATTACHMENTS_VIEW (focused)));
+       gtk_action_set_sensitive (action, (has_selection) && (!MODEST_IS_ATTACHMENTS_VIEW (focused)));
 
        selected_attachments = modest_attachments_view_get_selection (MODEST_ATTACHMENTS_VIEW (priv->attachments_view));
        n_att_selected = g_list_length (selected_attachments);
@@ -2709,7 +2710,6 @@ modest_msg_edit_window_clipboard_owner_change (GtkClipboard *clipboard,
        action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/AttachmentsMenu/RemoveAttachmentsMenu");
        gtk_action_set_sensitive (action, n_att_selected == 1);
        
-
        update_paste_dimming (window);
 }
 
index ea02866..62494ed 100644 (file)
@@ -2401,6 +2401,7 @@ modest_ui_actions_on_cut (GtkAction *action,
                clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
                buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (focused_widget));
                gtk_text_buffer_cut_clipboard (buffer, clipboard, TRUE);
+               gtk_clipboard_set_can_store (clipboard, NULL, 0);
        } else if (MODEST_IS_HEADER_VIEW (focused_widget)) {
                modest_header_view_cut_selection (MODEST_HEADER_VIEW (focused_widget));
        } else if (MODEST_IS_FOLDER_VIEW (focused_widget)) {
@@ -2426,7 +2427,7 @@ modest_ui_actions_on_copy (GtkAction *action,
                GtkTextBuffer *buffer;
                buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (focused_widget));
                gtk_text_buffer_copy_clipboard (buffer, clipboard);
-               modest_header_view_copy_selection (MODEST_HEADER_VIEW (focused_widget));
+               gtk_clipboard_set_can_store (clipboard, NULL, 0);
        } else if (MODEST_IS_HEADER_VIEW (focused_widget)) {
                TnyList *header_list = modest_header_view_get_selected_headers (MODEST_HEADER_VIEW (focused_widget));
                TnyIterator *iter = tny_list_create_iterator (header_list);