diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ChangeLog.ja | 7 | ||||
-rw-r--r-- | src/addrbook.c | 12 | ||||
-rw-r--r-- | src/addrbook.h | 2 | ||||
-rw-r--r-- | src/addressbook.c | 16 |
5 files changed, 33 insertions, 11 deletions
@@ -1,5 +1,12 @@ 2007-02-13 + * src/addressbook.c + src/addrbook.[ch]: when deleting email from group, only remove from + group list and not from person. + Added "Delete" shortcut key to '/Address/Delete'. + +2007-02-13 + * wrc/mainwindow.c: main_window_get_size(): fixed the problem that the width of the folder view was not saved on maximized state. diff --git a/ChangeLog.ja b/ChangeLog.ja index 5b89f4a9..38c11b4d 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,12 @@ 2007-02-13 + * src/addressbook.c + src/addrbook.[ch]: グループからメールアドレスを削除するとき、 + グループのリストからのみ削除し、人物からは削除しないようにした。 + 「/アドレス/削除」に「Delete」ショートカットキーを追加。 + +2007-02-13 + * wrc/mainwindow.c: main_window_get_size(): 最大化状態でフォルダビュー の幅が保存されない問題を修正。 diff --git a/src/addrbook.c b/src/addrbook.c index 19a1ba00..95bf6ba5 100644 --- a/src/addrbook.c +++ b/src/addrbook.c @@ -264,7 +264,17 @@ ItemEMail *addrbook_person_remove_email( AddressBookFile *book, ItemPerson *pers g_return_val_if_fail( book != NULL, NULL ); item = addrcache_person_remove_email( book->addressCache, person, email ); - if( item ); book->dirtyFlag = TRUE; + if( item ) book->dirtyFlag = TRUE; + return item; +} + +ItemEMail *addrbook_group_remove_email( AddressBookFile *book, ItemGroup *group, ItemEMail *email ) { + ItemEMail *item; + + g_return_val_if_fail( book != NULL, NULL ); + + item = addritem_group_remove_email( group, email ); + if( item ) book->dirtyFlag = TRUE; return item; } diff --git a/src/addrbook.h b/src/addrbook.h index 1902be5d..2a64b9ea 100644 --- a/src/addrbook.h +++ b/src/addrbook.h @@ -75,6 +75,8 @@ ItemPerson *addrbook_remove_person ( AddressBookFile *book, ItemPerson *person ) ItemGroup *addrbook_remove_group ( AddressBookFile *book, ItemGroup *group ); ItemEMail *addrbook_person_remove_email ( AddressBookFile *book, ItemPerson *person, ItemEMail *email ); +ItemEMail *addrbook_group_remove_email ( AddressBookFile *book, ItemGroup *group, + ItemEMail *email ); gint addrbook_read_data ( AddressBookFile *book ); gint addrbook_save_data ( AddressBookFile *book ); diff --git a/src/addressbook.c b/src/addressbook.c index 245951d3..e9949601 100644 --- a/src/addressbook.c +++ b/src/addressbook.c @@ -151,6 +151,8 @@ static GList *_addressBookTypeList_ = NULL; static void addressbook_create (void); static gint addressbook_close (void); +static void addressbook_menuitem_set_sensitive (void); + /* callback functions */ static void addressbook_del_clicked (GtkButton *button, gpointer data); @@ -368,7 +370,7 @@ static GtkItemFactoryEntry addressbook_entries[] = {N_("/_Address/New _Folder"), "<control>F", addressbook_new_folder_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"), "Delete", addressbook_delete_address_cb, 0, NULL}, {N_("/_Tools"), NULL, NULL, 0, "<Branch>"}, {N_("/_Tools/Import _LDIF file"), NULL, addressbook_import_ldif_cb, 0, NULL}, @@ -422,6 +424,7 @@ void addressbook_open(Compose *target) addressbook_load_tree(); gtk_ctree_select(GTK_CTREE(addrbook.ctree), GTK_CTREE_NODE(GTK_CLIST(addrbook.ctree)->row_list)); + addressbook_menuitem_set_sensitive(); gtk_widget_show_all(addrbook.window); } @@ -898,19 +901,14 @@ static void addressbook_del_clicked(GtkButton *button, gpointer data) else if( pobj->type == ADDR_ITEM_GROUP ) { /* Items inside groups */ GList *node; + ItemGroup *group = ADAPTER_GROUP(pobj)->itemGroup; node = _addressListSelection_; while( node ) { AddrItemObject *aio = node->data; node = g_list_next( node ); if( aio->type == ADDR_ITEM_EMAIL ) { ItemEMail *item = ( ItemEMail * ) aio; - ItemPerson *person = ( ItemPerson * ) ADDRITEM_PARENT(item); - item = addrbook_person_remove_email( abf, person, item ); - if( item ) { - addritem_print_item_email( item, stdout ); - addritem_free_item_email( item ); - item = NULL; - } + item = addrbook_group_remove_email( abf, group, item ); } } addressbook_list_select_clear(); @@ -1048,8 +1046,6 @@ static void addressbook_menuitem_set_sensitive(void) { AddressObject *pobj = NULL; AddressObject *obj = NULL; - g_print("addressbook_menuitem_set_sensitive\n"); - addressbook_menubar_set_sensitive( FALSE ); menu_set_insensitive_all(GTK_MENU_SHELL(addrbook.tree_popup)); menu_set_insensitive_all( GTK_MENU_SHELL(addrbook.list_popup) ); |