| 577 |
577 |
| 578 static void |
578 static void |
| 579 pidgin_account_editor_update_proxy_options(PidginAccountEditor *editor) { |
579 pidgin_account_editor_update_proxy_options(PidginAccountEditor *editor) { |
| 580 PurpleProxyInfo *info = NULL; |
580 PurpleProxyInfo *info = NULL; |
| 581 GListModel *model = NULL; |
581 GListModel *model = NULL; |
| |
582 char *str = NULL; |
| 582 const char *type = "global"; |
583 const char *type = "global"; |
| 583 const char *hostname = NULL; |
584 const char *hostname = NULL; |
| 584 const char *username = NULL; |
585 const char *username = NULL; |
| 585 const char *password = NULL; |
586 const char *password = NULL; |
| 586 int port = 8080; |
587 int port = 8080; |
| 635 if(hostname == NULL) { |
636 if(hostname == NULL) { |
| 636 hostname = ""; |
637 hostname = ""; |
| 637 } |
638 } |
| 638 gtk_editable_set_text(GTK_EDITABLE(editor->proxy_host), hostname); |
639 gtk_editable_set_text(GTK_EDITABLE(editor->proxy_host), hostname); |
| 639 |
640 |
| 640 gtk_spin_button_set_value(GTK_SPIN_BUTTON(editor->proxy_port), |
641 |
| 641 (gdouble)port); |
642 str = g_strdup_printf("%d", port); |
| |
643 gtk_editable_set_text(GTK_EDITABLE(editor->proxy_port), str); |
| |
644 g_free(str); |
| 642 |
645 |
| 643 if(username == NULL) { |
646 if(username == NULL) { |
| 644 username = ""; |
647 username = ""; |
| 645 } |
648 } |
| 646 gtk_editable_set_text(GTK_EDITABLE(editor->proxy_username), username); |
649 gtk_editable_set_text(GTK_EDITABLE(editor->proxy_username), username); |
| 872 { |
875 { |
| 873 PurpleProxyInfo *info = NULL; |
876 PurpleProxyInfo *info = NULL; |
| 874 PurpleProxyType type = PURPLE_PROXY_TYPE_NONE; |
877 PurpleProxyType type = PURPLE_PROXY_TYPE_NONE; |
| 875 GObject *item = NULL; |
878 GObject *item = NULL; |
| 876 const gchar *svalue = NULL; |
879 const gchar *svalue = NULL; |
| 877 gint ivalue = 0; |
|
| 878 |
880 |
| 879 /* Build the ProxyInfo object */ |
881 /* Build the ProxyInfo object */ |
| 880 if(!new_account) { |
882 if(!new_account) { |
| 881 info = purple_account_get_proxy_info(editor->account); |
883 info = purple_account_get_proxy_info(editor->account); |
| 882 } |
884 } |
| 909 purple_proxy_info_set_proxy_type(info, type); |
911 purple_proxy_info_set_proxy_type(info, type); |
| 910 |
912 |
| 911 svalue = gtk_editable_get_text(GTK_EDITABLE(editor->proxy_host)); |
913 svalue = gtk_editable_get_text(GTK_EDITABLE(editor->proxy_host)); |
| 912 purple_proxy_info_set_hostname(info, svalue); |
914 purple_proxy_info_set_hostname(info, svalue); |
| 913 |
915 |
| 914 ivalue = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editor->proxy_port)); |
916 svalue = gtk_editable_get_text(GTK_EDITABLE(editor->proxy_port)); |
| 915 purple_proxy_info_set_port(info, ivalue); |
917 purple_proxy_info_set_port(info, atoi(svalue)); |
| 916 |
918 |
| 917 svalue = gtk_editable_get_text(GTK_EDITABLE(editor->proxy_username)); |
919 svalue = gtk_editable_get_text(GTK_EDITABLE(editor->proxy_username)); |
| 918 purple_proxy_info_set_username(info, svalue); |
920 purple_proxy_info_set_username(info, svalue); |
| 919 |
921 |
| 920 svalue = gtk_editable_get_text(GTK_EDITABLE(editor->proxy_password)); |
922 svalue = gtk_editable_get_text(GTK_EDITABLE(editor->proxy_password)); |