Mercurial > pidgin
comparison finch/gntrequest.c @ 18347:a90f9a0b90c8
Update search-api to not crash. Searching for users in xmpp/oscar works now.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 29 Jun 2007 01:52:09 +0000 |
parents | f23a7736586f |
children | 719f73b9a593 576edd9c4f72 |
comparison
equal
deleted
inserted
replaced
18346:72a52cff76f3 | 18347:a90f9a0b90c8 |
---|---|
72 * the buttons, then do some default callback. | 72 * the buttons, then do some default callback. |
73 */ | 73 */ |
74 static void | 74 static void |
75 setup_default_callback(GntWidget *window, gpointer default_cb, gpointer data) | 75 setup_default_callback(GntWidget *window, gpointer default_cb, gpointer data) |
76 { | 76 { |
77 g_object_set_data(G_OBJECT(window), "default-callback", default_cb); | |
77 g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(default_cb), data); | 78 g_signal_connect_swapped(G_OBJECT(window), "destroy", G_CALLBACK(default_cb), data); |
78 } | 79 } |
79 | 80 |
80 static void | 81 static void |
81 action_performed(GntWidget *button, gpointer data) | 82 action_performed(GntWidget *button, gpointer data) |
82 { | 83 { |
83 g_signal_handlers_disconnect_matched(data, G_SIGNAL_MATCH_FUNC, | 84 g_signal_handlers_disconnect_matched(data, G_SIGNAL_MATCH_FUNC, |
84 0, 0, NULL, setup_default_callback, NULL); | 85 0, 0, NULL, |
86 g_object_get_data(data, "default-callback"), | |
87 NULL); | |
85 } | 88 } |
86 | 89 |
87 /** | 90 /** |
88 * window: this is the window | 91 * window: this is the window |
89 * userdata: the userdata to pass to the primary callbacks | 92 * userdata: the userdata to pass to the primary callbacks |
108 callback = va_arg(list, gpointer); | 111 callback = va_arg(list, gpointer); |
109 button = gnt_button_new(text); | 112 button = gnt_button_new(text); |
110 gnt_box_add_widget(GNT_BOX(box), button); | 113 gnt_box_add_widget(GNT_BOX(box), button); |
111 g_object_set_data(G_OBJECT(button), "activate-callback", callback); | 114 g_object_set_data(G_OBJECT(button), "activate-callback", callback); |
112 g_object_set_data(G_OBJECT(button), "activate-userdata", userdata); | 115 g_object_set_data(G_OBJECT(button), "activate-userdata", userdata); |
116 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(action_performed), win); | |
113 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(cb), data); | 117 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(cb), data); |
114 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(action_performed), win); | |
115 } | 118 } |
116 | 119 |
117 va_end(list); | 120 va_end(list); |
118 return box; | 121 return box; |
119 } | 122 } |