address choose dialog improvement



I am a happy balsa user for quite a long time now...
I'd like to add a small feature am missing:

If you choose some recipients from the address book, close it, open it 
again to add one you've forgotten ->
all previous chosen addresses went lost... :(

I wrote a few line code, that search the string of addresses for 
existing entries in the address book and make them switch the gtk_clist 
before the address-book dialog comes up.

Hope it helps!
Marko -- 
      .---.
     /     \      Marko Rößler -- Student of Electrical Engineering
     \.@-@./	                  at University of Technology Chemnitz
     /`\_/`\
    //  _  \\     Homepage: http://www.tu-chemnitz.de/~marr
   | \     )|_    TalkTo:   marr@pes211211.levels.unisa.edu.au
  /`\_`>  <_/ \
  \__/'---'\__/ Never trust an operating system you don't have sources 
for... ;-)
diff -Bb -u balsa/src/address-book.c balsa.org/src/address-book.c
--- balsa/src/address-book.c	Tue Oct 22 13:22:55 2002
+++ balsa.org/src/address-book.c	Sun Oct 14 07:21:55 2001
@@ -430,34 +430,6 @@
 }
 
 /*
-  parses a string for recipients
-*/
-void
-balsa_address_book_set_recipients(BalsaAddressBook *ab, gchar *rcpts)
-{
-    gchar *help, *cell=NULL, **tokens=NULL;
-    gint i=0;
-
-    for( i=0; i<GTK_CLIST(ab->address_clist)->rows; i++) {
-
-	gtk_clist_get_text(GTK_CLIST(ab->address_clist),i,1,&cell);
-
-	help=cell;  /* we do not deal with address lists */
-	while((*(help++)!='\0') &&(*help!=';'));
-
-	tokens = g_strsplit(rcpts,cell,2);
-	if ((*help!= ';') && (tokens[0]!=NULL) && (tokens[1]!=NULL)){
-	    gtk_clist_select_row(GTK_CLIST(ab->address_clist),i,1);
-	    balsa_address_book_swap_clist_entry(GTK_CLIST(ab->address_clist)
-		,GTK_CLIST(ab->recipient_clist));
-	    i--;
-	}
-	g_strfreev(tokens);
-    }
-    return;
-}
-
-/*
   Moves an entry between two CLists.
 */
 /*
diff -Bb -u balsa/src/address-book.h balsa.org/src/address-book.h
--- balsa/src/address-book.h	Tue Oct 22 13:21:51 2002
+++ balsa.org/src/address-book.h	Mon Dec  4 21:33:56 2000
@@ -69,7 +69,6 @@
 GtkWidget *balsa_address_book_new(gboolean composing);
 
 gchar *balsa_address_book_get_recipients(BalsaAddressBook *ab);
-void balsa_address_book_set_recipients(BalsaAddressBook *ab, gchar *rcpts);
 
 END_GNOME_DECLS
 
diff -Bb -u balsa/src/sendmsg-window.c balsa.org/src/sendmsg-window.c
--- balsa/src/sendmsg-window.c	Tue Oct 22 13:25:01 2002
+++ balsa.org/src/sendmsg-window.c	Tue Oct  1 06:17:11 2002
@@ -552,8 +552,6 @@
     GtkWidget *ab;
     LibBalsaAddressEntry *address_entry;
     gint button;
-    gchar *rcpts;
-
 
     address_entry =
         LIBBALSA_ADDRESS_ENTRY(gtk_object_get_data
@@ -561,10 +559,6 @@
                                 "address-entry-widget"));
 
     ab = balsa_address_book_new(TRUE);
-
-    rcpts = gtk_entry_get_text(GTK_ENTRY(entry));
-    balsa_address_book_set_recipients(BALSA_ADDRESS_BOOK(ab),rcpts);
-
     gnome_dialog_set_parent(GNOME_DIALOG(ab),
 			    GTK_WINDOW(snd_msg_wind->window));
 


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