- if( event->type == GDK_2BUTTON_PRESS ) {
- Ldif_FieldRec *rec = gtk_clist_get_row_data(
- clist, impldif_dlg.rowIndSelect );
- if( rec ) {
- rec->selected = ! rec->selected;
- imp_ldif_update_row( clist );
- }
+ /* If single click in first column */
+ if( event->type == GDK_BUTTON_PRESS ) {
+ gint x = event->x;
+ gint y = event->y;
+ gint row, col;
+
+ gtk_clist_get_selection_info( clist, x, y, &row, &col );
+ if( col > 0 ) return;
+ if( row > impldif_dlg.rowCount ) return;
+
+ /* Set row */
+ impldif_dlg.rowIndSelect = row;
+ toggle = TRUE;
+ }
+
+ /* If double click anywhere in row */
+ else if( event->type == GDK_2BUTTON_PRESS ) {
+ toggle = TRUE;
+ }
+ }
+ /* Toggle field selection */
+ if( toggle ) {
+ rec = gtk_clist_get_row_data(
+ clist, impldif_dlg.rowIndSelect );
+ if( rec ) {
+ rec->selected = ! rec->selected;
+ imp_ldif_update_row( clist );