[Goodies-commits] r4027 - xfce4-dict-plugin/trunk/panel-plugin

Enrico Troeger enrico at xfce.org
Sat Mar 8 17:10:02 CET 2008


Author: enrico
Date: 2008-03-08 16:10:02 +0000 (Sat, 08 Mar 2008)
New Revision: 4027

Modified:
   xfce4-dict-plugin/trunk/panel-plugin/dict.c
Log:
When dragging text into the main entry text field, delete the previous text before to not append the dragged text.


Modified: xfce4-dict-plugin/trunk/panel-plugin/dict.c
===================================================================
--- xfce4-dict-plugin/trunk/panel-plugin/dict.c	2008-03-08 15:06:16 UTC (rev 4026)
+++ xfce4-dict-plugin/trunk/panel-plugin/dict.c	2008-03-08 16:10:02 UTC (rev 4027)
@@ -1532,12 +1532,17 @@
 {
 	if ((data->length >= 0) && (data->format == 8))
 	{
-		if (drag_context->action == GDK_ACTION_ASK)
+		drag_context->action = GDK_ACTION_COPY;
+
+		if (widget == dd->main_entry)
 		{
-			drag_context->action = GDK_ACTION_COPY;
+			gtk_entry_set_text(GTK_ENTRY(dd->main_entry), "");
 		}
-		gtk_entry_set_text(GTK_ENTRY(dd->main_entry), (const gchar*) data->data);
-		dict_search_word(dd, (const gchar*) data->data);
+		else
+		{
+			gtk_entry_set_text(GTK_ENTRY(dd->main_entry), (const gchar*) data->data);
+			dict_search_word(dd, (const gchar*) data->data);
+		}
 		gtk_drag_finish(drag_context, TRUE, FALSE, ltime);
 	}
 }
@@ -1652,6 +1657,7 @@
     gtk_drag_dest_set(GTK_WIDGET(dd->panel_button), GTK_DEST_DEFAULT_ALL,
 		copy_dest_types, G_N_ELEMENTS(copy_dest_types), GDK_ACTION_COPY);
     g_signal_connect(dd->panel_button, "drag-data-received", G_CALLBACK(dict_drag_data_received), dd);
+    g_signal_connect(dd->main_entry, "drag-data-received", G_CALLBACK(dict_drag_data_received), dd);
     g_signal_connect(dd->panel_entry, "drag-data-received", G_CALLBACK(dict_drag_data_received), dd);
 
 	dict_status_add(dd, _("Ready."));




More information about the Goodies-commits mailing list