From 442ed02adb1d86a177b465fa656f2148a71230b1 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 25 Nov 2002 04:04:20 +0000 Subject: [ roll forward from the 1.2 branch. fixes #25540, part of #29630, as well 2002-11-23 Chris Toshok [ roll forward from the 1.2 branch. fixes #25540, part of #29630, as well as other selection issues in the contact editor and ACL issues in the ldap backend ] * backend/pas/pas-backend-ldap.c (check_schema_support): reset the schema check state to FALSE if the read returned nothing (and the user had not authenticated). we'll requery if/when they auth. (query_ldap_root_dse): free the schema dn before assigning over it. (pas_backend_ldap_connect): added a diagnostic warning about the root dse query failing in anonymous mode (if it in fact did fail.) (pas_backend_ldap_process_authenticate_user): if we successfully authed, requery the root dse to pick up any attributes that might be protected, and retry the schema query if that failed before. * gui/contact-editor/e-contact-editor.c (full_name_clicked): set the dialog's editable state based on the new field "fullname_editable", and only do the Ok button handling if this flag is TRUE. (full_addr_clicked): set the dialog's editable state based on the editable state for the particular address (from editor->address_editable[]). also, only do the Ok button handling if this flag is TRUE. (_address_arrow_pressed): use the address_editable array to determine whether the address text and the mailing address checkbutton are sensitive. (enable_writable_fields): figure out if fullname_editable is TRUE/FALSE, also, init the address_editable flags based on the field list, and handle the address checkbutton. * gui/contact-editor/fulladdr.glade: change the label names to label- to match {entry,combo}-. * gui/contact-editor/fullname.glade: same. * gui/contact-editor/e-contact-editor-fullname.c (e_contact_editor_fullname_class_init): rename ARG_IS_READ_ONLY to ARG_EDITABLE, to reflect the correct sense of the flag. (e_contact_editor_fullname_set_arg): same, and make the labels sensitive/insensitive depending on the editable state of the dialog. * gui/contact-editor/e-contact-editor-address.c (e_contact_editor_address_class_init): rename ARG_IS_READ_ONLY to ARG_EDITABLE, to reflect the correct sense of the flag. (e_contact_editor_address_set_arg): same, and make the labels sensitive/insensitive depending on the editable state of the dialog. svn path=/trunk/; revision=18910 --- .../gui/contact-editor/e-contact-editor-fullname.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'addressbook/gui/contact-editor/e-contact-editor-fullname.c') diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index bf733b6af1..bd51c71605 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -43,7 +43,7 @@ static GtkDialogClass *parent_class = NULL; enum { PROP_0, PROP_NAME, - PROP_IS_READ_ONLY + PROP_EDITABLE }; GType @@ -89,7 +89,7 @@ e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass) /*_( */"XXX blurb" /*)*/, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_IS_READ_ONLY, + g_object_class_install_property (object_class, PROP_EDITABLE, g_param_spec_boolean ("editable", _("Editable"), /*_( */"XXX blurb" /*)*/, @@ -170,19 +170,24 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id, e_contact_editor_fullname->name = e_card_name_copy(g_value_get_pointer (value)); fill_in_info(e_contact_editor_fullname); break; - case PROP_IS_READ_ONLY: { + case PROP_EDITABLE: { int i; - char *entry_names[] = { + char *widget_names[] = { "combo-title", "combo-suffix", "entry-first", "entry-middle", "entry-last", + "label-title", + "label-suffix", + "label-first", + "label-middle", + "label-last", NULL }; e_contact_editor_fullname->editable = g_value_get_boolean (value) ? TRUE : FALSE; - for (i = 0; entry_names[i] != NULL; i ++) { - GtkWidget *w = glade_xml_get_widget(e_contact_editor_fullname->gui, entry_names[i]); + for (i = 0; widget_names[i] != NULL; i ++) { + GtkWidget *w = glade_xml_get_widget(e_contact_editor_fullname->gui, widget_names[i]); if (GTK_IS_ENTRY (w)) { gtk_entry_set_editable (GTK_ENTRY (w), e_contact_editor_fullname->editable); @@ -192,6 +197,9 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id, e_contact_editor_fullname->editable); gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_fullname->editable); } + else if (GTK_IS_LABEL (w)) { + gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable); + } } break; } @@ -214,7 +222,7 @@ e_contact_editor_fullname_get_property (GObject *object, guint prop_id, extract_info(e_contact_editor_fullname); g_value_set_pointer (value, e_card_name_ref(e_contact_editor_fullname->name)); break; - case PROP_IS_READ_ONLY: + case PROP_EDITABLE: g_value_set_boolean (value, e_contact_editor_fullname->editable ? TRUE : FALSE); break; default: -- cgit v1.2.3