diff options
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/component/addressbook.c | 137 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 2 |
2 files changed, 71 insertions, 68 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 4cc967276a..3826978f64 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -225,73 +225,76 @@ update_command_state (EAddressbookView *eav, AddressbookView *view) uic = bonobo_control_get_ui_component (view->control); - - /* New Contact */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactNew", - "sensitive", - e_addressbook_view_can_create (view->view) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactNewList", - "sensitive", - e_addressbook_view_can_create (view->view) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSaveAsVCard", - "sensitive", - e_addressbook_view_can_save_as (view->view) ? "1" : "0", NULL); - - /* Print Contact */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactsPrint", - "sensitive", - e_addressbook_view_can_print (view->view) ? "1" : "0", NULL); - - /* Print Contact */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactsPrintPreview", - "sensitive", - e_addressbook_view_can_print (view->view) ? "1" : "0", NULL); - - /* Delete Contact */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactDelete", - "sensitive", - e_addressbook_view_can_delete (view->view) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsCut", - "sensitive", - e_addressbook_view_can_cut (view->view) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsCopy", - "sensitive", - e_addressbook_view_can_copy (view->view) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsPaste", - "sensitive", - e_addressbook_view_can_paste (view->view) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSelectAll", - "sensitive", - e_addressbook_view_can_select_all (view->view) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSendContactToOther", - "sensitive", - e_addressbook_view_can_send (view->view) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSendMessageToContact", - "sensitive", - e_addressbook_view_can_send_to (view->view) ? "1" : "0", NULL); - - - /* Stop */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactStop", - "sensitive", - e_addressbook_view_can_stop (view->view) ? "1" : "0", NULL); + if (bonobo_ui_component_get_container (uic) != CORBA_OBJECT_NIL) { + + /* New Contact */ + bonobo_ui_component_set_prop (uic, + "/commands/ContactNew", + "sensitive", + e_addressbook_view_can_create (view->view) ? "1" : "0", NULL); + bonobo_ui_component_set_prop (uic, + "/commands/ContactNewList", + "sensitive", + e_addressbook_view_can_create (view->view) ? "1" : "0", NULL); + + bonobo_ui_component_set_prop (uic, + "/commands/ContactsSaveAsVCard", + "sensitive", + e_addressbook_view_can_save_as (view->view) ? "1" : "0", NULL); + + /* Print Contact */ + bonobo_ui_component_set_prop (uic, + "/commands/ContactsPrint", + "sensitive", + e_addressbook_view_can_print (view->view) ? "1" : "0", NULL); + + /* Print Contact */ + bonobo_ui_component_set_prop (uic, + "/commands/ContactsPrintPreview", + "sensitive", + e_addressbook_view_can_print (view->view) ? "1" : "0", NULL); + + /* Delete Contact */ + bonobo_ui_component_set_prop (uic, + "/commands/ContactDelete", + "sensitive", + e_addressbook_view_can_delete (view->view) ? "1" : "0", NULL); + + bonobo_ui_component_set_prop (uic, + "/commands/ContactsCut", + "sensitive", + e_addressbook_view_can_cut (view->view) ? "1" : "0", NULL); + bonobo_ui_component_set_prop (uic, + "/commands/ContactsCopy", + "sensitive", + e_addressbook_view_can_copy (view->view) ? "1" : "0", NULL); + bonobo_ui_component_set_prop (uic, + "/commands/ContactsPaste", + "sensitive", + e_addressbook_view_can_paste (view->view) ? "1" : "0", NULL); + bonobo_ui_component_set_prop (uic, + "/commands/ContactsSelectAll", + "sensitive", + e_addressbook_view_can_select_all (view->view) ? "1" : "0", NULL); + + bonobo_ui_component_set_prop (uic, + "/commands/ContactsSendContactToOther", + "sensitive", + e_addressbook_view_can_send (view->view) ? "1" : "0", NULL); + + bonobo_ui_component_set_prop (uic, + "/commands/ContactsSendMessageToContact", + "sensitive", + e_addressbook_view_can_send_to (view->view) ? "1" : "0", NULL); + + + /* Stop */ + bonobo_ui_component_set_prop (uic, + "/commands/ContactStop", + "sensitive", + e_addressbook_view_can_stop (view->view) ? "1" : "0", NULL); + + } addressbook_view_unref (view); } diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 8991d8c757..db111b4ac7 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -812,7 +812,7 @@ remodel( EMinicard *e_minicard ) g_free(file_as); } - if ( e_card_evolution_list (e_minicard->card) ) { + if (e_minicard->card && e_card_evolution_list (e_minicard->card) ) { gnome_canvas_item_show (e_minicard->list_icon); } else { |