Mercurial > pidgin
comparison plugins/idle.c @ 9015:67421e0dc497
[gaim-migrate @ 9791]
(05:54:53) siege: that's the first pass on merging the two action sources
(05:55:27) siege: using it right now, seems to be working fine. You may
want to look it over though...
(05:56:04) siege: found a small mem-leak in a GList getting created and not
destroyed, this fixes that as well
(13:20:40) KingAnt: LSchiere: Well it's probably ok. I haven't even had a
chance to look at the commit for the other thing
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 22 May 2004 17:33:38 +0000 |
parents | c5825a04fb97 |
children | f8e395a054e2 |
comparison
equal
deleted
inserted
replaced
9014:51b5b3a622ce | 9015:67421e0dc497 |
---|---|
5 | 5 |
6 #include "internal.h" | 6 #include "internal.h" |
7 | 7 |
8 #include "connection.h" | 8 #include "connection.h" |
9 #include "debug.h" | 9 #include "debug.h" |
10 #include "multi.h" | |
11 #include "plugin.h" | 10 #include "plugin.h" |
12 #include "request.h" | 11 #include "request.h" |
13 #include "server.h" | 12 #include "server.h" |
14 | 13 |
15 #define IDLE_PLUGIN_ID "gtk-idle" | 14 #define IDLE_PLUGIN_ID "gtk-idle" |
37 gc->is_idle = 0; | 36 gc->is_idle = 0; |
38 } | 37 } |
39 | 38 |
40 | 39 |
41 static void | 40 static void |
42 idle_action(GaimPlugin *plugin) | 41 idle_action(GaimPluginAction *action) |
43 { | 42 { |
44 /* Use the super fancy request API */ | 43 /* Use the super fancy request API */ |
45 | 44 |
46 GaimRequestFields *request; | 45 GaimRequestFields *request; |
47 GaimRequestFieldGroup *group; | 46 GaimRequestFieldGroup *group; |
57 gaim_request_field_group_add_field(group, field); | 56 gaim_request_field_group_add_field(group, field); |
58 | 57 |
59 request = gaim_request_fields_new(); | 58 request = gaim_request_fields_new(); |
60 gaim_request_fields_add_group(request, group); | 59 gaim_request_fields_add_group(request, group); |
61 | 60 |
62 gaim_request_fields(plugin, | 61 gaim_request_fields(action->plugin, |
63 N_("I'dle Mak'er"), | 62 N_("I'dle Mak'er"), |
64 _("Set Account Idle Time"), | 63 _("Set Account Idle Time"), |
65 NULL, | 64 NULL, |
66 request, | 65 request, |
67 _("_Set"), G_CALLBACK(idle_action_ok), | 66 _("_Set"), G_CALLBACK(idle_action_ok), |
69 NULL); | 68 NULL); |
70 } | 69 } |
71 | 70 |
72 | 71 |
73 static GList * | 72 static GList * |
74 actions(GaimPlugin *plugin) | 73 actions(GaimPlugin *plugin, gpointer context) |
75 { | 74 { |
76 GList *l = NULL; | 75 GList *l = NULL; |
77 struct plugin_actions_menu *pam; | 76 GaimPluginAction *act = NULL; |
78 | 77 |
79 pam = g_new0(struct plugin_actions_menu, 1); | 78 act = gaim_plugin_action_new(_("Set Account Idle Time"), |
80 pam->label = _("Set Account Idle Time"); | 79 idle_action); |
81 pam->callback = idle_action; | 80 l = g_list_append(l, act); |
82 pam->plugin = plugin; | |
83 l = g_list_append(l, pam); | |
84 | 81 |
85 return l; | 82 return l; |
86 } | 83 } |
87 | 84 |
88 | 85 |