| 24 #include <talkatu.h> |
24 #include <talkatu.h> |
| 25 |
25 |
| 26 #include <purple.h> |
26 #include <purple.h> |
| 27 |
27 |
| 28 #include "gtkrequest.h" |
28 #include "gtkrequest.h" |
| |
29 #include "gtkblist.h" |
| 29 #include "gtkutils.h" |
30 #include "gtkutils.h" |
| 30 #include "gtkblist.h" |
|
| 31 #include "pidginaccountchooser.h" |
31 #include "pidginaccountchooser.h" |
| |
32 #include "pidginaccountfilterconnected.h" |
| |
33 #include "pidginaccountstore.h" |
| 32 #include "pidgincore.h" |
34 #include "pidgincore.h" |
| 33 #include "pidgindialog.h" |
35 #include "pidgindialog.h" |
| 34 #include "pidginstock.h" |
36 #include "pidginstock.h" |
| 35 |
37 |
| 36 #include <gdk/gdkkeysyms.h> |
38 #include <gdk/gdkkeysyms.h> |
| 260 } |
262 } |
| 261 |
263 |
| 262 static void |
264 static void |
| 263 field_account_cb(GObject *w, PurpleRequestField *field) |
265 field_account_cb(GObject *w, PurpleRequestField *field) |
| 264 { |
266 { |
| |
267 PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(w); |
| |
268 |
| 265 purple_request_field_account_set_value( |
269 purple_request_field_account_set_value( |
| 266 field, pidgin_account_chooser_get_selected(GTK_WIDGET(w))); |
270 field, pidgin_account_chooser_get_selected(chooser)); |
| 267 } |
271 } |
| 268 |
272 |
| 269 static void |
273 static void |
| 270 multifield_ok_cb(GtkWidget *button, PidginRequestData *data) |
274 multifield_ok_cb(GtkWidget *button, PidginRequestData *data) |
| 271 { |
275 { |
| 1323 |
1327 |
| 1324 static GtkWidget * |
1328 static GtkWidget * |
| 1325 create_account_field(PurpleRequestField *field) |
1329 create_account_field(PurpleRequestField *field) |
| 1326 { |
1330 { |
| 1327 GtkWidget *widget; |
1331 GtkWidget *widget; |
| 1328 |
1332 PurpleAccount *account; |
| 1329 widget = pidgin_account_chooser_new( |
1333 |
| 1330 purple_request_field_account_get_default_value(field), |
1334 widget = pidgin_account_chooser_new(); |
| 1331 purple_request_field_account_get_show_all(field)); |
1335 account = purple_request_field_account_get_default_value(field); |
| |
1336 |
| |
1337 if(purple_request_field_account_get_show_all(field)) { |
| |
1338 GtkListStore *store = pidgin_account_store_new(); |
| |
1339 |
| |
1340 gtk_combo_box_set_model(GTK_COMBO_BOX(widget), GTK_TREE_MODEL(store)); |
| |
1341 |
| |
1342 g_object_unref(G_OBJECT(store)); |
| |
1343 } else { |
| |
1344 GtkListStore *store = NULL; |
| |
1345 GtkTreeModel *filter = NULL; |
| |
1346 |
| |
1347 store = pidgin_account_store_new(); |
| |
1348 filter = pidgin_account_filter_connected_new(GTK_TREE_MODEL(store), |
| |
1349 NULL); |
| |
1350 g_object_unref(G_OBJECT(store)); |
| |
1351 |
| |
1352 gtk_combo_box_set_model(GTK_COMBO_BOX(widget), GTK_TREE_MODEL(filter)); |
| |
1353 g_object_unref(G_OBJECT(filter)); |
| |
1354 } |
| |
1355 |
| |
1356 pidgin_account_chooser_set_selected(PIDGIN_ACCOUNT_CHOOSER(widget), |
| |
1357 account); |
| 1332 pidgin_account_chooser_set_filter_func( |
1358 pidgin_account_chooser_set_filter_func( |
| 1333 PIDGIN_ACCOUNT_CHOOSER(widget), |
1359 PIDGIN_ACCOUNT_CHOOSER(widget), |
| 1334 purple_request_field_account_get_filter(field)); |
1360 purple_request_field_account_get_filter(field)); |
| 1335 g_signal_connect(widget, "changed", G_CALLBACK(field_account_cb), |
1361 g_signal_connect(widget, "changed", G_CALLBACK(field_account_cb), |
| 1336 field); |
1362 field); |
| 1337 |
1363 |
| 1338 gtk_widget_set_tooltip_text(widget, purple_request_field_get_tooltip(field)); |
1364 gtk_widget_set_tooltip_text(widget, purple_request_field_get_tooltip(field)); |
| 1339 g_signal_connect(widget, "changed", |
1365 g_signal_connect(widget, "changed", |
| 1340 G_CALLBACK(req_field_changed_cb), field); |
1366 G_CALLBACK(req_field_changed_cb), field); |
| |
1367 gtk_widget_show(widget); |
| 1341 |
1368 |
| 1342 return widget; |
1369 return widget; |
| 1343 } |
1370 } |
| 1344 |
1371 |
| 1345 static void |
1372 static void |