From 8630605ee31e4ce214d82b8fef8455314c63c5f3 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 25 Mar 2004 04:13:39 +0000 Subject: don't let the user delete their Personal addressbook. This is just a nice 2004-03-24 Chris Toshok * gui/component/addressbook-component.c (fill_popup_menu_callback): don't let the user delete their Personal addressbook. This is just a nice UI thingy.. A similar fix needs to be made to e-d-s. so that attempts that circumvent a nice UI will also fail. svn path=/trunk/; revision=25181 --- addressbook/ChangeLog | 8 ++++++++ addressbook/gui/component/addressbook-component.c | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index b0118fc9e6..55d5f550f8 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,11 @@ +2004-03-24 Chris Toshok + + * gui/component/addressbook-component.c + (fill_popup_menu_callback): don't let the user delete their + Personal addressbook. This is just a nice UI thingy.. A similar + fix needs to be made to e-d-s. so that attempts that circumvent a + nice UI will also fail. + 2004-03-24 Chris Toshok * gui/widgets/eab-gui-util.c (eab_show_multiple_contacts): don't diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 48aef349b3..8109c1e4e6 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -302,11 +302,16 @@ static void fill_popup_menu_callback (ESourceSelector *selector, GtkMenu *menu, AddressbookComponent *comp) { gboolean sensitive; + gboolean local_addressbook; + ESource *selected_source; - sensitive = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (comp->priv->source_selector)) ? TRUE : FALSE; + selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (comp->priv->source_selector)); + sensitive = selected_source ? TRUE : FALSE; + local_addressbook = (!strcmp ("system", e_source_peek_relative_uri (selected_source))); + add_popup_menu_item (menu, _("New Address Book"), NULL, G_CALLBACK (new_addressbook_cb), comp, TRUE); - add_popup_menu_item (menu, _("Delete"), GTK_STOCK_DELETE, G_CALLBACK (delete_addressbook_cb), comp, sensitive); + add_popup_menu_item (menu, _("Delete"), GTK_STOCK_DELETE, G_CALLBACK (delete_addressbook_cb), comp, sensitive && !local_addressbook); add_popup_menu_item (menu, _("Properties..."), NULL, G_CALLBACK (edit_addressbook_cb), comp, sensitive); } -- cgit