| 249 if (accounts.window && accounts.tree) { |
249 if (accounts.window && accounts.tree) { |
| 250 gnt_tree_set_selected(GNT_TREE(accounts.tree), account); |
250 gnt_tree_set_selected(GNT_TREE(accounts.tree), account); |
| 251 gnt_box_give_focus_to_child(GNT_BOX(accounts.window), accounts.tree); |
251 gnt_box_give_focus_to_child(GNT_BOX(accounts.window), accounts.tree); |
| 252 } |
252 } |
| 253 |
253 |
| 254 if (protocol && protocol->register_user && |
254 if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, register_user) && |
| 255 gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->regserver))) { |
255 gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->regserver))) { |
| 256 purple_account_register(account); |
256 purple_account_register(account); |
| 257 } else if (dialog->account == NULL) { |
257 } else if (dialog->account == NULL) { |
| 258 /* This is a new account. Set it to the current status. */ |
258 /* This is a new account. Set it to the current status. */ |
| 259 /* Xerox from gtkaccount.c :D */ |
259 /* Xerox from gtkaccount.c :D */ |
| 482 } |
482 } |
| 483 |
483 |
| 484 /* Show the registration checkbox only in a new account dialog, |
484 /* Show the registration checkbox only in a new account dialog, |
| 485 * and when the selected prpl has the support for it. */ |
485 * and when the selected prpl has the support for it. */ |
| 486 gnt_widget_set_visible(dialog->regserver, account == NULL && |
486 gnt_widget_set_visible(dialog->regserver, account == NULL && |
| 487 protocol->register_user != NULL); |
487 PURPLE_PROTOCOL_IMPLEMENTS(protocol, register_user)); |
| 488 } |
488 } |
| 489 |
489 |
| 490 static void |
490 static void |
| 491 update_user_options(AccountEditDialog *dialog) |
491 update_user_options(AccountEditDialog *dialog) |
| 492 { |
492 { |
| 570 |
570 |
| 571 dialog->protocol = combo = gnt_combo_box_new(); |
571 dialog->protocol = combo = gnt_combo_box_new(); |
| 572 for (iter = list; iter; iter = iter->next) |
572 for (iter = list; iter; iter = iter->next) |
| 573 { |
573 { |
| 574 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), iter->data, |
574 gnt_combo_box_add_data(GNT_COMBO_BOX(combo), iter->data, |
| 575 ((PurpleProtocol*)iter->data)->name); |
575 purple_protocol_get_name(PURPLE_PROTOCOL(iter->data))); |
| 576 } |
576 } |
| 577 |
577 |
| 578 protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
578 protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
| 579 |
579 |
| 580 if (account && protocol) |
580 if (account && protocol) |