aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/contact-editor/e-contact-editor-address.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-03-13 13:11:57 +0800
committerChris Toshok <toshok@src.gnome.org>2001-03-13 13:11:57 +0800
commit5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6 (patch)
treebd99fb34b3b95ff1ec4c983bbe721413889fa57d /addressbook/contact-editor/e-contact-editor-address.c
parent8c2f3a00ef98717e4203630c8119f2e84d2bb796 (diff)
downloadgsoc2013-evolution-5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6.tar
gsoc2013-evolution-5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6.tar.gz
gsoc2013-evolution-5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6.tar.bz2
gsoc2013-evolution-5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6.tar.lz
gsoc2013-evolution-5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6.tar.xz
gsoc2013-evolution-5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6.tar.zst
gsoc2013-evolution-5a430e4dcc9cd3b71d7f2f6162d9bb0cd7115ca6.zip
add is_read_only param.
2001-03-12 Chris Toshok <toshok@ximian.com> * gui/widgets/e-minicard.c (supported_fields_cb): add is_read_only param. * gui/widgets/e-minicard-view.c (supported_fields_cb): add is_read_only param. * gui/widgets/e-addressbook-view.c (supported_fields_cb): add is_read_only param. * gui/component/select-names/e-select-names-text-model.c (e_select_names_text_model_activate_obj): add is_read_only param. also, include a little policy here and make it TRUE, as the user shouldn't be editting in this context anyway (imo). * gui/component/addressbook.c (supported_fields_cb): add is_read_only param. * contact-editor/test-editor.c (main): add is_read_only param. * contact-editor/e-contact-editor.c (set_read_only): new function, that either enables or disables all the text fields, combo boxes, and some buttons, depending on the state of is_read_only. (e_contact_editor_class_init): add read/write arg "is_read_only". (full_name_clicked): set the is_read_only of the fullname dialog to the editor's. (full_addr_clicked): same. (e_contact_editor_new): add is_read_only param, that gets set along with the other params. (e_contact_editor_set_arg): add setter for is_read_only. (e_contact_editor_get_arg): add getter for is_read_only. (_phone_arrow_pressed): change TRUE to !editor->is_read_only for entry. (_email_arrow_pressed): same. (_address_arrow_pressed): same. (enable_writable_fields): same. * contact-editor/e-contact-editor-fullname.c (e_contact_editor_fullname_class_init): add read/write arg "is_read_only". (e_contact_editor_fullname_set_arg): add setter for is_read_only that enables/disables all the entries/combos. (e_contact_editor_fullname_get_arg): add getter for is_read_only. * contact-editor/e-contact-editor-fullname.h (struct _EContactEditorFullname): add is_read_only flag. * contact-editor/e-contact-editor-address.c (e_contact_editor_address_class_init): add read/write arg "is_read_only". (e_contact_editor_address_set_arg): add setter for is_read_only that disables/enables all the entries/combos. (e_contact_editor_address_get_arg): add getter for is_read_only. * contact-editor/e-contact-editor-address.h (struct _EContactEditorAddress): add is_read_only flag. svn path=/trunk/; revision=8662
Diffstat (limited to 'addressbook/contact-editor/e-contact-editor-address.c')
-rw-r--r--addressbook/contact-editor/e-contact-editor-address.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/addressbook/contact-editor/e-contact-editor-address.c b/addressbook/contact-editor/e-contact-editor-address.c
index 7df9cb8cb4..1df0462b7d 100644
--- a/addressbook/contact-editor/e-contact-editor-address.c
+++ b/addressbook/contact-editor/e-contact-editor-address.c
@@ -39,7 +39,8 @@ static GnomeDialogClass *parent_class = NULL;
/* The arguments we take */
enum {
ARG_0,
- ARG_ADDRESS
+ ARG_ADDRESS,
+ ARG_IS_READ_ONLY
};
GtkType
@@ -80,6 +81,8 @@ e_contact_editor_address_class_init (EContactEditorAddressClass *klass)
gtk_object_add_arg_type ("EContactEditorAddress::address", GTK_TYPE_POINTER,
GTK_ARG_READWRITE, ARG_ADDRESS);
+ gtk_object_add_arg_type ("EContactEditorAddress::is_read_only", GTK_TYPE_BOOL,
+ GTK_ARG_READWRITE, ARG_IS_READ_ONLY);
object_class->set_arg = e_contact_editor_address_set_arg;
object_class->get_arg = e_contact_editor_address_get_arg;
@@ -146,6 +149,24 @@ e_contact_editor_address_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
e_contact_editor_address->address = e_card_delivery_address_copy(GTK_VALUE_POINTER (*arg));
fill_in_info(e_contact_editor_address);
break;
+ case ARG_IS_READ_ONLY: {
+ int i;
+ char *entry_names[] = {
+ "entry-street",
+ "entry-city",
+ "entry-ext",
+ "entry-po",
+ "entry-region",
+ "combo-country",
+ "entry-code",
+ NULL
+ };
+ e_contact_editor_address->is_read_only = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
+ for (i = 0; entry_names[i] != NULL; i ++) {
+ gtk_widget_set_sensitive (glade_xml_get_widget(e_contact_editor_address->gui, entry_names[i]), !e_contact_editor_address->is_read_only);
+ }
+ break;
+ }
}
}
@@ -161,6 +182,9 @@ e_contact_editor_address_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
extract_info(e_contact_editor_address);
GTK_VALUE_POINTER (*arg) = e_card_delivery_address_copy(e_contact_editor_address->address);
break;
+ case ARG_IS_READ_ONLY:
+ GTK_VALUE_BOOL (*arg) = e_contact_editor_address->is_read_only ? TRUE : FALSE;
+ break;
default:
arg->type = GTK_TYPE_INVALID;
break;