Update of /cvsroot/gaim/gaim/src/protocols/yahoo
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8809/src/protocols/yahoo
Modified Files:
yahoo.c
Log Message:
Replace GaimBlistNodeAction with the more generic GaimMenuAction, this is in
preparation for letting the chat room user list have extensible menus like the
blist entries do. (I know it's not exactly the prettiest, and the callback
isn't exactly type-safe, when we eventually gobjectify everything we can get
some safety back by using (GObject, gpointer) but that's for later.)
I'm planning to look into merging GaimPluginActions into GaimMenuActions as
well.
Index: yahoo.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v
retrieving revision 1.384
retrieving revision 1.385
diff -u -d -p -r1.384 -r1.385
--- yahoo.c 14 Jan 2006 21:21:47 -0000 1.384
+++ yahoo.c 17 Jan 2006 23:22:19 -0000 1.385
@@ -2858,19 +2858,19 @@ static void yahoo_chat_goto_menu(GaimBli
static GList *build_presence_submenu(YahooFriend *f, GaimConnection *gc) {
GList *m = NULL;
- GaimBlistNodeAction *act;
+ GaimMenuAction *act;
struct yahoo_data *yd = (struct yahoo_data *) gc->proto_data;
if (yd->current_status == YAHOO_STATUS_INVISIBLE) {
if (f->presence != YAHOO_PRESENCE_ONLINE) {
- act = gaim_blist_node_action_new(_("Appear Online"),
- yahoo_presence_settings,
+ act = gaim_menu_action_new(_("Appear Online"),
+ GAIM_CALLBACK(yahoo_presence_settings),
GINT_TO_POINTER(YAHOO_PRESENCE_ONLINE),
NULL);
m = g_list_append(m, act);
} else if (f->presence != YAHOO_PRESENCE_DEFAULT) {
- act = gaim_blist_node_action_new(_("Appear Offline"),
- yahoo_presence_settings,
+ act = gaim_menu_action_new(_("Appear Offline"),
+ GAIM_CALLBACK(yahoo_presence_settings),
GINT_TO_POINTER(YAHOO_PRESENCE_DEFAULT),
NULL);
m = g_list_append(m, act);
@@ -2878,15 +2878,14 @@ static GList *build_presence_submenu(Yah
}
if (f->presence == YAHOO_PRESENCE_PERM_OFFLINE) {
- act = gaim_blist_node_action_new(
+ act = gaim_menu_action_new(
_("Don't Appear Permanently Offline"),
- yahoo_presence_settings,
+ GAIM_CALLBACK(yahoo_presence_settings),
GINT_TO_POINTER(YAHOO_PRESENCE_DEFAULT), NULL);
m = g_list_append(m, act);
} else {
- act = gaim_blist_node_action_new(
- _("Appear Permanently Offline"),
- yahoo_presence_settings,
+ act = gaim_menu_action_new(_("Appear Permanently Offline"),
+ GAIM_CALLBACK(yahoo_presence_settings),
GINT_TO_POINTER(YAHOO_PRESENCE_PERM_OFFLINE),
NULL);
m = g_list_append(m, act);
@@ -2906,7 +2905,7 @@ static void yahoo_doodle_blist_node(Gaim
static GList *yahoo_buddy_menu(GaimBuddy *buddy)
{
GList *m = NULL;
- GaimBlistNodeAction *act;
+ GaimMenuAction *act;
GaimConnection *gc = gaim_account_get_connection(buddy->account);
struct yahoo_data *yd = gc->proto_data;
@@ -2916,8 +2915,9 @@ static GList *yahoo_buddy_menu(GaimBuddy
f = yahoo_friend_find(gc, buddy->name);
if (!f && !yd->wm) {
- act = gaim_blist_node_action_new(_("Add Buddy"),
- yahoo_addbuddyfrommenu_cb, NULL, NULL);
+ act = gaim_menu_action_new(_("Add Buddy"),
+ GAIM_CALLBACK(yahoo_addbuddyfrommenu_cb),
+ NULL, NULL);
m = g_list_append(m, act);
return m;
@@ -2926,13 +2926,15 @@ static GList *yahoo_buddy_menu(GaimBuddy
if (f && f->status != YAHOO_STATUS_OFFLINE) {
if (!yd->wm) {
- act = gaim_blist_node_action_new(_("Join in Chat"),
- yahoo_chat_goto_menu, NULL, NULL);
+ act = gaim_menu_action_new(_("Join in Chat"),
+ GAIM_CALLBACK(yahoo_chat_goto_menu),
+ NULL, NULL);
m = g_list_append(m, act);
}
- act = gaim_blist_node_action_new(_("Initiate Conference"),
- yahoo_initiate_conference, NULL, NULL);
+ act = gaim_menu_action_new(_("Initiate Conference"),
+ GAIM_CALLBACK(yahoo_initiate_conference),
+ NULL, NULL);
m = g_list_append(m, act);
if (yahoo_friend_get_game(f)) {
@@ -2949,21 +2951,24 @@ static GList *yahoo_buddy_menu(GaimBuddy
*t = ' ';
g_snprintf(buf2, sizeof buf2, "%s", room);
- act = gaim_blist_node_action_new(buf2, yahoo_game, NULL, NULL);
+ act = gaim_menu_action_new(buf2,
+ GAIM_CALLBACK(yahoo_game),
+ NULL, NULL);
m = g_list_append(m, act);
}
}
}
if (f) {
- act = gaim_blist_node_action_new(_("Presence Settings"),
- NULL, NULL, build_presence_submenu(f, gc));
+ act = gaim_menu_action_new(_("Presence Settings"), NULL, NULL,
+ build_presence_submenu(f, gc));
m = g_list_append(m, act);
}
if (f) {
- act = gaim_blist_node_action_new(_("Start Doodling"),
- yahoo_doodle_blist_node, NULL, NULL);
+ act = gaim_menu_action_new(_("Start Doodling"),
+ GAIM_CALLBACK(yahoo_doodle_blist_node),
+ NULL, NULL);
m = g_list_append(m, act);
}
|