aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-06-05 04:53:10 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-06-09 01:14:48 +0800
commitf014ab82c81078d60cb1df8c986305c2cc9948c2 (patch)
treec3bde4e5da923c9ee082fcb994b10c2ce2f61dc2 /addressbook/gui/contact-editor
parent7428fc93d58921bab9968a999172b843af2a2244 (diff)
downloadgsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar
gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.gz
gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.bz2
gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.lz
gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.xz
gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.zst
gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.zip
Coding style and whitespace cleanups.
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c38
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c41
2 files changed, 54 insertions, 25 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index 21eddb14d2..c2dc45304b 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -71,7 +71,9 @@ e_contact_editor_fullname_set_property (GObject *object,
}
break;
case PROP_EDITABLE: {
+ gboolean editable;
gint i;
+
const gchar *widget_names[] = {
"comboentry-title",
"comboentry-suffix",
@@ -85,22 +87,32 @@ e_contact_editor_fullname_set_property (GObject *object,
"label-last",
NULL
};
- e_contact_editor_fullname->editable = g_value_get_boolean (value) ? TRUE : FALSE;
+
+ editable = g_value_get_boolean (value);
+ e_contact_editor_fullname->editable = editable;
+
for (i = 0; widget_names[i] != NULL; i++) {
- GtkWidget *w = e_builder_get_widget (
+ GtkWidget *widget;
+
+ widget = e_builder_get_widget (
e_contact_editor_fullname->builder,
widget_names[i]);
- if (GTK_IS_ENTRY (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (w),
- e_contact_editor_fullname->editable);
- }
- else if (GTK_IS_COMBO_BOX (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (w))),
- e_contact_editor_fullname->editable);
- gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable);
- }
- else if (GTK_IS_LABEL (w)) {
- gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable);
+
+ if (GTK_IS_ENTRY (widget)) {
+ gtk_editable_set_editable (
+ GTK_EDITABLE (widget), editable);
+
+ } else if (GTK_IS_COMBO_BOX (widget)) {
+ GtkWidget *child;
+
+ child = gtk_bin_get_child (GTK_BIN (widget));
+
+ gtk_editable_set_editable (
+ GTK_EDITABLE (child), editable);
+ gtk_widget_set_sensitive (widget, editable);
+
+ } else if (GTK_IS_LABEL (widget)) {
+ gtk_widget_set_sensitive (widget, editable);
}
}
break;
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 1df7b62082..b636190777 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -1787,7 +1787,9 @@ fill_in_im (EContactEditor *editor)
gint slot;
im_name = e_vcard_attribute_get_value (attr);
- slot = alloc_ui_slot (editor, "entry-im-name", get_ui_slot (attr), IM_SLOTS);
+ slot = alloc_ui_slot (
+ editor, "entry-im-name",
+ get_ui_slot (attr), IM_SLOTS);
if (slot < 1)
break;
@@ -1870,7 +1872,8 @@ extract_im (EContactEditor *editor)
e_vcard_attribute_add_value (attr, name);
set_ui_slot (attr, i);
- service_attr_list[service] = g_list_append (service_attr_list[service], attr);
+ service_attr_list[service] = g_list_append (
+ service_attr_list[service], attr);
}
g_free (name);
@@ -2795,7 +2798,8 @@ init_simple (EContactEditor *editor)
gint i;
for (i = 0; i < G_N_ELEMENTS (simple_field_map); i++) {
- widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name);
+ widget = e_builder_get_widget (
+ editor->builder, simple_field_map[i].widget_name);
if (!widget)
continue;
@@ -2829,7 +2833,8 @@ fill_in_simple (EContactEditor *editor)
!simple_field_map[i].process_data)
continue;
- widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name);
+ widget = e_builder_get_widget (
+ editor->builder, simple_field_map[i].widget_name);
if (!widget)
continue;
@@ -2878,7 +2883,8 @@ extract_simple (EContactEditor *editor)
!simple_field_map[i].process_data)
continue;
- widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name);
+ widget = e_builder_get_widget (
+ editor->builder, simple_field_map[i].widget_name);
if (!widget)
continue;
@@ -2899,7 +2905,8 @@ sensitize_simple (EContactEditor *editor)
GtkWidget *widget;
gboolean enabled = TRUE;
- widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name);
+ widget = e_builder_get_widget (
+ editor->builder, simple_field_map[i].widget_name);
if (!widget)
continue;
@@ -3121,15 +3128,23 @@ static void
categories_response (GtkDialog *dialog, gint response, EContactEditor *editor)
{
const gchar *categories;
- GtkWidget *entry = e_builder_get_widget(editor->builder, "entry-categories");
+ GtkWidget *entry;
+
+ entry = e_builder_get_widget (editor->builder, "entry-categories");
if (response == GTK_RESPONSE_OK) {
- categories = e_categories_dialog_get_categories (E_CATEGORIES_DIALOG (dialog));
- if (entry && GTK_IS_ENTRY (entry))
- gtk_entry_set_text (GTK_ENTRY (entry), categories);
+ categories = e_categories_dialog_get_categories (
+ E_CATEGORIES_DIALOG (dialog));
+ if (GTK_IS_ENTRY (entry))
+ gtk_entry_set_text (
+ GTK_ENTRY (entry), categories);
else
- e_contact_set (editor->contact, E_CONTACT_CATEGORIES, (gchar *) categories);
+ e_contact_set (
+ editor->contact,
+ E_CONTACT_CATEGORIES,
+ (gchar *) categories);
}
+
gtk_widget_destroy (GTK_WIDGET (dialog));
editor->categories_dialog = NULL;
}
@@ -4150,7 +4165,9 @@ e_contact_editor_set_property (GObject *object,
break;
if (editor->target_book) {
- g_signal_handler_disconnect (editor->target_book, editor->target_editable_id);
+ g_signal_handler_disconnect (
+ editor->target_book,
+ editor->target_editable_id);
g_object_unref (editor->target_book);
}