| 43 |
43 |
| 44 #include "gtkconv.h" |
44 #include "gtkconv.h" |
| 45 #include "gtkdialogs.h" |
45 #include "gtkdialogs.h" |
| 46 #include "gtkrequest.h" |
46 #include "gtkrequest.h" |
| 47 #include "gtkutils.h" |
47 #include "gtkutils.h" |
| |
48 #include "pidginaccountchooser.h" |
| 48 #include "pidgincore.h" |
49 #include "pidgincore.h" |
| 49 |
50 |
| 50 /****************************************************************************** |
51 /****************************************************************************** |
| 51 * Enums |
52 * Enums |
| 52 *****************************************************************************/ |
53 *****************************************************************************/ |
| 117 gtk_box_append(GTK_BOX(hbox), vbox2); |
118 gtk_box_append(GTK_BOX(hbox), vbox2); |
| 118 |
119 |
| 119 g_object_set_data(G_OBJECT(vbox2), "main-vbox", vbox); |
120 g_object_set_data(G_OBJECT(vbox2), "main-vbox", vbox); |
| 120 |
121 |
| 121 return vbox2; |
122 return vbox2; |
| 122 } |
|
| 123 |
|
| 124 static void |
|
| 125 aop_option_menu_select_by_data(GtkWidget *optmenu, gpointer data) |
|
| 126 { |
|
| 127 GtkTreeModel *model; |
|
| 128 GtkTreeIter iter; |
|
| 129 gpointer iter_data; |
|
| 130 model = gtk_combo_box_get_model(GTK_COMBO_BOX(optmenu)); |
|
| 131 if (gtk_tree_model_get_iter_first(model, &iter)) { |
|
| 132 do { |
|
| 133 gtk_tree_model_get(model, &iter, AOP_DATA_COLUMN, &iter_data, -1); |
|
| 134 if (iter_data == data) { |
|
| 135 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(optmenu), &iter); |
|
| 136 return; |
|
| 137 } |
|
| 138 } while (gtk_tree_model_iter_next(model, &iter)); |
|
| 139 } |
|
| 140 } |
123 } |
| 141 |
124 |
| 142 void |
125 void |
| 143 pidgin_retrieve_user_info(PurpleConnection *conn, const char *name) { |
126 pidgin_retrieve_user_info(PurpleConnection *conn, const char *name) { |
| 144 PurpleNotifyUserInfo *info = NULL; |
127 PurpleNotifyUserInfo *info = NULL; |
| 230 buddyname_completion_match_selected_cb(G_GNUC_UNUSED GtkEntryCompletion *completion, |
213 buddyname_completion_match_selected_cb(G_GNUC_UNUSED GtkEntryCompletion *completion, |
| 231 GtkTreeModel *model, GtkTreeIter *iter, |
214 GtkTreeModel *model, GtkTreeIter *iter, |
| 232 PidginCompletionData *data) |
215 PidginCompletionData *data) |
| 233 { |
216 { |
| 234 GValue val; |
217 GValue val; |
| 235 GtkWidget *optmenu = data->accountopt; |
218 PurpleAccount *account = NULL; |
| 236 PurpleAccount *account; |
|
| 237 |
219 |
| 238 val.g_type = 0; |
220 val.g_type = 0; |
| 239 gtk_tree_model_get_value(model, iter, COMPLETION_BUDDY_COLUMN, &val); |
221 gtk_tree_model_get_value(model, iter, COMPLETION_BUDDY_COLUMN, &val); |
| 240 gtk_editable_set_text(GTK_EDITABLE(data->entry), g_value_get_string(&val)); |
222 gtk_editable_set_text(GTK_EDITABLE(data->entry), g_value_get_string(&val)); |
| 241 g_value_unset(&val); |
223 g_value_unset(&val); |
| 242 |
224 |
| 243 gtk_tree_model_get_value(model, iter, COMPLETION_ACCOUNT_COLUMN, &val); |
225 gtk_tree_model_get_value(model, iter, COMPLETION_ACCOUNT_COLUMN, &val); |
| 244 account = g_value_get_pointer(&val); |
226 account = g_value_get_pointer(&val); |
| 245 g_value_unset(&val); |
227 g_value_unset(&val); |
| 246 |
228 |
| 247 if (account == NULL) |
229 if(!PURPLE_IS_ACCOUNT(account)) { |
| 248 return TRUE; |
230 return TRUE; |
| 249 |
231 } |
| 250 if (optmenu != NULL) |
232 |
| 251 aop_option_menu_select_by_data(optmenu, account); |
233 if(PIDGIN_IS_ACCOUNT_CHOOSER(data->chooser)) { |
| |
234 pidgin_account_chooser_set_selected(PIDGIN_ACCOUNT_CHOOSER(data->chooser), |
| |
235 account); |
| |
236 } |
| 252 |
237 |
| 253 return TRUE; |
238 return TRUE; |
| 254 } |
239 } |
| 255 |
240 |
| 256 static void |
241 static void |
| 430 store = gtk_list_store_new(COMPLETION_COLUMN_COUNT, G_TYPE_STRING, |
415 store = gtk_list_store_new(COMPLETION_COLUMN_COUNT, G_TYPE_STRING, |
| 431 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, |
416 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, |
| 432 G_TYPE_POINTER); |
417 G_TYPE_POINTER); |
| 433 |
418 |
| 434 data->entry = entry; |
419 data->entry = entry; |
| 435 data->accountopt = chooser; |
420 data->chooser = chooser; |
| 436 if (filter_func == NULL) { |
421 if (filter_func == NULL) { |
| 437 data->filter_func = pidgin_screenname_autocomplete_default_filter; |
422 data->filter_func = pidgin_screenname_autocomplete_default_filter; |
| 438 data->filter_func_user_data = NULL; |
423 data->filter_func_user_data = NULL; |
| 439 } else { |
424 } else { |
| 440 data->filter_func = filter_func; |
425 data->filter_func = filter_func; |