From 94945a4ee31acfc11dbd1aedf0514ca833c708ee Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 9 Jul 2007 13:25:42 +0000 Subject: [PATCH] * src/modest-ui-actions.c: * Now we really copy from GtkHTML widgets (this widget was not considered in _on_copy) (fixes NB#61491). * src/modest-msg-edit-window.c: * Now we update the dimming status of "paste" only on showing edit menu. pmo-trunk-r2649 --- src/maemo/modest-msg-edit-window.c | 23 +---------------------- src/modest-ui-actions.c | 2 ++ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index 23455fb..2331b8c 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -127,9 +127,6 @@ static void modest_msg_edit_window_show_toolbar (ModestWindow *window, static void modest_msg_edit_window_clipboard_owner_change (GtkClipboard *clipboard, GdkEvent *event, ModestMsgEditWindow *window); -static void modest_msg_edit_window_system_clipboard_owner_change (GtkClipboard *clipboard, - GdkEvent *event, - ModestMsgEditWindow *window); static void update_window_title (ModestMsgEditWindow *window); static void update_dimmed (ModestMsgEditWindow *window); static void update_paste_dimming (ModestMsgEditWindow *window); @@ -209,7 +206,6 @@ struct _ModestMsgEditWindowPrivate { gdouble zoom_level; gulong clipboard_change_handler_id; - gulong system_clipboard_change_handler_id; TnyMsg *draft_msg; gboolean sent; @@ -315,7 +311,6 @@ modest_msg_edit_window_init (ModestMsgEditWindow *obj) priv->draft_msg = NULL; priv->clipboard_change_handler_id = 0; - priv->system_clipboard_change_handler_id = 0; priv->sent = FALSE; } @@ -520,8 +515,6 @@ init_window (ModestMsgEditWindow *obj) priv->clipboard_change_handler_id = g_signal_connect (G_OBJECT (gtk_clipboard_get (GDK_SELECTION_PRIMARY)), "owner-change", G_CALLBACK (modest_msg_edit_window_clipboard_owner_change), obj); - priv->system_clipboard_change_handler_id = g_signal_connect (G_OBJECT (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD)), "owner-change", - G_CALLBACK (modest_msg_edit_window_system_clipboard_owner_change), obj); } @@ -536,12 +529,6 @@ modest_msg_edit_window_finalize (GObject *obj) priv->clipboard_change_handler_id = 0; } - if (priv->system_clipboard_change_handler_id > 0) { - g_signal_handler_disconnect (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), - priv->system_clipboard_change_handler_id); - priv->system_clipboard_change_handler_id = 0; - } - if (priv->draft_msg != NULL) { TnyHeader *header = tny_msg_get_header (priv->draft_msg); if (TNY_IS_HEADER (header)) { @@ -2885,15 +2872,6 @@ update_paste_dimming (ModestMsgEditWindow *window) } - -static void -modest_msg_edit_window_system_clipboard_owner_change (GtkClipboard *clipboard, - GdkEvent *event, - ModestMsgEditWindow *window) -{ - update_paste_dimming (window); -} - static void update_select_all_dimming (ModestMsgEditWindow *window) { @@ -2938,6 +2916,7 @@ edit_menu_activated (GtkAction *action, ModestMsgEditWindow *window = MODEST_MSG_EDIT_WINDOW (userdata); update_select_all_dimming (window); + update_paste_dimming (window); } static void view_menu_activated (GtkAction *action, diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index da20571..b7310f4 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -2584,6 +2584,8 @@ modest_ui_actions_on_copy (GtkAction *action, gtk_clipboard_set_text (clipboard, gtk_label_get_text (GTK_LABEL (focused_widget)), -1); } else if (GTK_IS_EDITABLE (focused_widget)) { gtk_editable_copy_clipboard (GTK_EDITABLE(focused_widget)); + } else if (GTK_IS_HTML (focused_widget)) { + gtk_html_copy (GTK_HTML (focused_widget)); } else if (GTK_IS_TEXT_VIEW (focused_widget)) { GtkTextBuffer *buffer; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (focused_widget)); -- 1.7.9.5