Mercurial > pidgin.yaz
comparison src/protocols/napster/napster.c @ 2170:c24595d3c364
[gaim-migrate @ 2180]
buddy_menu
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 27 Aug 2001 07:11:50 +0000 |
parents | edf8c5a70e5b |
children | cff4fbe01c7b |
comparison
equal
deleted
inserted
replaced
2169:b7807144bf44 | 2170:c24595d3c364 |
---|---|
1037 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); | 1037 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); |
1038 gtk_widget_show(label); | 1038 gtk_widget_show(label); |
1039 } | 1039 } |
1040 | 1040 |
1041 | 1041 |
1042 static void nap_send_browse(GtkObject *w, char *who) | 1042 static void nap_send_browse(struct gaim_connection *gc, char *who) |
1043 { | 1043 { |
1044 struct gaim_connection *gc = (struct gaim_connection *)gtk_object_get_user_data(w); | |
1045 gchar buf[NAP_BUF_LEN]; | 1044 gchar buf[NAP_BUF_LEN]; |
1046 | 1045 |
1047 g_snprintf(buf, NAP_BUF_LEN, "%s", who); | 1046 g_snprintf(buf, NAP_BUF_LEN, "%s", who); |
1048 nap_write_packet(gc, 0xd3, buf); | 1047 nap_write_packet(gc, 0xd3, buf); |
1049 } | 1048 } |
1063 static void destroy_window(GtkObject *w, GtkWidget *win) | 1062 static void destroy_window(GtkObject *w, GtkWidget *win) |
1064 { | 1063 { |
1065 gtk_widget_destroy(win); | 1064 gtk_widget_destroy(win); |
1066 } | 1065 } |
1067 | 1066 |
1068 static void nap_show_search(GtkObject *w, void *omit) | 1067 static void nap_show_search(struct gaim_connection *gc, char *omit) |
1069 { | 1068 { |
1070 struct gaim_connection *gc = (struct gaim_connection *)gtk_object_get_user_data(w); | |
1071 | |
1072 if (!search_dialog) | 1069 if (!search_dialog) |
1073 { | 1070 { |
1074 GtkWidget *window; | 1071 GtkWidget *window; |
1075 GtkWidget *sw; | 1072 GtkWidget *sw; |
1076 GtkWidget *vbox; | 1073 GtkWidget *vbox; |
1147 } | 1144 } |
1148 | 1145 |
1149 gtk_widget_show(search_dialog->window); | 1146 gtk_widget_show(search_dialog->window); |
1150 } | 1147 } |
1151 | 1148 |
1152 static void nap_buddy_menu(GtkWidget *menu, struct gaim_connection *gc, char *who) | 1149 static GList *nap_buddy_menu(struct gaim_connection *gc, char *who) |
1153 { | 1150 { |
1154 GtkWidget *button; | 1151 GList *m = NULL; |
1155 | 1152 struct proto_buddy_menu *pbm; |
1156 button = gtk_menu_item_new_with_label("Browse Files"); | 1153 |
1157 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(nap_send_browse), who); | 1154 pbm = g_new0(struct proto_buddy_menu, 1); |
1158 gtk_object_set_user_data(GTK_OBJECT(button), gc); | 1155 pbm->label = _("Browse Files"); |
1159 gtk_menu_append(GTK_MENU(menu), button); | 1156 pbm->callback = nap_send_browse; |
1160 gtk_widget_show(button); | 1157 pbm->gc = gc; |
1161 | 1158 m = g_list_append(m, pbm); |
1162 button = gtk_menu_item_new_with_label("Search Napster"); | 1159 |
1163 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(nap_show_search), NULL); | 1160 pbm = g_new0(struct proto_buddy_menu, 1); |
1164 gtk_object_set_user_data(GTK_OBJECT(button), gc); | 1161 pbm->label = _("Search Napster"); |
1165 gtk_menu_append(GTK_MENU(menu), button); | 1162 pbm->callback = nap_show_search; |
1166 gtk_widget_show(button); | 1163 pbm->gc = gc; |
1164 m = g_list_append(m, pbm); | |
1165 | |
1166 return m; | |
1167 } | 1167 } |
1168 | 1168 |
1169 static char** nap_list_icon(int uc) | 1169 static char** nap_list_icon(int uc) |
1170 { | 1170 { |
1171 return napster_xpm; | 1171 return napster_xpm; |