Mercurial > pidgin
comparison plugins/notify.c @ 11728:89e416ac9ef7
[gaim-migrate @ 14019]
Finish up some changes that were made a little while ago and remove the now unused window_ids.
committer: Tailor Script <tailor@pidgin.im>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Sun, 23 Oct 2005 00:09:27 +0000 |
parents | 872932089400 |
children | 5cd2294127e8 |
comparison
equal
deleted
inserted
replaced
11727:8657ad65e257 | 11728:89e416ac9ef7 |
---|---|
282 static int | 282 static int |
283 attach_signals(GaimConversation *conv) | 283 attach_signals(GaimConversation *conv) |
284 { | 284 { |
285 GaimGtkConversation *gtkconv = NULL; | 285 GaimGtkConversation *gtkconv = NULL; |
286 GaimGtkWindow *gtkwin = NULL; | 286 GaimGtkWindow *gtkwin = NULL; |
287 GSList *window_ids = NULL, *imhtml_ids = NULL, *entry_ids = NULL; | 287 GSList *imhtml_ids = NULL, *entry_ids = NULL; |
288 guint id; | 288 guint id; |
289 | 289 |
290 gtkconv = GAIM_GTK_CONVERSATION(conv); | 290 gtkconv = GAIM_GTK_CONVERSATION(conv); |
291 if (!gtkconv) { | 291 if (!gtkconv) { |
292 gaim_debug_misc("notify", "Failed to find gtkconv\n"); | 292 gaim_debug_misc("notify", "Failed to find gtkconv\n"); |
301 * focus-in-event on the g(d|t)kwindow */ | 301 * focus-in-event on the g(d|t)kwindow */ |
302 /* try setting the signal on the focus-in-event for | 302 /* try setting the signal on the focus-in-event for |
303 * gtkwin->notebook->container? */ | 303 * gtkwin->notebook->container? */ |
304 id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", | 304 id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", |
305 G_CALLBACK(unnotify_cb), conv); | 305 G_CALLBACK(unnotify_cb), conv); |
306 entry_ids = g_slist_append(window_ids, GUINT_TO_POINTER(id)); | 306 entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
307 | 307 |
308 id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "focus-in-event", | 308 id = g_signal_connect(G_OBJECT(gtkconv->imhtml), "focus-in-event", |
309 G_CALLBACK(unnotify_cb), conv); | 309 G_CALLBACK(unnotify_cb), conv); |
310 imhtml_ids = g_slist_append(window_ids, GUINT_TO_POINTER(id)); | 310 imhtml_ids = g_slist_append(imhtml_ids, GUINT_TO_POINTER(id)); |
311 } | 311 } |
312 | 312 |
313 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")) { | 313 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")) { |
314 /* TODO similarly should really find a way to allow for clicking in other | 314 /* TODO similarly should really find a way to allow for clicking in other |
315 * places of the window */ | 315 * places of the window */ |
326 id = g_signal_connect(G_OBJECT(gtkconv->entry), "key-press-event", | 326 id = g_signal_connect(G_OBJECT(gtkconv->entry), "key-press-event", |
327 G_CALLBACK(unnotify_cb), conv); | 327 G_CALLBACK(unnotify_cb), conv); |
328 entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); | 328 entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); |
329 } | 329 } |
330 | 330 |
331 gaim_conversation_set_data(conv, "notify-window-signals", window_ids); | |
332 gaim_conversation_set_data(conv, "notify-imhtml-signals", imhtml_ids); | 331 gaim_conversation_set_data(conv, "notify-imhtml-signals", imhtml_ids); |
333 gaim_conversation_set_data(conv, "notify-entry-signals", entry_ids); | 332 gaim_conversation_set_data(conv, "notify-entry-signals", entry_ids); |
334 | 333 |
335 return 0; | 334 return 0; |
336 } | 335 } |
345 gtkconv = GAIM_GTK_CONVERSATION(conv); | 344 gtkconv = GAIM_GTK_CONVERSATION(conv); |
346 if (!gtkconv) | 345 if (!gtkconv) |
347 return; | 346 return; |
348 gtkwin = gtkconv->win; | 347 gtkwin = gtkconv->win; |
349 | 348 |
350 ids = gaim_conversation_get_data(conv, "notify-window-signals"); | |
351 for (l = ids; l != NULL; l = l->next) | |
352 g_signal_handler_disconnect(gtkwin->window, GPOINTER_TO_INT(l->data)); | |
353 g_slist_free(ids); | |
354 | |
355 ids = gaim_conversation_get_data(conv, "notify-imhtml-signals"); | 349 ids = gaim_conversation_get_data(conv, "notify-imhtml-signals"); |
356 for (l = ids; l != NULL; l = l->next) | 350 for (l = ids; l != NULL; l = l->next) |
357 g_signal_handler_disconnect(gtkconv->imhtml, GPOINTER_TO_INT(l->data)); | 351 g_signal_handler_disconnect(gtkconv->imhtml, GPOINTER_TO_INT(l->data)); |
358 g_slist_free(ids); | 352 g_slist_free(ids); |
359 | 353 |
362 g_signal_handler_disconnect(gtkconv->entry, GPOINTER_TO_INT(l->data)); | 356 g_signal_handler_disconnect(gtkconv->entry, GPOINTER_TO_INT(l->data)); |
363 g_slist_free(ids); | 357 g_slist_free(ids); |
364 | 358 |
365 gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); | 359 gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); |
366 | 360 |
367 gaim_conversation_set_data(conv, "notify-window-signals", NULL); | |
368 gaim_conversation_set_data(conv, "notify-imhtml-signals", NULL); | 361 gaim_conversation_set_data(conv, "notify-imhtml-signals", NULL); |
369 gaim_conversation_set_data(conv, "notify-entry-signals", NULL); | 362 gaim_conversation_set_data(conv, "notify-entry-signals", NULL); |
370 } | 363 } |
371 | 364 |
372 static void | 365 static void |