Re: Selecting an identity [PATCH]



There is evidently still some disagreement about the look of the `send
message' window, so I'll suggest the smallest change that would improve
the current situation; that is, keep the current look, but make
double-click mean `select and close'.  Patch against current cvs
attached.

Peter
diff -Nur --exclude=CVS balsa-cvs/libbalsa/identity.c balsa-double-click-identity/libbalsa/identity.c
--- balsa-cvs/libbalsa/identity.c	Tue Jul 24 06:55:37 2001
+++ balsa-double-click-identity/libbalsa/identity.c	Thu Sep 20 10:47:45 2001
@@ -379,7 +379,22 @@
                      gpointer user_data)
 {
     LibBalsaIdentity** selected_ident = (LibBalsaIdentity**) user_data;
-    *selected_ident = LIBBALSA_IDENTITY(gtk_clist_get_row_data(clist, row));
+    if (event && event->type == GDK_2BUTTON_PRESS)
+        /* it's a double-click:
+         * *selected_ident was set in the callback from the first click,
+         * so we can just close the dialog
+         *
+         * if we wanted to make this dialog single-click
+         * (select-and-close), we'd ignore the GdkEventButton and just
+         * set the identity then close the dialog (we'd also want to
+         * remove the `OK' button from the dialog)
+         * */
+        gnome_dialog_close(GNOME_DIALOG
+                           (gtk_widget_get_ancestor
+                            (GTK_WIDGET(clist), GTK_TYPE_WINDOW)));
+    else
+        *selected_ident =
+            LIBBALSA_IDENTITY(gtk_clist_get_row_data(clist, row));
 }
 
 


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