Mercurial > pidgin
comparison src/dialogs.c @ 7055:2234420abada
[gaim-migrate @ 7618]
Um, I think this should maybe almost fix wing's possible problem
with the url insert link maybe thing like.
It seemed like destroy_dialog() was getting called 3 times or something.
I dunno, I'm tired. Anyway, it doesn't seem to crash or leak for me,
hopefully wing's problem is fixed.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 30 Sep 2003 05:40:09 +0000 |
parents | 167a92baeae6 |
children | 3c7c887c35c3 |
comparison
equal
deleted
inserted
replaced
7054:7c04a0775918 | 7055:2234420abada |
---|---|
2207 /*------------------------------------------------------*/ | 2207 /*------------------------------------------------------*/ |
2208 | 2208 |
2209 void cancel_link(GtkWidget *widget, GaimConversation *c) | 2209 void cancel_link(GtkWidget *widget, GaimConversation *c) |
2210 { | 2210 { |
2211 GaimGtkConversation *gtkconv; | 2211 GaimGtkConversation *gtkconv; |
2212 GtkWidget *link_dialog; | |
2212 | 2213 |
2213 gtkconv = GAIM_GTK_CONVERSATION(c); | 2214 gtkconv = GAIM_GTK_CONVERSATION(c); |
2214 | 2215 |
2215 if (gtkconv->toolbar.link) { | 2216 if (gtkconv->toolbar.link) { |
2216 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkconv->toolbar.link), | 2217 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkconv->toolbar.link), |
2217 FALSE); | 2218 FALSE); |
2218 } | 2219 } |
2219 | 2220 |
2220 destroy_dialog(NULL, gtkconv->dialogs.link); | 2221 link_dialog = gtkconv->dialogs.link; |
2221 gtkconv->dialogs.link = NULL; | 2222 gtkconv->dialogs.link = NULL; |
2223 destroy_dialog(NULL, link_dialog); | |
2222 } | 2224 } |
2223 | 2225 |
2224 void do_insert_link(GtkWidget *w, int resp, struct linkdlg *b) | 2226 void do_insert_link(GtkWidget *w, int resp, struct linkdlg *b) |
2225 { | 2227 { |
2226 GaimGtkConversation *gtkconv; | 2228 GaimGtkConversation *gtkconv; |
2272 | 2274 |
2273 a->c = c; | 2275 a->c = c; |
2274 a->window = gtk_dialog_new_with_buttons(_("Insert Link"), | 2276 a->window = gtk_dialog_new_with_buttons(_("Insert Link"), |
2275 GTK_WINDOW(gtkwin->window), 0, GTK_STOCK_CANCEL, | 2277 GTK_WINDOW(gtkwin->window), 0, GTK_STOCK_CANCEL, |
2276 GTK_RESPONSE_CANCEL, _("Insert"), GTK_RESPONSE_OK, NULL); | 2278 GTK_RESPONSE_CANCEL, _("Insert"), GTK_RESPONSE_OK, NULL); |
2279 gtk_dialog_set_default_response(GTK_DIALOG(a->window), GTK_RESPONSE_OK); | |
2280 g_signal_connect(G_OBJECT(a->window), "response", | |
2281 G_CALLBACK(do_insert_link), a); | |
2277 | 2282 |
2278 gtk_dialog_set_default_response(GTK_DIALOG(a->window), GTK_RESPONSE_OK); | 2283 gtk_dialog_set_default_response(GTK_DIALOG(a->window), GTK_RESPONSE_OK); |
2279 gtk_container_set_border_width(GTK_CONTAINER(a->window), 6); | 2284 gtk_container_set_border_width(GTK_CONTAINER(a->window), 6); |
2280 gtk_window_set_resizable(GTK_WINDOW(a->window), FALSE); | 2285 gtk_window_set_resizable(GTK_WINDOW(a->window), FALSE); |
2281 gtk_dialog_set_has_separator(GTK_DIALOG(a->window), FALSE); | 2286 gtk_dialog_set_has_separator(GTK_DIALOG(a->window), FALSE); |
2302 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | 2307 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
2303 | 2308 |
2304 hbox = gtk_hbox_new(FALSE, 6); | 2309 hbox = gtk_hbox_new(FALSE, 6); |
2305 gtk_container_add(GTK_CONTAINER(vbox), hbox); | 2310 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
2306 | 2311 |
2307 g_signal_connect(G_OBJECT(a->window), "destroy", | |
2308 G_CALLBACK(destroy_dialog), a->window); | |
2309 g_signal_connect(G_OBJECT(a->window), "destroy", | |
2310 G_CALLBACK(free_dialog), a); | |
2311 dialogwindows = g_list_prepend(dialogwindows, a->window); | |
2312 | |
2313 table = gtk_table_new(4, 2, FALSE); | 2312 table = gtk_table_new(4, 2, FALSE); |
2314 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | 2313 gtk_table_set_row_spacings(GTK_TABLE(table), 5); |
2315 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | 2314 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
2316 gtk_container_set_border_width(GTK_CONTAINER(table), 0); | 2315 gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
2317 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); | 2316 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); |
2332 | 2331 |
2333 a->text = gtk_entry_new(); | 2332 a->text = gtk_entry_new(); |
2334 gtk_table_attach_defaults(GTK_TABLE(table), a->text, 1, 2, 1, 2); | 2333 gtk_table_attach_defaults(GTK_TABLE(table), a->text, 1, 2, 1, 2); |
2335 gtk_entry_set_activates_default (GTK_ENTRY(a->text), TRUE); | 2334 gtk_entry_set_activates_default (GTK_ENTRY(a->text), TRUE); |
2336 | 2335 |
2337 g_signal_connect(G_OBJECT(a->window), "response", | 2336 g_signal_connect(G_OBJECT(a->window), "destroy", |
2338 G_CALLBACK(do_insert_link), a); | 2337 G_CALLBACK(free_dialog), a); |
2338 dialogwindows = g_list_prepend(dialogwindows, a->window); | |
2339 | 2339 |
2340 a->toggle = linky; | 2340 a->toggle = linky; |
2341 gtkconv->dialogs.link = a->window; | 2341 gtkconv->dialogs.link = a->window; |
2342 } | 2342 } |
2343 | 2343 |