| 35 #include "gtkprivacy.h" |
35 #include "gtkprivacy.h" |
| 36 #include "gtkroomlist.h" |
36 #include "gtkroomlist.h" |
| 37 #include "gtkutils.h" |
37 #include "gtkutils.h" |
| 38 #include "pidgin/pidginaccountchooser.h" |
38 #include "pidgin/pidginaccountchooser.h" |
| 39 #include "pidgin/pidginaccountfilterconnected.h" |
39 #include "pidgin/pidginaccountfilterconnected.h" |
| 40 #include "pidgin/pidginaccountstore.h" |
|
| 41 #include "pidgin/pidginactiongroup.h" |
40 #include "pidgin/pidginactiongroup.h" |
| 42 #include "pidgin/pidginaddbuddydialog.h" |
41 #include "pidgin/pidginaddbuddydialog.h" |
| 43 #include "pidgin/pidginaddchatdialog.h" |
42 #include "pidgin/pidginaddchatdialog.h" |
| 44 #include "pidgin/pidgincontactlistwindow.h" |
43 #include "pidgin/pidgincontactlistwindow.h" |
| 45 #include "pidgin/pidgincore.h" |
44 #include "pidgin/pidgincore.h" |
| 993 GtkWidget *img; |
992 GtkWidget *img; |
| 994 GtkWidget *content_area; |
993 GtkWidget *content_area; |
| 995 GtkWidget *hbox; |
994 GtkWidget *hbox; |
| 996 GtkWidget *vbox; |
995 GtkWidget *vbox; |
| 997 GtkWindow *blist_window; |
996 GtkWindow *blist_window; |
| 998 GtkTreeModel *model = NULL, *filter = NULL; |
997 GtkEveryFilter *every = NULL; |
| 999 GtkCustomFilter *custom_filter = NULL; |
998 GtkFilter *filter = NULL; |
| 1000 PidginBuddyList *gtkblist; |
999 PidginBuddyList *gtkblist; |
| 1001 |
1000 |
| 1002 data->account = account; |
1001 data->account = account; |
| 1003 |
1002 |
| 1004 gtkblist = PIDGIN_BUDDY_LIST(purple_blist_get_default()); |
1003 gtkblist = PIDGIN_BUDDY_LIST(purple_blist_get_default()); |
| 1032 gtk_label_set_yalign(GTK_LABEL(label), 0); |
1031 gtk_label_set_yalign(GTK_LABEL(label), 0); |
| 1033 gtk_box_append(GTK_BOX(vbox), label); |
1032 gtk_box_append(GTK_BOX(vbox), label); |
| 1034 |
1033 |
| 1035 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1034 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 1036 |
1035 |
| 1037 model = GTK_TREE_MODEL(pidgin_account_store_new()); |
|
| 1038 filter = pidgin_account_filter_connected_new(model, NULL); |
|
| 1039 g_object_unref(G_OBJECT(model)); |
|
| 1040 data->account_menu = pidgin_account_chooser_new(); |
1036 data->account_menu = pidgin_account_chooser_new(); |
| 1041 gtk_combo_box_set_model(GTK_COMBO_BOX(data->account_menu), filter); |
1037 every = gtk_every_filter_new(); |
| 1042 g_object_unref(G_OBJECT(filter)); |
1038 filter = pidgin_account_filter_connected_new(); |
| |
1039 gtk_multi_filter_append(GTK_MULTI_FILTER(every), filter); |
| |
1040 filter = GTK_FILTER(gtk_custom_filter_new(filter_func, NULL, NULL)); |
| |
1041 gtk_multi_filter_append(GTK_MULTI_FILTER(every), filter); |
| |
1042 pidgin_account_chooser_set_filter( |
| |
1043 PIDGIN_ACCOUNT_CHOOSER(data->account_menu), |
| |
1044 GTK_FILTER(every)); |
| |
1045 g_object_unref(every); |
| |
1046 |
| 1043 if(PURPLE_IS_ACCOUNT(account)) { |
1047 if(PURPLE_IS_ACCOUNT(account)) { |
| 1044 pidgin_account_chooser_set_selected(PIDGIN_ACCOUNT_CHOOSER( |
1048 pidgin_account_chooser_set_selected(PIDGIN_ACCOUNT_CHOOSER( |
| 1045 data->account_menu), account); |
1049 data->account_menu), account); |
| 1046 } else { |
1050 } |
| 1047 gtk_combo_box_set_active(GTK_COMBO_BOX(data->account_menu), 0); |
|
| 1048 } |
|
| 1049 |
|
| 1050 custom_filter = gtk_custom_filter_new(filter_func, NULL, NULL); |
|
| 1051 pidgin_account_chooser_set_filter( |
|
| 1052 PIDGIN_ACCOUNT_CHOOSER(data->account_menu), |
|
| 1053 GTK_FILTER(custom_filter)); |
|
| 1054 g_object_unref(custom_filter); |
|
| 1055 |
1051 |
| 1056 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("A_ccount"), data->sg, data->account_menu, TRUE, NULL); |
1052 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("A_ccount"), data->sg, data->account_menu, TRUE, NULL); |
| 1057 g_signal_connect(data->account_menu, "notify::account", |
1053 g_signal_connect(data->account_menu, "notify::account", |
| 1058 G_CALLBACK(callback_func), data); |
1054 G_CALLBACK(callback_func), data); |
| 1059 |
1055 |
| 1160 PidginChatData *data = user_data; |
1156 PidginChatData *data = user_data; |
| 1161 PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(obj); |
1157 PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(obj); |
| 1162 PurpleAccount *account = pidgin_account_chooser_get_selected(chooser); |
1158 PurpleAccount *account = pidgin_account_chooser_get_selected(chooser); |
| 1163 |
1159 |
| 1164 g_return_if_fail(data != NULL); |
1160 g_return_if_fail(data != NULL); |
| 1165 g_return_if_fail(account != NULL); |
1161 if(account == NULL) { |
| |
1162 return; |
| |
1163 } |
| 1166 |
1164 |
| 1167 if (purple_strequal(purple_account_get_protocol_id(data->rq_data.account), |
1165 if (purple_strequal(purple_account_get_protocol_id(data->rq_data.account), |
| 1168 purple_account_get_protocol_id(account))) |
1166 purple_account_get_protocol_id(account))) |
| 1169 { |
1167 { |
| 1170 data->rq_data.account = account; |
1168 data->rq_data.account = account; |