gee
oldstatus
2005-09-19, Nathan Walp
/* a nifty little plugin to set your idle time to whatever you want it to be. * useful for almost nothing. mostly just a demo plugin. but it's fun to have #define IDLE_PLUGIN_ID "gtk-idle" idle_action_ok(void *ignored, GaimRequestFields *fields) tm = gaim_request_fields_get_integer(fields, "mins"); acct = gaim_request_fields_get_account(fields, "acct"); gc = gaim_account_get_connection(acct); gaim_debug(GAIM_DEBUG_INFO, "idle", "setting idle time for %s to %d\n", gaim_account_get_username(acct), tm); serv_set_idle(gc, 60 * tm); idle_action(GaimPluginAction *action) /* Use the super fancy request API */ GaimRequestFields *request; GaimRequestFieldGroup *group; group = gaim_request_field_group_new(NULL); field = gaim_request_field_account_new("acct", _("Account"), NULL); gaim_request_field_account_set_show_all(field, FALSE); gaim_request_field_group_add_field(group, field); field = gaim_request_field_int_new("mins", _("Minutes"), 10); gaim_request_field_group_add_field(group, field); request = gaim_request_fields_new(); gaim_request_fields_add_group(request, group); gaim_request_fields(action->plugin, _("Set Account Idle Time"), _("_Set"), G_CALLBACK(idle_action_ok), actions(GaimPlugin *plugin, gpointer context) GaimPluginAction *act = NULL; act = gaim_plugin_action_new(_("Set Account Idle Time"), l = g_list_append(l, act); static GaimPluginInfo info = N_("Allows you to hand-configure how long you've been idle for"), N_("Allows you to hand-configure how long you've been idle for"), "Eric Warmenhoven <eric@warmenhoven.org>", init_plugin(GaimPlugin *plugin) GAIM_INIT_PLUGIN(idle, init_plugin, info)