diff options
author | Chris Toshok <toshok@ximian.com> | 2004-06-22 05:49:01 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2004-06-22 05:49:01 +0800 |
commit | 3f4b0efb112cdc935ababe0647b0a4906a1d4748 (patch) | |
tree | 57b755876c9df1d0f5b6114b6bdf90418275afaf /addressbook/gui/component/addressbook-view.c | |
parent | 176a9fed3f97941eebbb56e6cd2a8d977e084ad4 (diff) | |
download | gsoc2013-evolution-3f4b0efb112cdc935ababe0647b0a4906a1d4748.tar gsoc2013-evolution-3f4b0efb112cdc935ababe0647b0a4906a1d4748.tar.gz gsoc2013-evolution-3f4b0efb112cdc935ababe0647b0a4906a1d4748.tar.bz2 gsoc2013-evolution-3f4b0efb112cdc935ababe0647b0a4906a1d4748.tar.lz gsoc2013-evolution-3f4b0efb112cdc935ababe0647b0a4906a1d4748.tar.xz gsoc2013-evolution-3f4b0efb112cdc935ababe0647b0a4906a1d4748.tar.zst gsoc2013-evolution-3f4b0efb112cdc935ababe0647b0a4906a1d4748.zip |
remove the auth-entry-notebook in the edit dialog, and rename the auth
2004-06-21 Chris Toshok <toshok@ximian.com>
* gui/component/ldap-config.glade: remove the auth-entry-notebook
in the edit dialog, and rename the auth entry to... auth-entry.
* gui/component/addressbook-config.c (source_to_dialog_new): nuke
- it's identical to source_to_dialog.
(dialog_to_source): we only have one auth entry now. fill it in
properly.
(source_to_dialog): fill in the auth entry properly based on the
auth type, and remove auth_entry_notebook references.
(auth_optionmenu_activated): remove auth_entry_notebook
references.
(setup_general_tab): same, and use auth-entry instead of
email-entry/dn-entry.
(general_tab_check): use auth_principle instead of email/binddn.
(add_folder_modify): same.
(addressbook_add_server_dialog): put setup_connecting_tab inside
the ifdef HAVE_LDAP, and call source_to_dialog instead of
source_to_dialog_new.
(addressbook_config_edit_source): always call setup_general_tab.
* gui/component/addressbook-config.h (AddressbookLDAPScopeType):
reorder to match order in option menu (we should really remove
BASE altogether.. it's useless for searching.)
* gui/component/addressbook-view.c (update_command_state):
macroize this, annoying seeing the same 4 lines repeated 15 times.
svn path=/trunk/; revision=26445
Diffstat (limited to 'addressbook/gui/component/addressbook-view.c')
-rw-r--r-- | addressbook/gui/component/addressbook-view.c | 96 |
1 files changed, 30 insertions, 66 deletions
diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c index d11236e283..149bf3521b 100644 --- a/addressbook/gui/component/addressbook-view.c +++ b/addressbook/gui/component/addressbook-view.c @@ -323,74 +323,31 @@ update_command_state (EABView *eav, AddressbookView *view) uic = bonobo_control_get_ui_component (priv->folder_view_control); if (bonobo_ui_component_get_container (uic) != CORBA_OBJECT_NIL) { - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSaveAsVCard", - "sensitive", - eab_view_can_save_as (eav) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsView", - "sensitive", - eab_view_can_view (eav) ? "1" : "0", NULL); +#define SET_SENSITIVE(verb,f) \ + bonobo_ui_component_set_prop (uic, (verb), "sensitive", (f)(eav) ? "1" : "0", NULL) - /* Print Contact */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactsPrint", - "sensitive", - eab_view_can_print (eav) ? "1" : "0", NULL); + SET_SENSITIVE ("/commands/ContactsSaveAsVCard", eab_view_can_save_as); + SET_SENSITIVE ("/commands/ContactsView", eab_view_can_view); /* Print Contact */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactsPrintPreview", - "sensitive", - eab_view_can_print (eav) ? "1" : "0", NULL); + SET_SENSITIVE ("/commands/ContactsPrint", eab_view_can_print); + SET_SENSITIVE ("/commands/ContactsPrintPreview", eab_view_can_print); /* Delete Contact */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactDelete", - "sensitive", - eab_view_can_delete (eav) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsCut", - "sensitive", - eab_view_can_cut (eav) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsCopy", - "sensitive", - eab_view_can_copy (eav) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsPaste", - "sensitive", - eab_view_can_paste (eav) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSelectAll", - "sensitive", - eab_view_can_select_all (eav) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSendContactToOther", - "sensitive", - eab_view_can_send (eav) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsSendMessageToContact", - "sensitive", - eab_view_can_send_to (eav) ? "1" : "0", NULL); - - bonobo_ui_component_set_prop (uic, - "/commands/ContactsMoveToFolder", - "sensitive", - eab_view_can_move_to_folder (eav) ? "1" : "0", NULL); - bonobo_ui_component_set_prop (uic, - "/commands/ContactsCopyToFolder", - "sensitive", - eab_view_can_copy_to_folder (eav) ? "1" : "0", NULL); + SET_SENSITIVE ("/commands/ContactDelete", eab_view_can_delete); + SET_SENSITIVE ("/commands/ContactsCut", eab_view_can_cut); + + SET_SENSITIVE ("/commands/ContactsCopy", eab_view_can_copy); + SET_SENSITIVE ("/commands/ContactsPaste", eab_view_can_paste); + SET_SENSITIVE ("/commands/ContactsSelectAll", eab_view_can_select_all); + SET_SENSITIVE ("/commands/ContactsSendContactToOther", eab_view_can_send); + SET_SENSITIVE ("/commands/ContactsSendMessageToContact", eab_view_can_send_to); + SET_SENSITIVE ("/commands/ContactsMoveToFolder", eab_view_can_move_to_folder); + SET_SENSITIVE ("/commands/ContactsCopyToFolder", eab_view_can_copy_to_folder); /* Stop */ - bonobo_ui_component_set_prop (uic, - "/commands/ContactStop", - "sensitive", - eab_view_can_stop (eav) ? "1" : "0", NULL); + SET_SENSITIVE ("/commands/ContactStop", eab_view_can_stop); +#undef SET_SENSITIVE } g_object_unref (view); @@ -1149,6 +1106,7 @@ activate_source (AddressbookView *view, /* we don't have a view for this uid already set up. */ GtkWidget *label = gtk_label_new (uid); + GError *error = NULL; uid_view = eab_view_new (); @@ -1175,13 +1133,19 @@ activate_source (AddressbookView *view, g_signal_connect (uid_view, "command_state_change", G_CALLBACK(update_command_state), view); - book = e_book_new (source, NULL); + book = e_book_new (source, &error); - data = g_new (BookOpenData, 1); - data->view = g_object_ref (uid_view); - data->source = g_object_ref (source); + if (book) { + data = g_new (BookOpenData, 1); + data->view = g_object_ref (uid_view); + data->source = g_object_ref (source); - addressbook_load (book, book_open_cb, data); + addressbook_load (book, book_open_cb, data); + } + else { + g_warning ("error loading addressbook : %s", error->message); + g_error_free (error); + } } gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), |