Mercurial > pidgin
comparison src/gtknotify.c @ 7007:da1430478acf
[gaim-migrate @ 7564]
Closing a formatted info dialog now removes the dialog handle from the
list, so it doesn't try to get removed again after the prpl unloads.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 29 Sep 2003 03:54:08 +0000 |
parents | 083d1e4a9c78 |
children | feb3d21a7794 |
comparison
equal
deleted
inserted
replaced
7006:1dbafcde861f | 7007:da1430478acf |
---|---|
60 { | 60 { |
61 if (id == 0) | 61 if (id == 0) |
62 gaim_notify_uri(NULL, data->url); | 62 gaim_notify_uri(NULL, data->url); |
63 | 63 |
64 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); | 64 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); |
65 } | |
66 | |
67 static void | |
68 formatted_close_cb(GtkWidget *win, GdkEvent *event, void *user_data) | |
69 { | |
70 gaim_notify_close(GAIM_NOTIFY_FORMATTED, win); | |
65 } | 71 } |
66 | 72 |
67 static void * | 73 static void * |
68 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title, | 74 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title, |
69 const char *primary, const char *secondary, | 75 const char *primary, const char *secondary, |
268 char label_text[2048]; | 274 char label_text[2048]; |
269 | 275 |
270 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | 276 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
271 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG); | 277 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG); |
272 gtk_container_set_border_width(GTK_CONTAINER(window), 12); | 278 gtk_container_set_border_width(GTK_CONTAINER(window), 12); |
279 | |
280 g_signal_connect(G_OBJECT(window), "delete_event", | |
281 G_CALLBACK(formatted_close_cb), NULL); | |
273 | 282 |
274 /* Setup the main vbox */ | 283 /* Setup the main vbox */ |
275 vbox = gtk_vbox_new(FALSE, 12); | 284 vbox = gtk_vbox_new(FALSE, 12); |
276 gtk_container_add(GTK_CONTAINER(window), vbox); | 285 gtk_container_add(GTK_CONTAINER(window), vbox); |
277 gtk_widget_show(vbox); | 286 gtk_widget_show(vbox); |
310 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); | 319 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); |
311 gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); | 320 gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); |
312 gtk_widget_show(button); | 321 gtk_widget_show(button); |
313 | 322 |
314 g_signal_connect_swapped(G_OBJECT(button), "clicked", | 323 g_signal_connect_swapped(G_OBJECT(button), "clicked", |
315 G_CALLBACK(gtk_widget_destroy), window); | 324 G_CALLBACK(formatted_close_cb), window); |
316 | 325 |
317 /* Add the text to the gtkimhtml */ | 326 /* Add the text to the gtkimhtml */ |
318 if (gaim_prefs_get_bool("/gaim/gtk/conversations/ignore_colors")) | 327 if (gaim_prefs_get_bool("/gaim/gtk/conversations/ignore_colors")) |
319 options ^= GTK_IMHTML_NO_COLOURS; | 328 options ^= GTK_IMHTML_NO_COLOURS; |
320 | 329 |