From 3ee80c90378847641cd59eb21600a0f940ca6b7f Mon Sep 17 00:00:00 2001 From: Christian Schaarschmidt Date: Mon, 8 Sep 2014 11:45:33 +0200 Subject: Bug 736123 - Refactor contact-editor: use GtkExpander instead of custom code This change also includes preparation for bug 319195 - Contact dialog appallingly overcrowded --- addressbook/gui/contact-editor/contact-editor.ui | 442 +++++++-------------- addressbook/gui/contact-editor/e-contact-editor.c | 434 +++++++++----------- .../org.gnome.evolution.addressbook.gschema.xml.in | 100 +++++ 3 files changed, 439 insertions(+), 537 deletions(-) diff --git a/addressbook/gui/contact-editor/contact-editor.ui b/addressbook/gui/contact-editor/contact-editor.ui index d4ae442f49..9ccb3e8ad9 100644 --- a/addressbook/gui/contact-editor/contact-editor.ui +++ b/addressbook/gui/contact-editor/contact-editor.ui @@ -307,49 +307,12 @@ vertical 10 - + True - 0 - none - - - - True - 12 - vertical - 6 - - - - True - - - 0 - - - - - - _Wants to receive HTML mail - True - True - False - True - True - - - 1 - - - - - - - - + + True - 4 - + True Email @@ -357,37 +320,44 @@ + + + + 0 + + + + + True + 12 + vertical + 6 + + + True + - False - False 0 - - 20 - 20 + + _Wants to receive HTML mail True True False - none - - - Email - - - - - True - none - - + True + True 1 + + 1 + @@ -397,83 +367,42 @@ - + True - vertical - + True - 0 - none - - - True - 12 - vertical - 6 - - - - True - - - 0 - - - - - - - + True - 4 - - - True - Telephone - - - - - - False - False - 0 - - - - - 20 - 20 - True - True - False - none - - - Telephone - - - - - True - none - - - - - 1 - - + Telephone + + + - False 0 + + + True + 12 + vertical + 6 + + + True + + + 1 + + + + False @@ -481,75 +410,45 @@ - + True - 0 - none - - - + + + True + + True - 12 - vertical - 6 - - - - True - - - 0 - - - - + SIP Address + + + + - - - + + + 0 + + + + + True + 12 + vertical + 6 + + True - 4 - - - True - SIP Address - - - - - - False - False - 0 - - - - - 20 - 20 - True - True - False - none - - - SIP Address - - - - - True - none - - - - - 1 - - + + 0 + - + + + 1 + + False @@ -557,75 +456,45 @@ - + True - 0 - none - - - + + + True + + True - 12 - vertical - 6 - - - - True - - - 0 - - - - + Instant Messaging + + + + - - - + + + 0 + + + + + True + 12 + vertical + 6 + + True - 4 - - - True - Instant Messaging - - - - - - False - False - 0 - - - - - 20 - 20 - True - True - False - none - - - Instant Messaging - - - - - True - none - - - - - 1 - - + + 0 + - + + + 1 + + False @@ -653,7 +522,7 @@ - + True True automatic @@ -670,12 +539,10 @@ True 12 vertical - 12 + 0 - + True - 0 - none True @@ -844,45 +711,12 @@ - + True - 4 - - - True - Web Addresses - - - - - - 0 - - - - - 20 - 20 - True - True - False - none - - - Web addresses - - - - - True - none - - - - - 1 - - + Web Addresses + + + @@ -892,10 +726,8 @@ - + True - 0 - none True @@ -1302,7 +1134,7 @@ - + True True automatic @@ -1319,11 +1151,13 @@ True vertical - + True 6 0 none + FALSE + GTK_ALIGN_START True @@ -1558,14 +1392,18 @@ 0 + FALSE + FALSE - + True 6 0 none + FALSE + GTK_ALIGN_START True @@ -1800,6 +1638,8 @@ 1 + FALSE + FALSE @@ -1807,6 +1647,8 @@ True True 6 + FALSE + GTK_ALIGN_START True @@ -2041,6 +1883,8 @@ 2 + FALSE + FALSE @@ -2063,7 +1907,7 @@ - + True True 12 diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index f8021d2292..d8c15a483f 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -1092,166 +1092,40 @@ sensitize_email (EContactEditor *editor) } static void -set_arrow_image (EContactEditor *editor, - const gchar *arrow_widget, - gboolean expanded) +row_added_cb (GtkExpander *expander) { - GtkWidget *arrow; - - arrow = e_builder_get_widget (editor->priv->builder, arrow_widget); - if (expanded) - gtk_arrow_set ( - GTK_ARROW (arrow), GTK_ARROW_DOWN, GTK_SHADOW_NONE); - else - gtk_arrow_set ( - GTK_ARROW (arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE); -} - -static gboolean -is_arrow_image_arrow_down (EContactEditor *editor, - const gchar *arrow_widget) -{ - GtkWidget *arrow; - gint value; - - arrow = e_builder_get_widget (editor->priv->builder, arrow_widget); - g_object_get (arrow, "arrow-type", &value, NULL); - - if (value == GTK_ARROW_DOWN) - return TRUE; - - return FALSE; -} - -static void -expand_widget_list (EContactEditor *editor, - const gchar **widget_names, - gboolean expanded) -{ - gint i; - for (i = 0; widget_names[i]; i++) - gtk_widget_set_visible ( - e_builder_get_widget (editor->priv->builder, widget_names[i]), - expanded); -} - -static void -expand_web (EContactEditor *editor, - gboolean expanded) -{ - const gchar *names[] = { - "label-videourl", "label-fburl", - "entry-videourl", "entry-fburl", - NULL - }; - set_arrow_image (editor, "arrow-web-expand", expanded); - expand_widget_list (editor, names, expanded); -} - -static void -expand_phone (EContactEditor *editor, - gboolean expanded) -{ - GtkWidget *w; - EContactEditorDynTable *dyntable; - - set_arrow_image (editor, "arrow-phone-expand", expanded); - - w = e_builder_get_widget (editor->priv->builder, "phone-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); - - if (expanded) - e_contact_editor_dyntable_set_show_max (dyntable, PHONE_SLOTS); - else - e_contact_editor_dyntable_set_show_max (dyntable, SLOTS_IN_COLLAPSED_STATE); -} - -static void -expand_sip (EContactEditor *editor, - gboolean expanded) -{ - GtkWidget *w; - EContactEditorDynTable *dyntable; - - set_arrow_image (editor, "arrow-sip-expand", expanded); - - w = e_builder_get_widget (editor->priv->builder, "sip-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); - - if (expanded) - e_contact_editor_dyntable_set_show_max (dyntable, SIP_SLOTS); - else - e_contact_editor_dyntable_set_show_max (dyntable, SLOTS_IN_COLLAPSED_STATE); -} - -static void -expand_im (EContactEditor *editor, - gboolean expanded) -{ - GtkWidget *w; - EContactEditorDynTable *dyntable; - - set_arrow_image (editor, "arrow-im-expand", expanded); - - w = e_builder_get_widget (editor->priv->builder, "im-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); - - if (expanded) - e_contact_editor_dyntable_set_show_max (dyntable, IM_SLOTS); - else - e_contact_editor_dyntable_set_show_max (dyntable, SLOTS_IN_COLLAPSED_STATE); -} - -static void -expand_mail (EContactEditor *editor, - gboolean expanded) -{ - GtkWidget *w; - EContactEditorDynTable *dyntable; - - set_arrow_image (editor, "arrow-mail-expand", expanded); - - w = e_builder_get_widget (editor->priv->builder, "mail-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); - - if (expanded) - e_contact_editor_dyntable_set_show_max (dyntable, EMAIL_SLOTS); - else - e_contact_editor_dyntable_set_show_max (dyntable, SLOTS_IN_COLLAPSED_STATE); -} - -static void -row_added_mail (EContactEditorDynTable *dyntable, EContactEditor *editor) -{ - expand_mail (editor, TRUE); + /* newly added row is always visible, setting expanded=true */ + gtk_expander_set_expanded (expander, TRUE); } static void init_email (EContactEditor *editor) { - GtkWidget *w; EContactEditorDynTable *dyntable; + GtkExpander *expander; - w = e_builder_get_widget (editor->priv->builder, "mail-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); + expander = GTK_EXPANDER ( + e_builder_get_widget (editor->priv->builder, "expander-contact-email")); + dyntable = E_CONTACT_EDITOR_DYNTABLE ( + e_builder_get_widget (editor->priv->builder, "mail-dyntable")); e_contact_editor_dyntable_set_max_entries (dyntable, EMAIL_SLOTS); e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE); e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE); g_signal_connect ( - w, "changed", + dyntable, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped ( - w, "activate", + dyntable, "activate", G_CALLBACK (entry_activated), editor); - g_signal_connect ( - w, "row-added", - G_CALLBACK (row_added_mail), editor); + g_signal_connect_swapped ( + dyntable, "row-added", + G_CALLBACK (row_added_cb), expander); init_email_record_location (editor); - expand_mail (editor, TRUE); + gtk_expander_set_expanded (expander, TRUE); } static void @@ -1401,38 +1275,34 @@ init_phone_record_type (EContactEditor *editor) e_contact_editor_dyntable_set_combo_defaults (dyntable, phones_default, G_N_ELEMENTS (phones_default)); } -static void -row_added_phone (EContactEditorDynTable *dyntable, EContactEditor *editor) -{ - expand_phone (editor, TRUE); -} - static void init_phone (EContactEditor *editor) { - GtkWidget *w; EContactEditorDynTable *dyntable; + GtkExpander *expander; - w = e_builder_get_widget (editor->priv->builder, "phone-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); + expander = GTK_EXPANDER ( + e_builder_get_widget (editor->priv->builder, "expander-contact-phone")); + dyntable = E_CONTACT_EDITOR_DYNTABLE ( + e_builder_get_widget (editor->priv->builder, "phone-dyntable")); e_contact_editor_dyntable_set_max_entries (dyntable, PHONE_SLOTS); e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE); e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE); g_signal_connect ( - w, "changed", + dyntable, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped ( - w, "activate", + dyntable, "activate", G_CALLBACK (entry_activated), editor); - g_signal_connect ( - w, "row-added", - G_CALLBACK (row_added_phone), editor); + g_signal_connect_swapped ( + dyntable, "row-added", + G_CALLBACK (row_added_cb), expander); init_phone_record_type (editor); - expand_phone (editor, TRUE); + gtk_expander_set_expanded (expander, TRUE); } static void @@ -1629,39 +1499,34 @@ init_sip_record_type (EContactEditor *editor) e_contact_editor_dyntable_set_combo_defaults (dyntable, sips_default, G_N_ELEMENTS (sips_default)); } -static void -row_added_sip (EContactEditorDynTable *dyntable, - EContactEditor *editor) -{ - expand_sip (editor, TRUE); -} - static void init_sip (EContactEditor *editor) { - GtkWidget *w; EContactEditorDynTable *dyntable; + GtkExpander *expander; - w = e_builder_get_widget (editor->priv->builder, "sip-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); + expander = GTK_EXPANDER ( + e_builder_get_widget (editor->priv->builder, "expander-contact-sip")); + dyntable = E_CONTACT_EDITOR_DYNTABLE ( + e_builder_get_widget (editor->priv->builder, "sip-dyntable")); e_contact_editor_dyntable_set_max_entries (dyntable, SIP_SLOTS); e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE); e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE); g_signal_connect ( - w, "changed", + dyntable, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped ( - w, "activate", + dyntable, "activate", G_CALLBACK (entry_activated), editor); - g_signal_connect ( - w, "row-added", - G_CALLBACK (row_added_sip), editor); + g_signal_connect_swapped ( + dyntable, "row-added", + G_CALLBACK (row_added_cb), expander); init_sip_record_type (editor); - expand_sip (editor, TRUE); + gtk_expander_set_expanded (expander, TRUE); } static void @@ -1713,12 +1578,6 @@ sensitize_sip (EContactEditor *editor) sensitize_sip_types (editor); } -static void -row_added_im (EContactEditorDynTable *dyntable, EContactEditor *editor) -{ - expand_im (editor, TRUE); -} - static void init_im_record_type (EContactEditor *editor) { @@ -1749,29 +1608,31 @@ init_im_record_type (EContactEditor *editor) static void init_im (EContactEditor *editor) { - GtkWidget *w; EContactEditorDynTable *dyntable; + GtkExpander *expander; - w = e_builder_get_widget (editor->priv->builder, "im-dyntable"); - dyntable = E_CONTACT_EDITOR_DYNTABLE (w); + expander = GTK_EXPANDER ( + e_builder_get_widget (editor->priv->builder, "expander-contact-im")); + dyntable = E_CONTACT_EDITOR_DYNTABLE ( + e_builder_get_widget (editor->priv->builder, "im-dyntable")); e_contact_editor_dyntable_set_max_entries (dyntable, IM_SLOTS); e_contact_editor_dyntable_set_num_columns (dyntable, SLOTS_PER_LINE, TRUE); e_contact_editor_dyntable_set_show_min (dyntable, SLOTS_IN_COLLAPSED_STATE); g_signal_connect ( - w, "changed", + dyntable, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped ( - w, "activate", + dyntable, "activate", G_CALLBACK (entry_activated), editor); - g_signal_connect ( - w, "row-added", - G_CALLBACK (row_added_im), editor); + g_signal_connect_swapped ( + dyntable, "row-added", + G_CALLBACK (row_added_cb), expander); init_im_record_type (editor); - expand_im (editor, TRUE); + gtk_expander_set_expanded (expander, TRUE); } static void @@ -1971,17 +1832,6 @@ sensitize_im (EContactEditor *editor) sensitize_im_types (editor); } -static void -init_personal (EContactEditor *editor) -{ - gtk_expander_set_expanded ( - GTK_EXPANDER (e_builder_get_widget ( - editor->priv->builder, "expander-personal-misc")), - !editor->priv->compress_ui); - - expand_web (editor, !editor->priv->compress_ui); -} - static void init_address_textview (EContactEditor *editor, gint record) @@ -2042,11 +1892,6 @@ init_address (EContactEditor *editor) for (i = 0; i < ADDRESS_SLOTS; i++) init_address_record (editor, i); - - gtk_expander_set_expanded ( - GTK_EXPANDER (e_builder_get_widget ( - editor->priv->builder, "expander-address-other")), - !editor->priv->compress_ui); } static void @@ -2952,6 +2797,52 @@ sensitize_simple (EContactEditor *editor) } } +static void +configure_expander_state (EContactEditor *editor, + GSettings *settings, + const gchar *widget, + const gchar *settings_key) +{ + GtkExpander *expander; + gboolean expand; + + expander = GTK_EXPANDER (e_builder_get_widget (editor->priv->builder, widget)); + expand = g_settings_get_boolean (settings, settings_key); + gtk_expander_set_expanded (expander, expand); +} + +static void +configure_expander_initial_state (EContactEditor *editor) +{ + if (editor->priv->compress_ui) { + GtkBuilder *builder = editor->priv->builder; + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-contact-email")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-contact-phone")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-contact-phone")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-contact-sip")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-contact-im")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-personal-web")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-personal-job")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-personal-misc")), FALSE); + gtk_expander_set_expanded (GTK_EXPANDER (e_builder_get_widget (builder, "expander-address-other")), FALSE); + } else { + GSettings *settings = g_settings_new ("org.gnome.evolution.addressbook"); + + configure_expander_state (editor, settings, "expander-contact-email", "editor-expand-contact-email"); + configure_expander_state (editor, settings, "expander-contact-phone", "editor-expand-contact-phone"); + configure_expander_state (editor, settings, "expander-contact-sip", "editor-expand-contact-sip"); + configure_expander_state (editor, settings, "expander-contact-im", "editor-expand-contact-im"); + + configure_expander_state (editor, settings, "expander-personal-web", "editor-expand-personal-web"); + configure_expander_state (editor, settings, "expander-personal-job", "editor-expand-personal-job"); + configure_expander_state (editor, settings, "expander-personal-misc", "editor-expand-personal-misc"); + + configure_expander_state (editor, settings, "expander-address-other", "editor-expand-mailing-other"); + + g_object_unref (settings); + } +} + static void fill_in_all (EContactEditor *editor) { @@ -2975,6 +2866,11 @@ fill_in_all (EContactEditor *editor) fill_in_im (editor); fill_in_address (editor); + /* set expander state after dyntables have been filled, + * otherwise dyntable and expander can get out of synch + */ + configure_expander_initial_state (editor); + if (weak_pointer) { g_object_remove_weak_pointer (G_OBJECT (focused_widget), &weak_pointer); gtk_widget_grab_focus (focused_widget); @@ -3021,6 +2917,44 @@ sensitize_all (EContactEditor *editor) } } +static void +configure_widget_visibility (EContactEditor *editor, + GSettings *settings, + const gchar *widget_name, + const gchar *settings_name) +{ + gboolean is_visible; + GtkWidget *widget; + + is_visible = g_settings_get_boolean (settings, settings_name); + widget = e_builder_get_widget (editor->priv->builder, widget_name); + gtk_widget_set_visible (widget, is_visible); +} + +static void +configure_visibility (EContactEditor *editor) +{ + GSettings *settings = g_settings_new ("org.gnome.evolution.addressbook"); + + configure_widget_visibility (editor, settings, "vbox-contact-phone", "editor-show-contact-phone"); + configure_widget_visibility (editor, settings, "vbox-contact-sip", "editor-show-contact-sip"); + configure_widget_visibility (editor, settings, "vbox-contact-im", "editor-show-contact-im"); + + configure_widget_visibility (editor, settings, "scrolledwindow-mailing", "editor-show-mailing-tab"); + configure_widget_visibility (editor, settings, "frame-mailing-home", "editor-show-mailing-home"); + configure_widget_visibility (editor, settings, "frame-mailing-work", "editor-show-mailing-work"); + configure_widget_visibility (editor, settings, "expander-address-other", "editor-show-mailing-other"); + + configure_widget_visibility (editor, settings, "scrolledwindow-personal", "editor-show-personal-tab"); + configure_widget_visibility (editor, settings, "expander-personal-web", "editor-show-personal-web"); + configure_widget_visibility (editor, settings, "expander-personal-job", "editor-show-personal-job"); + configure_widget_visibility (editor, settings, "expander-personal-misc", "editor-show-personal-misc"); + + configure_widget_visibility (editor, settings, "scrolledwindow-notes", "editor-show-notes-tab"); + + g_object_unref (settings); +} + static void init_all (EContactEditor *editor) { @@ -3034,9 +2968,10 @@ init_all (EContactEditor *editor) init_phone (editor); init_sip (editor); init_im (editor); - init_personal (editor); init_address (editor); + configure_visibility (editor); + /* with so many scrolled windows, we need to * do some manual sizing */ requisition.width = -1; @@ -4044,36 +3979,56 @@ setup_tab_order (GtkBuilder *builder) } static void -expand_web_toggle (EContactEditor *ce) +expand_dyntable (GtkExpander *expander, + EContactEditorDynTable *dyntable, + gint max_slots) { - GtkWidget *widget; - - widget = e_builder_get_widget (ce->priv->builder, "label-videourl"); - expand_web (ce, !gtk_widget_get_visible (widget)); + if (gtk_expander_get_expanded (expander)) { + e_contact_editor_dyntable_set_show_max (dyntable, max_slots); + } else { + e_contact_editor_dyntable_set_show_max (dyntable, + SLOTS_IN_COLLAPSED_STATE); + } } static void -expand_phone_toggle (EContactEditor *ce) +expander_contact_mail_cb (GObject *object, + GParamSpec *param_spec, + gpointer user_data) { - expand_phone (ce, !is_arrow_image_arrow_down (ce, "arrow-phone-expand")); + expand_dyntable (GTK_EXPANDER (object), + E_CONTACT_EDITOR_DYNTABLE (user_data), + EMAIL_SLOTS); } static void -expand_sip_toggle (EContactEditor *ce) +expander_contact_phone_cb (GObject *object, + GParamSpec *param_spec, + gpointer user_data) { - expand_sip (ce, !is_arrow_image_arrow_down (ce, "arrow-sip-expand")); + expand_dyntable (GTK_EXPANDER (object), + E_CONTACT_EDITOR_DYNTABLE (user_data), + PHONE_SLOTS); } static void -expand_im_toggle (EContactEditor *ce) +expander_contact_sip_cb (GObject *object, + GParamSpec *param_spec, + gpointer user_data) { - expand_im (ce, !is_arrow_image_arrow_down (ce, "arrow-im-expand")); + expand_dyntable (GTK_EXPANDER (object), + E_CONTACT_EDITOR_DYNTABLE (user_data), + SIP_SLOTS); } static void -expand_mail_toggle (EContactEditor *ce) +expander_contact_im_cb (GObject *object, + GParamSpec *param_spec, + gpointer user_data) { - expand_mail (ce, !is_arrow_image_arrow_down (ce, "arrow-mail-expand")); + expand_dyntable (GTK_EXPANDER (object), + E_CONTACT_EDITOR_DYNTABLE (user_data), + IM_SLOTS); } static void @@ -4097,7 +4052,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) EShell *shell; EClientCache *client_cache; GtkWidget *container; - GtkWidget *widget, *label; + GtkWidget *widget, *label, *dyntable; GtkEntryCompletion *completion; e_contact_editor->priv = G_TYPE_INSTANCE_GET_PRIVATE ( @@ -4188,31 +4143,34 @@ e_contact_editor_init (EContactEditor *e_contact_editor) g_signal_connect ( widget, "clicked", G_CALLBACK (show_help_cb), e_contact_editor); + widget = e_builder_get_widget ( - e_contact_editor->priv->builder, "button-web-expand"); - g_signal_connect_swapped ( - widget, "clicked", - G_CALLBACK (expand_web_toggle), e_contact_editor); - widget = e_builder_get_widget ( - e_contact_editor->priv->builder, "button-phone-expand"); - g_signal_connect_swapped ( - widget, "clicked", - G_CALLBACK (expand_phone_toggle), e_contact_editor); + e_contact_editor->priv->builder, "expander-contact-phone"); + dyntable = e_builder_get_widget ( + e_contact_editor->priv->builder, "phone-dyntable"); + g_signal_connect (widget, "notify::expanded", + G_CALLBACK (expander_contact_phone_cb), dyntable); + widget = e_builder_get_widget ( - e_contact_editor->priv->builder, "button-sip-expand"); - g_signal_connect_swapped ( - widget, "clicked", - G_CALLBACK (expand_sip_toggle), e_contact_editor); + e_contact_editor->priv->builder, "expander-contact-sip"); + dyntable = e_builder_get_widget ( + e_contact_editor->priv->builder, "sip-dyntable"); + g_signal_connect (widget, "notify::expanded", + G_CALLBACK (expander_contact_sip_cb), dyntable); + widget = e_builder_get_widget ( - e_contact_editor->priv->builder, "button-im-expand"); - g_signal_connect_swapped ( - widget, "clicked", - G_CALLBACK (expand_im_toggle), e_contact_editor); + e_contact_editor->priv->builder, "expander-contact-im"); + dyntable = e_builder_get_widget ( + e_contact_editor->priv->builder, "im-dyntable"); + g_signal_connect (widget, "notify::expanded", + G_CALLBACK (expander_contact_im_cb), dyntable); + widget = e_builder_get_widget ( - e_contact_editor->priv->builder, "button-mail-expand"); - g_signal_connect_swapped ( - widget, "clicked", - G_CALLBACK (expand_mail_toggle), e_contact_editor); + e_contact_editor->priv->builder, "expander-contact-email"); + dyntable = e_builder_get_widget ( + e_contact_editor->priv->builder, "mail-dyntable"); + g_signal_connect (widget, "notify::expanded", + G_CALLBACK (expander_contact_mail_cb), dyntable); widget = e_builder_get_widget ( e_contact_editor->priv->builder, "entry-fullname"); diff --git a/data/org.gnome.evolution.addressbook.gschema.xml.in b/data/org.gnome.evolution.addressbook.gschema.xml.in index 0dcaeddbe0..51653c4430 100644 --- a/data/org.gnome.evolution.addressbook.gschema.xml.in +++ b/data/org.gnome.evolution.addressbook.gschema.xml.in @@ -50,5 +50,105 @@ <_summary>Show preview pane <_description>Whether to show the preview pane. + + true + <_summary>Expand Contact-Tab / Email Section + <_description>Defines the initial state of the Email Section + + + true + <_summary>Expand Contact-Tab / Phone Section + <_description>Defines the initial state of the Phone Section + + + true + <_summary>Expand Contact-Tab / SIP Section + <_description>Defines the initial state of the SIP Section + + + true + <_summary>Expand Contact-Tab / IM Section + <_description>Defines the initial state of the IM Section + + + true + <_summary>Expand Personal-Tab / Web Section + <_description>Defines the initial state of the Web Address Section + + + true + <_summary>Expand Personal-Tab / Job Section + <_description>Defines the initial state of the Job Section + + + true + <_summary>Expand Personal-Tab / Miscellaneous Section + <_description>Defines the initial state of the Miscellaneous Section + + + true + <_summary>Expand Mailing-Tab / Other Section + <_description>Defines the initial state of the Other Address Section + + + <_default>true + Show phone numbers + <_description>Whether to show phone numbers in the editor + + + <_default>true + Show SIP addresses + <_description>Whether to show SIP addresses in the editor + + + <_default>true + Show IM addresses + <_description>Whether to show IM addresses in the editor + + + <_default>true + Show mailing addresses + <_description>Whether to show mailing addresses tab (home, work, other) in the editor + + + <_default>true + Show mailing Home addresses + <_description>Whether to show mailing Home addresses in the editor + + + <_default>true + Show mailing Work addresses + <_description>Whether to show mailing addresses Work in the editor + + + <_default>true + Show mailing Other addresses + <_description>Whether to show mailing addresses Other in the editor + + + <_default>true + Show personal information + <_description>Whether to show personal information tab (Web Address, Job, Misc.) in the editor + + + <_default>true + Show web addresses + <_description>Whether to show Web Addresses in the editor + + + <_default>true + Show job information + <_description>Whether to show job information in the editor + + + <_default>true + Show Miscellaneous information + <_description>Whether to show Miscellaneous information in the editor + + + <_default>true + Show notes-tab + <_description>Whether to show notes in the editor + -- cgit v1.2.3