2005-08-03 [colin] 1.9.13cvs11
authorColin Leroy <colin@colino.net>
Wed, 3 Aug 2005 18:24:13 +0000 (18:24 +0000)
committerColin Leroy <colin@colino.net>
Wed, 3 Aug 2005 18:24:13 +0000 (18:24 +0000)
* src/addressbook.c
* src/editaddress.c
* src/editgroup.c
Fixing addressbook, round 2
* src/textview.c
Fix emphasis color on rechecking 'Colorize messages'

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

index 988b59001496886214b15e1e9d08058f1fb02577..65acba73eb38f23942f653b1e20c1dc3fd719be9 100644 (file)
@@ -1,3 +1,12 @@
+2005-08-03 [colin]     1.9.13cvs11
+
+       * src/addressbook.c
+       * src/editaddress.c
+       * src/editgroup.c
+               Fixing addressbook, round 2
+       * src/textview.c
+               Fix emphasis color on rechecking 'Colorize messages'
+
 2005-08-03 [paul]      1.9.13cvs10
 
        sync with main
index 3f0271e9a11e43f68d8b43d88c0b1308e8ce1046..155996c8df39dac40a0aeb4b3f88afe6ebf7aea3 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.21 -r 1.60.2.22 src/addressbook.c;  cvs diff -u -r 1.5.2.1 -r 1.5.2.2 src/addressitem.h;  cvs diff -u -r 1.274.2.47 -r 1.274.2.48 src/mainwindow.c;  ) > 1.9.13cvs8.patchset
 ( cvs diff -u -r 1.207.2.49 -r 1.207.2.50 src/folderview.c;  ) > 1.9.13cvs9.patchset
 ( cvs diff -u -r 1.27.2.11 -r 1.27.2.12 src/addr_compl.c;  cvs diff -u -r 1.382.2.144 -r 1.382.2.145 src/compose.c;  cvs diff -u -r 1.8.2.7 -r 1.8.2.8 src/headerview.c;  cvs diff -u -r 1.115.2.47 -r 1.115.2.48 src/main.c;  cvs diff -u -r 1.56.2.36 -r 1.56.2.37 src/pop.c;  cvs diff -u -r 1.105.2.28 -r 1.105.2.29 src/prefs_account.c;  cvs diff -u -r 1.49.2.51 -r 1.49.2.52 src/procmime.c;  cvs diff -u -r 1.150.2.32 -r 1.150.2.33 src/procmsg.c;  cvs diff -u -r 1.22.2.10 -r 1.22.2.11 src/quote_fmt_parse.y;  cvs diff -u -r 1.96.2.66 -r 1.96.2.67 src/textview.c;  cvs diff -u -r 1.3.2.2 -r 1.3.2.3 src/common/quoted-printable.c;  cvs diff -u -r 1.36.2.37 -r 1.36.2.38 src/common/utils.c;  cvs diff -u -r 1.20.2.19 -r 1.20.2.20 src/common/utils.h;  cvs diff -u -r 1.1.4.8 -r 1.1.4.9 src/common/xml.c;  cvs diff -u -r 1.4.2.14 -r 1.4.2.15 src/gtk/about.c;  ) > 1.9.13cvs10.patchset
+( cvs diff -u -r 1.60.2.22 -r 1.60.2.23 src/addressbook.c;  cvs diff -u -r 1.14.2.6 -r 1.14.2.7 src/editaddress.c;  cvs diff -u -r 1.11.2.6 -r 1.11.2.7 src/editgroup.c;  cvs diff -u -r 1.96.2.67 -r 1.96.2.68 src/textview.c;  ) > 1.9.13cvs11.patchset
index 73ecddb4488b85f8b296fff895402f2f7d723eac..b4da960a6270687c617336c3800e556ea1b27f8d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=10
+EXTRA_VERSION=11
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 34e579e60a59e834c304aa8bf70429a49a4f676e..ee8687e8ec60d353fa594e411b817ab599ddb87e 100644 (file)
@@ -171,6 +171,8 @@ static void addressbook_to_clicked          (GtkButton      *button,
                                                 gpointer        data);
 static void addressbook_lup_clicked            (GtkButton      *button,
                                                 gpointer       data);
+static void addressbook_close_clicked          (GtkButton      *button,
+                                                gpointer       data);
 
 static gboolean addressbook_tree_selected      (GtkCTree       *ctree,
                                                 GtkCTreeNode   *node,
@@ -399,7 +401,7 @@ static GtkItemFactoryEntry addressbook_entries[] =
        {N_("/_Book"),                  NULL,           NULL, 0, "<Branch>"},
        {N_("/_Book/New _Book"),        "<control>B",   addressbook_new_book_cb,        0, NULL},
        {N_("/_Book/New _Folder"),      "<control>R",   addressbook_new_folder_cb,      0, NULL},
-       {N_("/_Book/New _vCard"),       "<control>D",   addressbook_new_vcard_cb,       0, NULL},
+       {N_("/_Book/New _vCard"),       "<control><shift>D",    addressbook_new_vcard_cb,       0, NULL},
 #ifdef USE_JPILOT
        {N_("/_Book/New _JPilot"),      "<control>J",   addressbook_new_jpilot_cb,      0, NULL},
 #endif
@@ -418,7 +420,7 @@ static GtkItemFactoryEntry addressbook_entries[] =
        {N_("/_Address/_Paste"),        "<control>V",   addressbook_clip_paste_cb,      0, NULL},
        {N_("/_Address/---"),           NULL,           NULL, 0, "<Separator>"},
        {N_("/_Address/_Edit"),         "<control>Return",addressbook_edit_address_cb,    0, NULL},
-       {N_("/_Address/_Delete"),       NULL,           addressbook_delete_address_cb,  0, NULL},
+       {N_("/_Address/_Delete"),       "<control>D",   addressbook_delete_address_cb,  0, NULL},
        {N_("/_Address/---"),           NULL,           NULL, 0, "<Separator>"},
        {N_("/_Address/New _Address"),  "<control>N",   addressbook_new_address_cb,     0, NULL},
        {N_("/_Address/New _Group"),    "<control>G",   addressbook_new_group_cb,       0, NULL},
@@ -687,6 +689,7 @@ static void addressbook_create(void)
        GtkWidget *to_btn;
        GtkWidget *cc_btn;
        GtkWidget *bcc_btn;
+       GtkWidget *close_btn;
        GtkWidget *tree_popup;
        GtkWidget *list_popup;
        GtkItemFactory *tree_factory;
@@ -855,13 +858,15 @@ static void addressbook_create(void)
        gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbbox), 2);
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
 
-       del_btn = gtk_button_new_with_label(_("Delete"));
+       del_btn = gtk_button_new_from_stock(GTK_STOCK_DELETE);
        GTK_WIDGET_SET_FLAGS(del_btn, GTK_CAN_DEFAULT);
        gtk_box_pack_start(GTK_BOX(hbbox), del_btn, TRUE, TRUE, 0);
-       reg_btn = gtk_button_new_with_label(_("Add"));
+       reg_btn = gtk_button_new_from_stock(GTK_STOCK_NEW);
        GTK_WIDGET_SET_FLAGS(reg_btn, GTK_CAN_DEFAULT);
        gtk_box_pack_start(GTK_BOX(hbbox), reg_btn, TRUE, TRUE, 0);
-       lup_btn = gtk_button_new_with_label(_("Lookup"));
+
+
+       lup_btn = gtk_button_new_from_stock(GTK_STOCK_FIND);
        GTK_WIDGET_SET_FLAGS(lup_btn, GTK_CAN_DEFAULT);
        gtk_box_pack_start(GTK_BOX(hbox), lup_btn, TRUE, TRUE, 0);
 
@@ -885,6 +890,10 @@ static void addressbook_create(void)
        GTK_WIDGET_SET_FLAGS(bcc_btn, GTK_CAN_DEFAULT);
        gtk_box_pack_start(GTK_BOX(hbbox), bcc_btn, TRUE, TRUE, 0);
 
+       close_btn = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
+       GTK_WIDGET_SET_FLAGS(close_btn, GTK_CAN_DEFAULT);
+       gtk_box_pack_start(GTK_BOX(hbbox), close_btn, TRUE, TRUE, 0);
+
        g_signal_connect(G_OBJECT(to_btn), "clicked",
                         G_CALLBACK(addressbook_to_clicked),
                         GINT_TO_POINTER(COMPOSE_TO));
@@ -894,6 +903,8 @@ static void addressbook_create(void)
        g_signal_connect(G_OBJECT(bcc_btn), "clicked",
                         G_CALLBACK(addressbook_to_clicked),
                         GINT_TO_POINTER(COMPOSE_BCC));
+       g_signal_connect(G_OBJECT(close_btn), "clicked",
+                        G_CALLBACK(addressbook_close_clicked), NULL);
 
        /* Build icons for interface */
        stock_pixmap_gdk( window, STOCK_PIXMAP_INTERFACE,
@@ -3498,6 +3509,8 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data
 {
        if (event && event->keyval == GDK_Escape)
                addressbook_close();
+       else if (event && event->keyval == GDK_Delete)
+               addressbook_del_clicked(NULL, NULL);
        return FALSE;
 }
 
@@ -3861,6 +3874,10 @@ static void addressbook_lup_clicked( GtkButton *button, gpointer data ) {
        g_free( searchTerm );
 }
 
+static void addressbook_close_clicked( GtkButton *button, gpointer data ) {
+       addressbook_close();
+}
+
 #ifdef USE_LDAP
 /**
  * Browse address entry for highlighted entry.
index 86ba25cebafda7bcd035524db5136ce0ba268017..3fa3c47f3491d62ab9ed2d9fc43d96f00e9b6c3d 100644 (file)
@@ -63,11 +63,19 @@ static struct _PersonEdit_dlg {
        GtkWidget *entry_alias;
        GtkWidget *entry_remarks;
        GtkWidget *clist_email;
+       GtkWidget *email_up;
+       GtkWidget *email_down;
+       GtkWidget *email_del;
+       GtkWidget *email_mod;
+       GtkWidget *email_add;
 
        /* Attribute data tab */
        GtkWidget *entry_atname;
        GtkWidget *entry_atvalue;
        GtkWidget *clist_attrib;
+       GtkWidget *attrib_add;
+       GtkWidget *attrib_del;
+       GtkWidget *attrib_mod;
 
        gint rowIndEMail;
        gint rowIndAttrib;
@@ -216,6 +224,13 @@ static void edit_person_email_list_selected( GtkCList *clist, gint row, gint col
                        gtk_entry_set_text( GTK_ENTRY(personeditdlg.entry_alias), ADDRITEM_NAME(email) );
                if( email->remarks )
                        gtk_entry_set_text( GTK_ENTRY(personeditdlg.entry_remarks), email->remarks );
+               gtk_widget_set_sensitive(personeditdlg.email_del, TRUE);
+               gtk_widget_set_sensitive(personeditdlg.email_up, row > 0);
+               gtk_widget_set_sensitive(personeditdlg.email_down, gtk_clist_get_row_data(clist, row + 1) != NULL);
+       } else {
+               gtk_widget_set_sensitive(personeditdlg.email_del, FALSE);
+               gtk_widget_set_sensitive(personeditdlg.email_up, FALSE);
+               gtk_widget_set_sensitive(personeditdlg.email_down, FALSE);
        }
        personeditdlg.rowIndEMail = row;
        edit_person_status_show( NULL );
@@ -228,6 +243,11 @@ static void edit_person_email_move( gint dir ) {
        if( email ) {
                gtk_clist_row_move( clist, personeditdlg.rowIndEMail, row );
                personeditdlg.rowIndEMail = row;
+               gtk_widget_set_sensitive(personeditdlg.email_up, row > 0);
+               gtk_widget_set_sensitive(personeditdlg.email_down, gtk_clist_get_row_data(clist, row + 1) != NULL);
+       } else {
+               gtk_widget_set_sensitive(personeditdlg.email_up, FALSE);
+               gtk_widget_set_sensitive(personeditdlg.email_down, FALSE);
        }
        edit_person_email_clear( NULL );
        edit_person_status_show( NULL );
@@ -258,6 +278,9 @@ static void edit_person_email_delete( gpointer data ) {
        if( ! email ) {
                personeditdlg.rowIndEMail = -1 + row;
        }
+       gtk_widget_set_sensitive(personeditdlg.email_del, gtk_clist_get_row_data(clist, 0) != NULL);
+       gtk_widget_set_sensitive(personeditdlg.email_up, gtk_clist_get_row_data(clist, personeditdlg.rowIndEMail + 1) != NULL);
+       gtk_widget_set_sensitive(personeditdlg.email_down, gtk_clist_get_row_data(clist, personeditdlg.rowIndEMail - 1) != NULL);
        edit_person_status_show( NULL );
 }
 
@@ -348,6 +371,36 @@ static gint edit_person_attrib_compare_func(
        return g_utf8_collate( name1, name2 );
 }
 
+static gboolean list_find_attribute(const gchar *attr)
+{
+       GtkCList *clist = GTK_CLIST(personeditdlg.clist_attrib);
+       UserAttribute *attrib;
+       gint row = 0;
+       while( (attrib = gtk_clist_get_row_data( clist, row )) ) {
+               if (!g_ascii_strcasecmp(attrib->name, attr)) {
+                       gtk_clist_select_row(clist, row, 0);
+                       return TRUE;
+               }
+               row++;
+       }
+       return FALSE;
+}
+
+static gboolean list_find_email(const gchar *addr)
+{
+       GtkCList *clist = GTK_CLIST(personeditdlg.clist_email);
+       ItemEMail *email;
+       gint row = 0;
+       while( (email = gtk_clist_get_row_data( clist, row )) ) {
+               if (!g_ascii_strcasecmp(email->address, addr)) {
+                       gtk_clist_select_row(clist, row, 0);
+                       return TRUE;
+               }
+               row++;
+       }
+       return FALSE;
+}
+
 /*
 * Load clist with a copy of person's email addresses.
 */
@@ -373,6 +426,9 @@ static void edit_person_attrib_list_selected( GtkCList *clist, gint row, gint co
        if( attrib ) {
                gtk_entry_set_text( GTK_ENTRY(personeditdlg.entry_atname), attrib->name );
                gtk_entry_set_text( GTK_ENTRY(personeditdlg.entry_atvalue), attrib->value );
+               gtk_widget_set_sensitive(personeditdlg.attrib_del, TRUE);
+       } else {
+               gtk_widget_set_sensitive(personeditdlg.attrib_del, FALSE);
        }
        personeditdlg.rowIndAttrib = row;
        edit_person_status_show( NULL );
@@ -394,7 +450,10 @@ static void edit_person_attrib_delete( gpointer data ) {
        attrib = gtk_clist_get_row_data( clist, row );
        if( ! attrib ) {
                personeditdlg.rowIndAttrib = -1 + row;
-       }
+       } 
+       
+       gtk_widget_set_sensitive(personeditdlg.attrib_del, gtk_clist_get_row_data(clist, 0) != NULL);
+       
        edit_person_status_show( NULL );
 }
 
@@ -600,6 +659,41 @@ static void addressbook_edit_person_page_basic( gint pageNum, gchar *pageLbl ) {
        personeditdlg.entry_nick  = entry_nn;
 }
 
+static gboolean email_adding = FALSE, email_saving = FALSE;
+
+static void edit_person_entry_email_changed (GtkWidget *entry, gpointer data)
+{
+       if (gtk_entry_get_text(GTK_ENTRY(personeditdlg.entry_email)) == NULL
+       ||  strlen(gtk_entry_get_text(GTK_ENTRY(personeditdlg.entry_email))) == 0) {
+               gtk_widget_set_sensitive(personeditdlg.email_add,FALSE);
+               gtk_widget_set_sensitive(personeditdlg.email_mod,FALSE);
+               email_adding = FALSE;
+               email_saving = FALSE;
+       } else if (list_find_email(gtk_entry_get_text(GTK_ENTRY(personeditdlg.entry_email)))) {
+               gtk_widget_set_sensitive(personeditdlg.email_add,FALSE);
+               gtk_widget_set_sensitive(personeditdlg.email_mod,TRUE);
+               email_adding = FALSE;
+               email_saving = TRUE;
+       } else {
+               gtk_widget_set_sensitive(personeditdlg.email_add,TRUE);
+               gtk_widget_set_sensitive(personeditdlg.email_mod,FALSE);
+               email_adding = TRUE;
+               email_saving = FALSE;
+       }
+}
+
+static gboolean edit_person_entry_email_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+       if (event && event->keyval == GDK_Return) {
+               if (email_adding)
+                       edit_person_email_add(NULL);
+               else if (email_saving)
+                       edit_person_email_modify(NULL);
+       }
+       return FALSE;
+}
+
+
 static void addressbook_edit_person_page_email( gint pageNum, gchar *pageLbl ) {
        GtkWidget *vbox;
        GtkWidget *hbox;
@@ -611,7 +705,6 @@ static void addressbook_edit_person_page_email( gint pageNum, gchar *pageLbl ) {
        GtkWidget *buttonDel;
        GtkWidget *buttonMod;
        GtkWidget *buttonAdd;
-       GtkWidget *buttonClr;
 
        GtkWidget *table;
        GtkWidget *label;
@@ -709,24 +802,21 @@ static void addressbook_edit_person_page_email( gint pageNum, gchar *pageLbl ) {
        gtk_container_add( GTK_CONTAINER(vboxb), vbuttonbox );
 
        /* Buttons */
-       buttonUp = gtk_button_new_with_label( _( "Move Up" ) );
+       buttonUp = gtk_button_new_from_stock(GTK_STOCK_GO_UP);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonUp );
 
-       buttonDown = gtk_button_new_with_label( _( "Move Down" ) );
+       buttonDown = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonDown );
 
-       buttonDel = gtk_button_new_with_label( _( "Delete" ) );
+       buttonDel = gtk_button_new_from_stock(GTK_STOCK_DELETE);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonDel );
 
-       buttonMod = gtk_button_new_with_label( _( "Modify" ) );
+       buttonMod = gtk_button_new_from_stock(GTK_STOCK_SAVE);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonMod );
 
-       buttonAdd = gtk_button_new_with_label( _( "Add" ) );
+       buttonAdd = gtk_button_new_from_stock(GTK_STOCK_ADD);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonAdd );
 
-       buttonClr = gtk_button_new_with_label( _( "Clear" ) );
-       gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonClr );
-
        gtk_widget_show_all(vbox);
 
        /* Event handlers */
@@ -742,13 +832,58 @@ static void addressbook_edit_person_page_email( gint pageNum, gchar *pageLbl ) {
                          G_CALLBACK( edit_person_email_modify ), NULL );
        g_signal_connect( G_OBJECT(buttonAdd), "clicked",
                          G_CALLBACK( edit_person_email_add ), NULL );
-       g_signal_connect( G_OBJECT(buttonClr), "clicked",
-                         G_CALLBACK( edit_person_email_clear ), NULL );
+       g_signal_connect(G_OBJECT(entry_email), "changed",
+                        G_CALLBACK(edit_person_entry_email_changed), NULL);
+       g_signal_connect(G_OBJECT(entry_email), "key_press_event",
+                        G_CALLBACK(edit_person_entry_email_pressed), NULL);
+       g_signal_connect(G_OBJECT(entry_alias), "key_press_event",
+                        G_CALLBACK(edit_person_entry_email_pressed), NULL);
+       g_signal_connect(G_OBJECT(entry_remarks), "key_press_event",
+                        G_CALLBACK(edit_person_entry_email_pressed), NULL);
 
        personeditdlg.clist_email   = clist;
        personeditdlg.entry_email   = entry_email;
        personeditdlg.entry_alias   = entry_alias;
        personeditdlg.entry_remarks = entry_remarks;
+       personeditdlg.email_up = buttonUp;
+       personeditdlg.email_down = buttonDown;
+       personeditdlg.email_del = buttonDel;
+       personeditdlg.email_mod = buttonMod;
+       personeditdlg.email_add = buttonAdd;
+}
+
+static gboolean attrib_adding = FALSE, attrib_saving = FALSE;
+
+static void edit_person_entry_att_changed (GtkWidget *entry, gpointer data)
+{
+       if (gtk_entry_get_text(GTK_ENTRY(personeditdlg.entry_atname)) == NULL
+       ||  strlen(gtk_entry_get_text(GTK_ENTRY(personeditdlg.entry_atname))) == 0) {
+               gtk_widget_set_sensitive(personeditdlg.attrib_add,FALSE);
+               gtk_widget_set_sensitive(personeditdlg.attrib_mod,FALSE);
+               attrib_adding = FALSE;
+               attrib_saving = FALSE;
+       } else if (list_find_attribute(gtk_entry_get_text(GTK_ENTRY(personeditdlg.entry_atname)))) {
+               gtk_widget_set_sensitive(personeditdlg.attrib_add,FALSE);
+               gtk_widget_set_sensitive(personeditdlg.attrib_mod,TRUE);
+               attrib_adding = FALSE;
+               attrib_saving = TRUE;
+       } else {
+               gtk_widget_set_sensitive(personeditdlg.attrib_add,TRUE);
+               gtk_widget_set_sensitive(personeditdlg.attrib_mod,FALSE);
+               attrib_adding = TRUE;
+               attrib_saving = FALSE;
+       }
+}
+
+static gboolean edit_person_entry_att_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+       if (event && event->keyval == GDK_Return) {
+               if (attrib_adding)
+                       edit_person_attrib_add(NULL);
+               else if (attrib_saving)
+                       edit_person_attrib_modify(NULL);
+       }
+       return FALSE;
 }
 
 static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl ) {
@@ -760,7 +895,6 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
        GtkWidget *buttonDel;
        GtkWidget *buttonMod;
        GtkWidget *buttonAdd;
-       GtkWidget *buttonClr;
 
        GtkWidget *table;
        GtkWidget *label;
@@ -849,17 +983,18 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
        gtk_container_add( GTK_CONTAINER(vboxb), vbuttonbox );
 
        /* Buttons */
-       buttonDel = gtk_button_new_with_label( _( "Delete" ) );
+       buttonDel = gtk_button_new_from_stock(GTK_STOCK_DELETE);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonDel );
 
-       buttonMod = gtk_button_new_with_label( _( "Modify" ) );
+       buttonMod = gtk_button_new_from_stock(GTK_STOCK_SAVE);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonMod );
 
-       buttonAdd = gtk_button_new_with_label( _( "Add" ) );
+       buttonAdd = gtk_button_new_from_stock(GTK_STOCK_ADD);
        gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonAdd );
-
-       buttonClr = gtk_button_new_with_label( _( "Clear" ) );
-       gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonClr );
+       
+       gtk_widget_set_sensitive(buttonDel,FALSE);
+       gtk_widget_set_sensitive(buttonMod,FALSE);
+       gtk_widget_set_sensitive(buttonAdd,FALSE);
 
        gtk_widget_show_all(vbox);
 
@@ -872,12 +1007,19 @@ static void addressbook_edit_person_page_attrib( gint pageNum, gchar *pageLbl )
                          G_CALLBACK( edit_person_attrib_modify ), NULL );
        g_signal_connect( G_OBJECT(buttonAdd), "clicked",
                          G_CALLBACK( edit_person_attrib_add ), NULL );
-       g_signal_connect( G_OBJECT(buttonClr), "clicked",
-                         G_CALLBACK( edit_person_attrib_clear ), NULL );
+       g_signal_connect(G_OBJECT(entry_name), "changed",
+                        G_CALLBACK(edit_person_entry_att_changed), NULL);
+       g_signal_connect(G_OBJECT(entry_name), "key_press_event",
+                        G_CALLBACK(edit_person_entry_att_pressed), NULL);
+       g_signal_connect(G_OBJECT(entry_value), "key_press_event",
+                        G_CALLBACK(edit_person_entry_att_pressed), NULL);
 
        personeditdlg.clist_attrib  = clist;
        personeditdlg.entry_atname  = entry_name;
        personeditdlg.entry_atvalue = entry_value;
+       personeditdlg.attrib_add = buttonAdd;
+       personeditdlg.attrib_del = buttonDel;
+       personeditdlg.attrib_mod = buttonMod;
 }
 
 static void addressbook_edit_person_create( gboolean *cancelled ) {
index dcc692b93c12e41c7321f51dcfcba3d74ba4880f..20a41e1a890822a37e760772603a75e2db322cdc 100644 (file)
@@ -150,6 +150,7 @@ static gint edit_group_clist_add_email( GtkCList *clist, ItemEMail *email ) {
        }
        text[ GROUP_COL_EMAIL   ] = email->address;
        text[ GROUP_COL_REMARKS ] = email->remarks;
+       
        row = gtk_clist_append( clist, text );
        gtk_clist_set_row_data( clist, row, email );
        return row;
@@ -157,49 +158,66 @@ static gint edit_group_clist_add_email( GtkCList *clist, ItemEMail *email ) {
 
 static void edit_group_load_clist( GtkCList *clist, GList *listEMail ) {
        GList *node = listEMail;
+       gtk_clist_freeze(clist);
        while( node ) {
                ItemEMail *email = node->data;
                edit_group_clist_add_email( clist, email );
                node = g_list_next( node );
        }
+       gtk_clist_thaw(clist);
 }
 
 
-static gint edit_group_move_email( GtkCList *clist_from, GtkCList *clist_to, gint row ) {
-       ItemEMail *email = gtk_clist_get_row_data( clist_from, row );
-       gint rrow = -1;
+static void edit_group_move_email( GtkCList *clist_from, GtkCList *clist_to, GtkCTreeNode *node ) {
+       ItemEMail *email = gtk_ctree_node_get_row_data( GTK_CTREE(clist_from), node );
+       GtkCTreeNode *next = gtkut_ctree_node_next(GTK_CTREE(clist_from), node);
+       GtkCTreeNode *prev = gtkut_ctree_node_prev(GTK_CTREE(clist_from), node);
+       int rrow = 0;
        if( email ) {
-               gtk_clist_remove( clist_from, row );
+               gtk_ctree_remove_node(GTK_CTREE(clist_from), node);
                rrow = edit_group_clist_add_email( clist_to, email );
                gtk_clist_select_row( clist_to, rrow, 0 );
+               if (next)
+                       gtk_ctree_select(GTK_CTREE(clist_from), next);
+               else if (prev)
+                       gtk_ctree_select(GTK_CTREE(clist_from), prev);
        }
-       return rrow;
 }
 
 static void edit_group_to_group( GtkWidget *widget, gpointer data ) {
-       GList *selected = GTK_CLIST(groupeditdlg.clist_avail)->selection;
+       GList *selected = g_list_copy(GTK_CLIST(groupeditdlg.clist_avail)->selection);
        /* Clear the selected rows on destination clist */
+       gtk_clist_freeze(groupeditdlg.clist_avail);
+       gtk_clist_freeze(groupeditdlg.clist_group);
        gtk_clist_unselect_all(groupeditdlg.clist_group);
        while (selected) {
                edit_group_move_email( groupeditdlg.clist_avail,
-                                       groupeditdlg.clist_group, GPOINTER_TO_UINT(selected->data) );
-               /* cannot use g_list_next as the selection list will have changed */
-               selected = GTK_CLIST(groupeditdlg.clist_avail)->selection;
+                                       groupeditdlg.clist_group, GTK_CTREE_NODE(selected->data) );
+               selected = selected->next;
        }
+       g_list_free(selected);
+       gtk_clist_thaw(groupeditdlg.clist_avail);
+       gtk_clist_thaw(groupeditdlg.clist_group);
 }
 
 static void edit_group_to_avail( GtkWidget *widget, gpointer data ) {
-       GList *selected = GTK_CLIST(groupeditdlg.clist_group)->selection;
+       GList *selected = g_list_copy(GTK_CLIST(groupeditdlg.clist_group)->selection);
+       gtk_clist_freeze(groupeditdlg.clist_avail);
+       gtk_clist_freeze(groupeditdlg.clist_group);
        gtk_clist_unselect_all(groupeditdlg.clist_avail);
        while (selected) {
                edit_group_move_email( groupeditdlg.clist_group,
-                                       groupeditdlg.clist_avail, GPOINTER_TO_UINT(selected->data) );
-               selected = GTK_CLIST(groupeditdlg.clist_group)->selection;
+                                       groupeditdlg.clist_avail, GTK_CTREE_NODE(selected->data) );
+               selected = selected->next;
        }
+       g_list_free(selected);
+       gtk_clist_thaw(groupeditdlg.clist_avail);
+       gtk_clist_thaw(groupeditdlg.clist_group);
 }
 
 static gboolean edit_group_list_group_button( GtkCList *clist, GdkEventButton *event, gpointer data ) {
        if( ! event ) return FALSE;
+       
        if( event->button == 1 ) {
                if( event->type == GDK_2BUTTON_PRESS ) {
                        edit_group_to_avail( NULL, NULL );
@@ -210,6 +228,7 @@ static gboolean edit_group_list_group_button( GtkCList *clist, GdkEventButton *e
 
 static gboolean edit_group_list_avail_button( GtkCList *clist, GdkEventButton *event, gpointer data ) {
        if( ! event ) return FALSE;
+       
        if( event->button == 1 ) {
                if( event->type == GDK_2BUTTON_PRESS ) {
                        edit_group_to_group( NULL, NULL );
@@ -322,7 +341,7 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
 
-       clist_group = gtk_clist_new_with_titles( GROUP_N_COLS, titles );
+       clist_group = gtk_sctree_new_with_titles( GROUP_N_COLS, GROUP_N_COLS, titles );
        gtk_container_add( GTK_CONTAINER(clist_swin), clist_group );
        gtk_clist_set_selection_mode( GTK_CLIST(clist_group), GTK_SELECTION_EXTENDED );
        gtk_clist_set_column_width( GTK_CLIST(clist_group), GROUP_COL_NAME, GROUP_COL_WIDTH_NAME );
@@ -351,7 +370,7 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
 
-       clist_avail = gtk_clist_new_with_titles( GROUP_N_COLS, titles );
+       clist_avail = gtk_sctree_new_with_titles( GROUP_N_COLS, GROUP_N_COLS, titles );
        gtk_container_add( GTK_CONTAINER(clist_swin), clist_avail );
        gtk_clist_set_selection_mode( GTK_CLIST(clist_avail), GTK_SELECTION_EXTENDED );
        gtk_clist_set_column_width( GTK_CLIST(clist_avail), GROUP_COL_NAME, GROUP_COL_WIDTH_NAME );
index 99fb3a030c4323f1c1409bbe077b201797296d00..48aeeb86b596e1c7ab6db824d5fce48a563e97a1 100644 (file)
@@ -402,6 +402,7 @@ void textview_init(TextView *textview)
 static void textview_update_message_colors(TextView *textview)
 {
        GdkColor black = {0, 0, 0, 0};
+       GdkColor colored_emphasis = {0, 0, 0, 0xcfff};
        GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview->text));
 
        GtkTextTagTable *tags = gtk_text_buffer_get_tag_table(buffer);
@@ -419,6 +420,7 @@ static void textview_update_message_colors(TextView *textview)
                                               &uri_color);
                gtkut_convert_int_to_gdk_color(prefs_common.signature_col,
                                               &signature_color);
+               emphasis_color = colored_emphasis;
        } else {
                quote_colors[0] = quote_colors[1] = quote_colors[2] = 
                        uri_color = emphasis_color = signature_color = black;
@@ -1569,8 +1571,7 @@ static void textview_show_header(TextView *textview, GPtrArray *headers)
                    procheader_headername_equal(header->name, "Cc"))
                        unfold_line(header->body);
 
-               if (prefs_common.enable_color &&
-                   (procheader_headername_equal(header->name, "X-Mailer") ||
+               if ((procheader_headername_equal(header->name, "X-Mailer") ||
                     procheader_headername_equal(header->name,
                                                 "X-Newsreader")) &&
                    strstr(header->body, "Sylpheed") != NULL) {
@@ -1578,9 +1579,10 @@ static void textview_show_header(TextView *textview, GPtrArray *headers)
                        gtk_text_buffer_insert_with_tags_by_name
                                (buffer, &iter, header->body, -1,
                                 "header", "emphasis", NULL);
-               }
-               textview_make_clickable_parts(textview, "header", "link",
+               } else {
+                       textview_make_clickable_parts(textview, "header", "link",
                                                      header->body);
+               }
                gtk_text_buffer_get_end_iter (buffer, &iter);
                gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, "\n", 1,
                                                         "header", NULL);