comparison src/gtkaccount.c @ 7159:669af8c0801a

[gaim-migrate @ 7726] This fixes the following crash bug: 1) Open account dialog 2) Edit an account 3) Close account dialog 4) Save account committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 05 Oct 2003 17:30:36 +0000
parents 9220c7490cd1
children 819905ce7bc0
comparison
equal deleted inserted replaced
7158:aee5fd893aba 7159:669af8c0801a
77 77
78 typedef struct 78 typedef struct
79 { 79 {
80 GaimGtkAccountDialogType type; 80 GaimGtkAccountDialogType type;
81 81
82 AccountsWindow *accounts_window;
83
84 GaimAccount *account; 82 GaimAccount *account;
85 GaimProtocol protocol; 83 GaimProtocol protocol;
86 char *protocol_id; 84 char *protocol_id;
87 GaimPlugin *plugin; 85 GaimPlugin *plugin;
88 GaimPluginProtocolInfo *prpl_info; 86 GaimPluginProtocolInfo *prpl_info;
1123 else 1121 else
1124 gaim_proxy_info_set_password(proxy_info, NULL); 1122 gaim_proxy_info_set_password(proxy_info, NULL);
1125 } 1123 }
1126 1124
1127 /* Adds the account to the list, or modify the existing entry. */ 1125 /* Adds the account to the list, or modify the existing entry. */
1128 if (dialog->accounts_window != NULL) { 1126 if (accounts_window != NULL) {
1129 index = g_list_index(gaim_accounts_get_all(), dialog->account); 1127 index = g_list_index(gaim_accounts_get_all(), dialog->account);
1130 1128
1131 if (index != -1 && 1129 if (index != -1 &&
1132 (gtk_tree_model_iter_nth_child( 1130 (gtk_tree_model_iter_nth_child(
1133 GTK_TREE_MODEL(dialog->accounts_window->model), &iter, 1131 GTK_TREE_MODEL(accounts_window->model), &iter,
1134 NULL, index))) { 1132 NULL, index))) {
1135 1133
1136 set_account(dialog->accounts_window->model, &iter, 1134 set_account(accounts_window->model, &iter,
1137 dialog->account); 1135 dialog->account);
1138 } 1136 }
1139 else { 1137 else {
1140 add_account(dialog->accounts_window, dialog->account); 1138 add_account(accounts_window, dialog->account);
1141 gaim_accounts_add(dialog->account); 1139 gaim_accounts_add(dialog->account);
1142 } 1140 }
1143 } 1141 }
1144 1142
1145 gtk_widget_destroy(dialog->window); 1143 gtk_widget_destroy(dialog->window);
1171 GtkWidget *sep; 1169 GtkWidget *sep;
1172 GtkWidget *button; 1170 GtkWidget *button;
1173 1171
1174 dialog = g_new0(AccountPrefsDialog, 1); 1172 dialog = g_new0(AccountPrefsDialog, 1);
1175 1173
1176 dialog->accounts_window = accounts_window;
1177 dialog->account = account; 1174 dialog->account = account;
1178 dialog->type = type; 1175 dialog->type = type;
1179 dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 1176 dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1180 1177
1181 if (dialog->account == NULL) { 1178 if (dialog->account == NULL) {
1452 1449
1453 static gint 1450 static gint
1454 accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog) 1451 accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog)
1455 { 1452 {
1456 gaim_gtk_accounts_window_hide(); 1453 gaim_gtk_accounts_window_hide();
1454
1457 return 0; 1455 return 0;
1458 } 1456 }
1459 1457
1460 static gboolean 1458 static gboolean
1461 configure_cb(GtkWidget *w, GdkEventConfigure *event, AccountsWindow *dialog) 1459 configure_cb(GtkWidget *w, GdkEventConfigure *event, AccountsWindow *dialog)
1571 static void 1569 static void
1572 close_accounts_cb(GtkWidget *w, AccountsWindow *dialog) 1570 close_accounts_cb(GtkWidget *w, AccountsWindow *dialog)
1573 { 1571 {
1574 gtk_widget_destroy(dialog->window); 1572 gtk_widget_destroy(dialog->window);
1575 1573
1576 accedit_win_destroy_cb(NULL, NULL, dialog); 1574 gaim_gtk_accounts_window_hide();
1577 } 1575 }
1578 1576
1579 static void 1577 static void
1580 online_cb(GtkCellRendererToggle *renderer, gchar *path_str, gpointer data) 1578 online_cb(GtkCellRendererToggle *renderer, gchar *path_str, gpointer data)
1581 { 1579 {