comparison src/gtkconv.c @ 6433:91087e6dfbfd

[gaim-migrate @ 6941] Now tabs with people who aren't on your buddy list get icons too. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 11 Aug 2003 20:37:12 +0000
parents ba0b99a72be2
children ded6796da6b9
comparison
equal deleted inserted replaced
6432:f9428d38c03b 6433:91087e6dfbfd
3942 G_CALLBACK(close_conv_cb), conv); 3942 G_CALLBACK(close_conv_cb), conv);
3943 3943
3944 /* Status icon. */ 3944 /* Status icon. */
3945 account = gaim_conversation_get_account(conv); 3945 account = gaim_conversation_get_account(conv);
3946 b = gaim_find_buddy(account, name); 3946 b = gaim_find_buddy(account, name);
3947 if (b != NULL) 3947 if (b != NULL) {
3948 gtkconv->icon = gtk_image_new_from_pixbuf( 3948 gtkconv->icon = gtk_image_new_from_pixbuf(
3949 gaim_gtk_blist_get_status_icon((GaimBlistNode *)b, 3949 gaim_gtk_blist_get_status_icon((GaimBlistNode *)b,
3950 GAIM_STATUS_ICON_SMALL)); 3950 GAIM_STATUS_ICON_SMALL));
3951 else 3951 } else {
3952 gtkconv->icon = gtk_image_new(); 3952 GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol(account));
3953 GaimPluginProtocolInfo *prpl_info;
3954
3955 if (plugin != NULL)
3956 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin);
3957
3958 if (prpl_info != NULL) {
3959 char buf[32];
3960 char *filename;
3961 GdkPixbuf *pixbuf, *scale;
3962
3963 const char *proto_name = prpl_info->list_icon(account, NULL);
3964 g_snprintf(buf, sizeof(buf), "%s.png", proto_name);
3965 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status",
3966 "default", buf, NULL);
3967 pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
3968
3969 g_free(filename);
3970
3971 if (pixbuf != NULL) {
3972 /* Scale and insert the image */
3973 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
3974 GDK_INTERP_BILINEAR);
3975 gtkconv->icon = gtk_image_new_from_pixbuf(scale);
3976
3977 g_object_unref(G_OBJECT(pixbuf));
3978 g_object_unref(G_OBJECT(scale));
3979 }
3980 else
3981 gtkconv->icon = gtk_image_new();
3982 }
3983
3984 }
3953 3985
3954 /* Tab label. */ 3986 /* Tab label. */
3955 gtkconv->tab_label = gtk_label_new(gaim_conversation_get_title(conv)); 3987 gtkconv->tab_label = gtk_label_new(gaim_conversation_get_title(conv));
3956 #if 0 3988 #if 0
3957 gtk_misc_set_alignment(GTK_MISC(gtkconv->tab_label), 0.00, 0.5); 3989 gtk_misc_set_alignment(GTK_MISC(gtkconv->tab_label), 0.00, 0.5);