Update of /cvsroot/gaim/gaim/src
In directory usw-pr-cvs1:/tmp/cvs-serv9297/src
Modified Files:
buddy.c gaim.h multi.c
Log Message:
Now you can tell of which protocol you're editing buddies on. Thanks Christian Hammond.
Index: buddy.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/buddy.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -d -r1.296 -r1.297
--- buddy.c 28 Mar 2002 19:58:58 -0000 1.296
+++ buddy.c 29 Mar 2002 13:28:55 -0000 1.297
@@ -1161,7 +1161,36 @@
update_num_groups();
}
+void
+create_prpl_icon(GtkWidget *widget, struct gaim_connection *gc,
+ GdkPixmap **pixmap, GdkBitmap **mask)
+{
+ /* This whole thing is a hack--but it looks nice.
+ * Probably should have a prpl->icon(struct gaim_connection *) to
+ * do this. */
+ GtkStyle *style;
+ char **xpm = NULL;
+ if (widget == NULL || gc == NULL || pixmap == NULL || mask == NULL)
+ return;
+
+ style = gtk_widget_get_style( widget );
+
+ if (gc->prpl->list_icon)
+ if (gc->prpl->protocol == PROTO_OSCAR) {
+ if (isdigit(*gc->username)) {
+ xpm = gc->prpl->list_icon(0);
+ } else {
+ xpm = gc->prpl->list_icon(0x10);
+ }
+ } else {
+ xpm = gc->prpl->list_icon (0);
+ }
+ if (xpm == NULL)
+ xpm = (char **)no_icon_xpm;
+
+ *pixmap = gdk_pixmap_create_from_xpm_d(widget->window, mask, &style->bg[GTK_STATE_NORMAL], xpm);
+}
void build_edit_tree()
{
@@ -1185,10 +1214,18 @@
z = (struct gaim_connection *)con->data;
if (g_slist_length(connections) > 1) {
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+
text[0] = z->username;
+ create_prpl_icon(blist, z, &pixmap, &mask);
+
c = gtk_ctree_insert_node(GTK_CTREE(edittree), NULL,
- NULL, text, 5, NULL, NULL, NULL, NULL, 0, 1);
+ NULL, text, 3, pixmap, mask, pixmap, mask, 0, 1);
+
+ gdk_pixmap_unref (pixmap);
+ gdk_bitmap_unref (mask);
gtk_ctree_node_set_row_data(GTK_CTREE(edittree), c, z);
} else
@@ -1197,6 +1234,7 @@
grp = z->groups;
while (grp) {
+
g = (struct group *)grp->data;
text[0] = g->name;
Index: gaim.h
===================================================================
RCS file: /cvsroot/gaim/gaim/src/gaim.h,v
retrieving revision 1.315
retrieving revision 1.316
diff -u -d -r1.315 -r1.316
--- gaim.h 17 Mar 2002 22:23:18 -0000 1.315
+++ gaim.h 29 Mar 2002 13:28:55 -0000 1.316
@@ -326,6 +326,8 @@
extern void do_quit();
extern void signoff(struct gaim_connection *);
extern void do_pounce(struct gaim_connection *, char *, int);
+void create_prpl_icon(GtkWidget *widget, struct gaim_connection *gc,
+ GdkPixmap **pixmap, GdkBitmap **mask);
/* Functions in buddy_chat.c */
extern void show_new_buddy_chat(struct conversation *);
Index: multi.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/multi.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- multi.c 17 Mar 2002 21:49:56 -0000 1.114
+++ multi.c 29 Mar 2002 13:28:55 -0000 1.115
@@ -1074,27 +1074,8 @@
GdkPixmap *gdkpixmap;
GdkBitmap *mask;
GtkWidget *pixmap;
- GtkStyle *style;
- char **xpm = NULL;
-
- style = gtk_widget_get_style( widget );
-
- if (gc->prpl->list_icon)
- if (gc->prpl->protocol == PROTO_OSCAR) {
- /* This is such a bad hack to get the right icon
- * for OSCAR. But it's pretty */
- if (isdigit(*gc->username)) {
- xpm = gc->prpl->list_icon(0);
- } else {
- xpm = gc->prpl->list_icon(0x10);
- }
- } else {
- xpm = gc->prpl->list_icon (0);
- }
- if (xpm == NULL)
- xpm = (char **)no_icon_xpm;
-
- gdkpixmap = gdk_pixmap_create_from_xpm_d(widget->window, &mask, &style->bg[GTK_STATE_NORMAL], xpm);
+
+ create_prpl_icon (widget, gc, &gdkpixmap, &mask);
pixmap = gtk_pixmap_new (gdkpixmap, mask);
gdk_pixmap_unref (gdkpixmap);
|