Mercurial > pidgin
comparison finch/plugins/gntgf.c @ 26440:8df78c06d10e
Save the world.
Patch from Arunan Bala to save the world. But instead of saving the
cheerleader, he's using g_timeout_add_seconds where possible in place of
g_timeout_add. Closes #8831.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 05 Apr 2009 08:42:00 +0000 |
parents | ea62e934c80b |
children | a8cc50c2279f |
comparison
equal
deleted
inserted
replaced
26439:c67d43408daa | 26440:8df78c06d10e |
---|---|
45 #include <plugin.h> | 45 #include <plugin.h> |
46 #include <version.h> | 46 #include <version.h> |
47 #include <blist.h> | 47 #include <blist.h> |
48 #include <conversation.h> | 48 #include <conversation.h> |
49 #include <debug.h> | 49 #include <debug.h> |
50 #include <eventloop.h> | |
50 #include <util.h> | 51 #include <util.h> |
51 | 52 |
52 #include <gnt.h> | 53 #include <gnt.h> |
53 #include <gntbox.h> | 54 #include <gntbox.h> |
54 #include <gntbutton.h> | 55 #include <gntbutton.h> |
73 static void | 74 static void |
74 destroy_toaster(GntToast *toast) | 75 destroy_toaster(GntToast *toast) |
75 { | 76 { |
76 toasters = g_list_remove(toasters, toast); | 77 toasters = g_list_remove(toasters, toast); |
77 gnt_widget_destroy(toast->window); | 78 gnt_widget_destroy(toast->window); |
78 g_source_remove(toast->timer); | 79 purple_timeout_remove(toast->timer); |
79 g_free(toast); | 80 g_free(toast); |
80 } | 81 } |
81 | 82 |
82 static gboolean | 83 static gboolean |
83 remove_toaster(GntToast *toast) | 84 remove_toaster(GntToast *toast) |
218 gnt_widget_set_position(window, getmaxx(stdscr) - gpsw[i - 1] - w - 1, | 219 gnt_widget_set_position(window, getmaxx(stdscr) - gpsw[i - 1] - w - 1, |
219 getmaxy(stdscr) - gpsy[i] - 1); | 220 getmaxy(stdscr) - gpsy[i] - 1); |
220 } | 221 } |
221 gnt_widget_draw(window); | 222 gnt_widget_draw(window); |
222 | 223 |
223 toast->timer = g_timeout_add(4000, (GSourceFunc)remove_toaster, toast); | 224 toast->timer = purple_timeout_add_seconds(4, (GSourceFunc)remove_toaster, toast); |
224 toasters = g_list_prepend(toasters, toast); | 225 toasters = g_list_prepend(toasters, toast); |
225 } | 226 } |
226 | 227 |
227 static void | 228 static void |
228 buddy_signed_on(PurpleBuddy *buddy, gpointer null) | 229 buddy_signed_on(PurpleBuddy *buddy, gpointer null) |