ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/src status.c,1.9,1.10


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src status.c,1.9,1.10
Date: Thu, 02 Jan 2003 01:48:21 -0500

Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv27858/src

Modified Files:
        status.c 
Log Message:
dnd improvements


Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- status.c    1 Jan 2003 17:32:43 -0000       1.9
+++ status.c    2 Jan 2003 06:48:19 -0000       1.10
@@ -67,31 +67,6 @@
 
 static GtkTooltips * status_tips=NULL;
 
-
-/* Related to drag & drop so not killed */
-/*
-static GtkTargetEntry contact_list_drop_types[] =
-{
-       { "STRING",     0, TARGET_STRING },
-       { "text/plain", 0, TARGET_STRING },
-       { "text/uri-list", 0, TARGET_URL },
-       { "application/x-rootwin-drop", 0, TARGET_ROOTWIN }
-};
- 
-static gint n_contact_list_drop_types=
-  sizeof(contact_list_drop_types)/sizeof(contact_list_drop_types[0]);
-*/
-/*
-static GtkTargetEntry account_list_drop_types[] =
-{
-//     { "application/x-eb-account", 0, EB_ACCOUNT }
-};
-
-static gint n_account_list_drop_types=
-  sizeof(account_list_drop_types)/sizeof(account_list_drop_types[0]);
-*/
-
-
 GtkWidget *statuswindow = NULL;
 GtkWidget *away_menu;
 
@@ -754,6 +729,43 @@
 static GdkPixmap * iconlogoff_pm = NULL;
 static GdkBitmap * iconlogoff_bm = NULL;
 
+GtkTargetEntry drag_types[1] =
+{
+       {"text/plain", GTK_TARGET_SAME_APP, 0}
+};
+
+static gpointer dndtarget = NULL;
+static gboolean drag_motion_cb(GtkWidget      *widget,
+                                         GdkDragContext *context,
+                                         gint            x,
+                                         gint            y,
+                                         guint           time,
+                                         gpointer        data) {
+       dndtarget = data;
+       return 1;
+       
+}
+static void start_drag(GtkWidget *widget, GdkDragContext *dc, gpointer data) {
+       dndtarget=NULL;
+}
+
+static void drag_data_get(GtkWidget        *widget,
+                                    GdkDragContext   *drag_context,
+                                    GtkSelectionData *selection_data,
+                                    guint             info,
+                                    guint             time,
+                                    gpointer          data) {
+       grouplist *gl=(grouplist *)dndtarget;
+       struct contact *ec = data;
+       if(gl == NULL || ec == NULL) {
+               gtk_drag_finish(drag_context, FALSE, FALSE, time);
+               return;
+       }
+       move_contact(gl->name, ec);
+       update_contact_list ();
+       write_contact_list();
+       gtk_drag_finish(drag_context, TRUE, TRUE, time);
+}
 
 /*
  * Add/Remove entries to/from box -- group, contact, account
@@ -791,6 +803,12 @@
        gtk_signal_connect(GTK_OBJECT(eg->list_item),  "button_press_event",
                           GTK_SIGNAL_FUNC(group_click),
                           (grouplist *)eg );
+       gtk_drag_dest_set(eg->list_item, GTK_DEST_DEFAULT_ALL &
+                         ~GTK_DEST_DEFAULT_HIGHLIGHT,
+                         drag_types, 1,
+                         GDK_ACTION_MOVE|GDK_ACTION_DEFAULT);
+       gtk_signal_connect(GTK_OBJECT(eg->list_item), "drag_motion",
+                          GTK_SIGNAL_FUNC(drag_motion_cb), eg);
        
        gtk_widget_show(eg->list_item);
 }
@@ -858,41 +876,6 @@
 
 }
 
-GtkTargetEntry drag_types[1] =
-{
-       {"text/plain", GTK_TARGET_SAME_APP, 0}
-};
-
-static gpointer dndtarget = NULL;
-static gboolean drag_motion_cb(GtkWidget      *widget,
-                                         GdkDragContext *context,
-                                         gint            x,
-                                         gint            y,
-                                         guint           time,
-                                         gpointer        data) {
-       dndtarget = data;
-       return 1;
-       
-}
-static void start_drag(GtkWidget *widget, GdkDragContext *dc, gpointer data) {
-       dndtarget=NULL;
-}
-
-static void drag_data_get(GtkWidget        *widget,
-                                    GdkDragContext   *drag_context,
-                                    GtkSelectionData *selection_data,
-                                    guint             info,
-                                    guint             time,
-                                    gpointer          data) {
-       grouplist *gl=(grouplist *)dndtarget;
-       struct contact *ec = data;
-       if(gl == NULL || ec == NULL)
-               return;
-       move_contact(gl->name, ec);
-       update_contact_list ();
-       write_contact_list();
-}
-
 /* makes a contact visible on the buddy list */
 void add_contact_line( struct contact * ec)
 {
@@ -930,13 +913,7 @@
                        ec->group->tree);
                if(strcmp(_("Unknown"),ec->group->name) !=0 &&
                   strcmp(_("Ignore"),ec->group->name) !=0)
-               gtk_tree_item_expand(GTK_TREE_ITEM(ec->group->list_item));
-               gtk_drag_dest_set(ec->group->list_item, GTK_DEST_DEFAULT_ALL &
-                                 ~GTK_DEST_DEFAULT_HIGHLIGHT,
-                                 drag_types, 1,
-                                 GDK_ACTION_MOVE|GDK_ACTION_DEFAULT);
-               gtk_signal_connect(GTK_OBJECT(ec->group->list_item), 
"drag_motion",
-                                  GTK_SIGNAL_FUNC(drag_motion_cb), ec->group);
+                       
gtk_tree_item_expand(GTK_TREE_ITEM(ec->group->list_item));
        }
        gtk_drag_source_set(ec->list_item,
                GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
@@ -952,7 +929,6 @@
        gtk_tree_insert(GTK_TREE(ec->group->tree), ec->list_item,
                get_contact_position(ec));
 
-
        gtk_tree_item_set_subtree(GTK_TREE_ITEM(ec->list_item), ec->tree);
        if(ec->expanded)
                gtk_tree_item_expand(GTK_TREE_ITEM(ec->list_item));
@@ -1928,7 +1904,6 @@
 
        gtk_signal_connect(GTK_OBJECT(contact_window), "size_allocate",
                        eb_save_size,NULL);
-
        update_contact_list ();
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]