Select the address when only one match is found.
authorDarko Koruga <darko@users.sourceforge.net>
Sun, 21 Mar 2004 16:49:39 +0000 (16:49 +0000)
committerDarko Koruga <darko@users.sourceforge.net>
Sun, 21 Mar 2004 16:49:39 +0000 (16:49 +0000)
ChangeLog.claws
configure.ac
src/addr_compl.c

index 30f2494..08f8f85 100644 (file)
@@ -1,3 +1,10 @@
+2004-03-21 [darko]     0.9.10claws25
+
+       * src/addr_compl.c
+               select the address when only one match is found while
+               doing address completion with tab key (feature
+               request #914720)
+
 2004-03-21 [alfons]    0.9.10claws24
 
        * src/messageview.c
index 23b3611..e6908e6 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=24
+EXTRA_VERSION=25
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 8f7f468..603da29 100644 (file)
@@ -1088,8 +1088,21 @@ static gboolean address_completion_complete_address_in_entry(GtkEntry *entry,
                g_free( new );
        }
 
+       /* Select the address if there is only one match */
+       if (ncount == 2) {
+               /* Display selected address in entry field */           
+               gchar *addr = get_complete_address(1);
+
+               if (addr) {
+                       replace_address_in_edit(entry, addr, 0);
+                       g_free(addr);
+               }
+
+               /* Discard the window */
+               clear_completion_cache();
+       }
        /* Make sure that drop-down appears uniform! */
-       if( ncount == 0 ) {
+       else if( ncount == 0 ) {
                addrcompl_add_queue( g_strdup( searchTerm ) );
        }
        g_free( searchTerm );