aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-04-14 16:25:43 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-04-14 16:25:43 +0800
commit2864da8135dfd208bb5a4cc3d51cbcc006cf0586 (patch)
tree23112dcd594ec08c62d6ff3f63228fa14dd75891
parent8bdc418acddf276242c2419dfeaa1c9d83262dd6 (diff)
downloadgsoc2013-evolution-2864da8135dfd208bb5a4cc3d51cbcc006cf0586.tar
gsoc2013-evolution-2864da8135dfd208bb5a4cc3d51cbcc006cf0586.tar.gz
gsoc2013-evolution-2864da8135dfd208bb5a4cc3d51cbcc006cf0586.tar.bz2
gsoc2013-evolution-2864da8135dfd208bb5a4cc3d51cbcc006cf0586.tar.lz
gsoc2013-evolution-2864da8135dfd208bb5a4cc3d51cbcc006cf0586.tar.xz
gsoc2013-evolution-2864da8135dfd208bb5a4cc3d51cbcc006cf0586.tar.zst
gsoc2013-evolution-2864da8135dfd208bb5a4cc3d51cbcc006cf0586.zip
** See bug #56149.
2004-04-14 Not Zed <NotZed@Ximian.com> ** See bug #56149. * em-folder-view.c (emfv_edit_cut): similar to below, use focus to determine who we select from. (emfv_edit_copy): ditto. * message-list.c: Remove primary selection stuff. It just annoys. * em-folder-browser.c (emfb_edit_copy): use focus rather than selection owner to determine who to copy from. (emfb_edit_cut): similarly. svn path=/trunk/; revision=25455
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/em-folder-browser.c12
-rw-r--r--mail/em-folder-view.c12
-rw-r--r--mail/message-list.c33
-rw-r--r--mail/message-list.h1
5 files changed, 26 insertions, 44 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 2df893d3c1..044234d450 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,17 @@
2004-04-14 Not Zed <NotZed@Ximian.com>
+ ** See bug #56149.
+
+ * em-folder-view.c (emfv_edit_cut): similar to below, use focus to
+ determine who we select from.
+ (emfv_edit_copy): ditto.
+
+ * message-list.c: Remove primary selection stuff. It just annoys.
+
+ * em-folder-browser.c (emfb_edit_copy): use focus rather than
+ selection owner to determine who to copy from.
+ (emfb_edit_cut): similarly.
+
* em-format.c (emf_multipart_related): hmm, use the right pointer
when iterating the pending uri list.
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index e09277a09a..38eece3e5d 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -489,10 +489,10 @@ emfb_edit_cut(BonoboUIComponent *uid, void *data, const char *path)
if (GTK_WIDGET_HAS_FOCUS(((ESearchBar *)emfb->search)->entry))
gtk_editable_cut_clipboard((GtkEditable *)((ESearchBar *)emfb->search)->entry);
- else if (message_list_has_primary_selection(emfb->view.list))
- message_list_copy(emfb->view.list, TRUE);
- else if (emfb->view.preview_active)
+ else if (GTK_WIDGET_HAS_FOCUS(emfb->view.preview->formathtml.html))
em_format_html_display_cut(emfb->view.preview);
+ else
+ message_list_copy(emfb->view.list, TRUE);
}
static void
@@ -502,10 +502,10 @@ emfb_edit_copy(BonoboUIComponent *uid, void *data, const char *path)
if (GTK_WIDGET_HAS_FOCUS(((ESearchBar *)emfb->search)->entry))
gtk_editable_copy_clipboard((GtkEditable *)((ESearchBar *)emfb->search)->entry);
- else if (message_list_has_primary_selection(emfb->view.list))
- message_list_copy(emfb->view.list, FALSE);
- else if (emfb->view.preview_active)
+ else if (GTK_WIDGET_HAS_FOCUS(emfb->view.preview->formathtml.html))
em_format_html_display_copy(emfb->view.preview);
+ else
+ message_list_copy(emfb->view.list, FALSE);
}
static void
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index f87aee7f8e..83523b0782 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -954,10 +954,10 @@ emfv_edit_cut(BonoboUIComponent *uid, void *data, const char *path)
{
EMFolderView *emfv = data;
- if (message_list_has_primary_selection(emfv->list))
- message_list_copy(emfv->list, TRUE);
- else if (emfv->preview_active)
+ if (GTK_WIDGET_HAS_FOCUS(emfv->preview->formathtml.html))
em_format_html_display_cut(emfv->preview);
+ else
+ message_list_copy(emfv->list, TRUE);
}
static void
@@ -965,10 +965,10 @@ emfv_edit_copy(BonoboUIComponent *uid, void *data, const char *path)
{
EMFolderView *emfv = data;
- if (message_list_has_primary_selection(emfv->list))
- message_list_copy(emfv->list, FALSE);
- else if (emfv->preview_active)
+ if (GTK_WIDGET_HAS_FOCUS(emfv->preview->formathtml.html))
em_format_html_display_copy(emfv->preview);
+ else
+ message_list_copy(emfv->list, FALSE);
}
static void
diff --git a/mail/message-list.c b/mail/message-list.c
index 23248a55ad..645c16933a 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -98,7 +98,6 @@ struct _MLSelection {
struct _MessageListPrivate {
GtkWidget *invisible; /* 4 selection */
- struct _MLSelection primary;
struct _MLSelection clipboard;
};
@@ -734,12 +733,6 @@ message_list_copy(MessageList *ml, gboolean cut)
}
}
-gboolean
-message_list_has_primary_selection(MessageList *ml)
-{
- return ml->priv->primary.uids != NULL;
-}
-
void
message_list_paste(MessageList *ml)
{
@@ -1454,10 +1447,7 @@ ml_selection_get(GtkWidget *widget, GtkSelectionData *data, guint info, guint ti
{
struct _MLSelection *selection;
- if (info & 1)
- selection = &ml->priv->primary;
- else
- selection = &ml->priv->clipboard;
+ selection = &ml->priv->clipboard;
if (selection->uids == NULL)
return;
@@ -1478,10 +1468,7 @@ ml_selection_clear_event(GtkWidget *widget, GdkEventSelection *event, MessageLis
{
struct _MessageListPrivate *p = ml->priv;
- if (event->selection == GDK_SELECTION_PRIMARY)
- clear_selection(ml, &p->primary);
- else if (event->selection == GDK_SELECTION_CLIPBOARD)
- clear_selection(ml, &p->clipboard);
+ clear_selection(ml, &p->clipboard);
}
static void
@@ -1611,9 +1598,7 @@ message_list_init (GtkObject *object)
matom = gdk_atom_intern ("x-uid-list", FALSE);
gtk_selection_add_target(p->invisible, GDK_SELECTION_CLIPBOARD, matom, 0);
- gtk_selection_add_target(p->invisible, GDK_SELECTION_PRIMARY, matom, 1);
gtk_selection_add_target(p->invisible, GDK_SELECTION_CLIPBOARD, GDK_SELECTION_TYPE_STRING, 2);
- gtk_selection_add_target(p->invisible, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 3);
g_signal_connect(p->invisible, "selection_get", G_CALLBACK(ml_selection_get), message_list);
g_signal_connect(p->invisible, "selection_clear_event", G_CALLBACK(ml_selection_clear_event), message_list);
@@ -1708,7 +1693,6 @@ message_list_finalise (GObject *object)
g_free(message_list->folder_uri);
message_list->folder_uri = NULL;
- clear_selection(message_list, &p->primary);
clear_selection(message_list, &p->clipboard);
g_free(p);
@@ -2673,19 +2657,6 @@ on_selection_changed_cmd(ETree *tree, MessageList *ml)
if (!ml->idle_id)
ml->idle_id = g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, ml, NULL);
-
- clear_selection(ml, &ml->priv->primary);
-
- if (uids->len > 0) {
- ml->priv->primary.uids = uids;
- ml->priv->primary.folder = ml->folder;
- camel_object_ref(ml->priv->primary.folder);
- ml->priv->primary.folder_uri = g_strdup(ml->folder_uri);
- gtk_selection_owner_set(ml->priv->invisible, GDK_SELECTION_PRIMARY, gtk_get_current_event_time());
- } else {
- message_list_free_uids(ml, uids);
- gtk_selection_owner_set(NULL, GDK_SELECTION_PRIMARY, gtk_get_current_event_time());
- }
}
static gint
diff --git a/mail/message-list.h b/mail/message-list.h
index 393edb700f..5d88d28692 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -188,7 +188,6 @@ void message_list_invert_selection (MessageList *ml);
/* clipboard stuff */
void message_list_copy(MessageList *ml, gboolean cut);
-gboolean message_list_has_primary_selection(MessageList *ml);
void message_list_paste (MessageList *ml);
/* info */