Lines 69-74
Link Here
|
69 |
GtkEntry *search_entry; |
69 |
GtkEntry *search_entry; |
70 |
GtkSizeGroup *button_size_group; |
70 |
GtkSizeGroup *button_size_group; |
71 |
|
71 |
|
|
|
72 |
GtkWidget *combobox_category; |
73 |
|
72 |
GArray *sections; |
74 |
GArray *sections; |
73 |
|
75 |
|
74 |
guint destination_index; |
76 |
guint destination_index; |
Lines 104-115
Link Here
|
104 |
static void |
106 |
static void |
105 |
e_name_selector_dialog_populate_categories (ENameSelectorDialog *name_selector_dialog) |
107 |
e_name_selector_dialog_populate_categories (ENameSelectorDialog *name_selector_dialog) |
106 |
{ |
108 |
{ |
|
|
109 |
ENameSelectorDialogPrivate *priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog); |
107 |
GtkWidget *combo_box; |
110 |
GtkWidget *combo_box; |
108 |
GList *category_list, *iter; |
111 |
GList *category_list, *iter; |
109 |
|
112 |
|
110 |
/* "Any Category" is preloaded. */ |
113 |
/* "Any Category" is preloaded. */ |
111 |
combo_box = GTK_WIDGET (gtk_builder_get_object ( |
114 |
combo_box = priv->combobox_category; |
112 |
name_selector_dialog->priv->gui, "combobox-category")); |
|
|
113 |
if (gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box)) == -1) |
115 |
if (gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box)) == -1) |
114 |
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); |
116 |
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); |
115 |
|
117 |
|
Lines 117-123
Link Here
|
117 |
category_list = e_categories_get_list (); |
119 |
category_list = e_categories_get_list (); |
118 |
for (iter = category_list; iter != NULL; iter = iter->next) |
120 |
for (iter = category_list; iter != NULL; iter = iter->next) |
119 |
gtk_combo_box_text_append_text ( |
121 |
gtk_combo_box_text_append_text ( |
120 |
GTK_COMBO_BOX (combo_box), iter->data); |
122 |
GTK_COMBO_BOX_TEXT (combo_box), iter->data); |
121 |
g_list_free (category_list); |
123 |
g_list_free (category_list); |
122 |
|
124 |
|
123 |
g_signal_connect_swapped ( |
125 |
g_signal_connect_swapped ( |
Lines 136-141
Link Here
|
136 |
GtkWidget *content_area; |
138 |
GtkWidget *content_area; |
137 |
GtkWidget *label; |
139 |
GtkWidget *label; |
138 |
GtkWidget *parent; |
140 |
GtkWidget *parent; |
|
|
141 |
GtkWidget *show_contacts_table; |
142 |
GtkWidget *combobox_category; |
139 |
GtkTreeSelection *selection; |
143 |
GtkTreeSelection *selection; |
140 |
ESourceList *source_list; |
144 |
ESourceList *source_list; |
141 |
gchar *uifile; |
145 |
gchar *uifile; |
Lines 179-184
Link Here
|
179 |
return; |
183 |
return; |
180 |
} |
184 |
} |
181 |
|
185 |
|
|
|
186 |
/* Need access to the container table to be able to drop the new combo box in it */ |
187 |
show_contacts_table = GTK_WIDGET (gtk_builder_get_object ( |
188 |
name_selector_dialog->priv->gui, "show_contacts_table")); |
189 |
|
190 |
/* Build the category dropdown independently, it's easier for GtkComboBoxText types */ |
191 |
combobox_category = gtk_combo_box_text_new (); |
192 |
gtk_widget_show (combobox_category); |
193 |
gtk_table_attach (GTK_TABLE (show_contacts_table), combobox_category, 1, 2, 1, 2, |
194 |
(GtkAttachOptions) (GTK_FILL), |
195 |
(GtkAttachOptions) (GTK_FILL), 0, 0); |
196 |
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox_category), |
197 |
_("Any Category")); |
198 |
|
182 |
/* Get addressbook sources */ |
199 |
/* Get addressbook sources */ |
183 |
|
200 |
|
184 |
if (!e_book_get_addressbooks (&source_list, NULL)) { |
201 |
if (!e_book_get_addressbooks (&source_list, NULL)) { |
Lines 212-217
Link Here
|
212 |
name_selector_dialog->priv->search_entry = GTK_ENTRY ( |
229 |
name_selector_dialog->priv->search_entry = GTK_ENTRY ( |
213 |
gtk_builder_get_object ( |
230 |
gtk_builder_get_object ( |
214 |
name_selector_dialog->priv->gui, "search")); |
231 |
name_selector_dialog->priv->gui, "search")); |
|
|
232 |
name_selector_dialog->priv->combobox_category = combobox_category; |
215 |
|
233 |
|
216 |
/* Create size group for transfer buttons */ |
234 |
/* Create size group for transfer buttons */ |
217 |
|
235 |
|
Lines 876-887
Link Here
|
876 |
gchar *category_escaped; |
894 |
gchar *category_escaped; |
877 |
gchar *user_fields_str; |
895 |
gchar *user_fields_str; |
878 |
|
896 |
|
879 |
combo_box = GTK_WIDGET (gtk_builder_get_object ( |
897 |
combo_box = priv->combobox_category; |
880 |
name_selector_dialog->priv->gui, "combobox-category")); |
|
|
881 |
if (gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box)) == -1) |
898 |
if (gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box)) == -1) |
882 |
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); |
899 |
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); |
883 |
|
900 |
|
884 |
category = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX (combo_box)); |
901 |
category = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_box)); |
885 |
category_escaped = escape_sexp_string (category); |
902 |
category_escaped = escape_sexp_string (category); |
886 |
|
903 |
|
887 |
text = gtk_entry_get_text (name_selector_dialog->priv->search_entry); |
904 |
text = gtk_entry_get_text (name_selector_dialog->priv->search_entry); |