2004-09-28 [colin] 0.9.12cvs108.1
authorColin Leroy <colin@colino.net>
Tue, 28 Sep 2004 08:25:18 +0000 (08:25 +0000)
committerColin Leroy <colin@colino.net>
Tue, 28 Sep 2004 08:25:18 +0000 (08:25 +0000)
* src/addressbook.c
Sync with HEAD (addressbook edit on double-click)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/addressbook.c

index 57e92e49e220301316b42f7775a493b957fe2058..0f02213eec885cc69e9ccceb73e41975a7d3467a 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-28 [colin]     0.9.12cvs108.1
+
+       * src/addressbook.c
+               Sync with HEAD (addressbook edit on double-click)
+
 2004-09-28 [colin]     0.9.12cvs106.1
 
        * src/inc.c
index 631e25587f315ae60c669e9aadb25bd9b1ff2cc1..ccc9213223403a93a2c4223bf8050586161fc9ec 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.115.2.18 -r 1.115.2.19 src/main.c; ) > 0.9.12cvs104.1.patchset
 ( cvs diff -u -r 1.207.2.14 -r 1.207.2.15 src/folderview.c; ) > 0.9.12cvs105.1.patchset
 ( cvs diff -u -r 1.149.2.15 -r 1.149.2.16 src/inc.c; ) > 0.9.12cvs106.1.patchset
+( cvs diff -u -r 1.60.2.10 -r 1.60.2.11 src/addressbook.c; ) > 0.9.12cvs108.1.patchset
index b86267ce47c486a5081e15871b486b62ea22eaf5..93d05716e8c447cdfc1bb0d77320788f3b31f628 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=106
+EXTRA_VERSION=108
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=.1
 
index 588fcd7353eef6e392ecfe67c2c0b887e2df6005..c13a0abffee2ae0d434b021baee45dec7b2a7b8e 100644 (file)
@@ -180,11 +180,6 @@ static void addressbook_select_row_tree            (GtkCTree       *ctree,
                                                 GtkCTreeNode   *node,
                                                 gint            column,
                                                 gpointer        data);
-static void addressbook_list_selected          (GtkCList       *clist,
-                                                gint            row,
-                                                gint            column,
-                                                GdkEvent       *event,
-                                                gpointer        data);
 static void addressbook_list_row_selected      (GtkCTree       *clist,
                                                 GtkCTreeNode   *node,
                                                 gint            column,
@@ -789,8 +784,6 @@ static void addressbook_create(void)
        g_signal_connect(G_OBJECT(clist), "button_release_event",
                         G_CALLBACK(addressbook_list_button_released),
                         NULL);
-       g_signal_connect(G_OBJECT(clist), "select_row",
-                        G_CALLBACK(addressbook_list_selected), NULL);
        g_signal_connect(G_OBJECT(clist), "tree_expand",
                         G_CALLBACK(addressbook_person_expand_node), NULL );
        g_signal_connect(G_OBJECT(clist), "tree_collapse",
@@ -1561,19 +1554,6 @@ static void addressbook_list_menu_setup( void ) {
 #endif
 }
 
-static void addressbook_list_selected(GtkCList *clist, gint row, gint column,
-                                     GdkEvent *event, gpointer data)
-{
-       if (event && event->type == GDK_2BUTTON_PRESS) {
-               /* Handle double click */
-               if (prefs_common.add_address_by_click &&
-                   addrbook.target_compose)
-                       addressbook_to_clicked(NULL, GINT_TO_POINTER(COMPOSE_TO));
-               else
-                       addressbook_edit_address_cb(NULL, 0, NULL);
-       }
-}
-
 static void addressbook_select_row_tree        (GtkCTree       *ctree,
                                         GtkCTreeNode   *node,
                                         gint            column,
@@ -1943,10 +1923,14 @@ static void addressbook_entry_gotfocus( GtkWidget *widget ) {
        gtk_editable_select_region( GTK_EDITABLE(addrbook.entry), 0, -1 );
 }
 
+/* from gdkevents.c */
+#define DOUBLE_CLICK_TIME 250
+
 static gboolean addressbook_list_button_pressed(GtkWidget *widget,
                                                GdkEventButton *event,
                                                gpointer data)
 {
+       static guint32 lasttime = 0;
        if( ! event ) return FALSE;
 
        addressbook_list_menu_setup();
@@ -1954,7 +1938,19 @@ static gboolean addressbook_list_button_pressed(GtkWidget *widget,
        if( event->button == 3 ) {
                gtk_menu_popup( GTK_MENU(addrbook.list_popup), NULL, NULL, NULL, NULL,
                       event->button, event->time );
+       } else if (event->button == 1) {
+               if (event->time - lasttime < DOUBLE_CLICK_TIME) {
+                       if (prefs_common.add_address_by_click &&
+                           addrbook.target_compose)
+                               addressbook_to_clicked(NULL, GINT_TO_POINTER(COMPOSE_TO));
+                       else
+                               addressbook_edit_address_cb(NULL, 0, NULL);
+
+                       lasttime = 0;
+               } else
+                       lasttime = event->time;
        }
+
        return FALSE;
 }