Mercurial > pidgin.yaz
comparison pidgin/gtkblist.c @ 15500:45ecefd0ce3a
Blocked emblem
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 03 Feb 2007 01:08:41 +0000 |
parents | 74efe677c8a5 |
children | d75099d2567e |
comparison
equal
deleted
inserted
replaced
15499:4ead39213173 | 15500:45ecefd0ce3a |
---|---|
2990 } else if(GAIM_BLIST_NODE_IS_CHAT(node)) { | 2990 } else if(GAIM_BLIST_NODE_IS_CHAT(node)) { |
2991 return gaim_gtk_create_prpl_icon(((GaimChat*)node)->account, PIDGIN_PRPL_ICON_SMALL); | 2991 return gaim_gtk_create_prpl_icon(((GaimChat*)node)->account, PIDGIN_PRPL_ICON_SMALL); |
2992 } else { | 2992 } else { |
2993 return NULL; | 2993 return NULL; |
2994 } | 2994 } |
2995 | |
2996 if (!gaim_privacy_check(buddy->account, gaim_buddy_get_name(buddy))) { | |
2997 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "blocked.png", NULL); | |
2998 return gdk_pixbuf_new_from_file(path, NULL); | |
2999 } | |
2995 | 3000 |
2996 prpl = gaim_find_prpl(gaim_account_get_protocol_id(buddy->account)); | 3001 prpl = gaim_find_prpl(gaim_account_get_protocol_id(buddy->account)); |
2997 if (!prpl) | 3002 if (!prpl) |
2998 return NULL; | 3003 return NULL; |
2999 | 3004 |
3120 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_PERSON, | 3125 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_PERSON, |
3121 icon_size, "GtkTreeView"); | 3126 icon_size, "GtkTreeView"); |
3122 } | 3127 } |
3123 | 3128 |
3124 return ret; | 3129 return ret; |
3125 | |
3126 #if 0 | |
3127 if(buddy) { | |
3128 GaimAccount *account; | |
3129 GaimPlugin *prpl; | |
3130 GaimPluginProtocolInfo *prpl_info; | |
3131 GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, | |
3132 gaim_buddy_get_name(buddy), | |
3133 gaim_buddy_get_account(buddy)); | |
3134 | |
3135 account = buddy->account; | |
3136 | |
3137 prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); | |
3138 if(!prpl) | |
3139 return NULL; | |
3140 | |
3141 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); | |
3142 | |
3143 if(prpl_info && prpl_info->list_icon) { | |
3144 protoname = prpl_info->list_icon(account, buddy); | |
3145 } | |
3146 | |
3147 if(conv != NULL) { | |
3148 GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); | |
3149 if(gtkconv != NULL && gaim_gtkconv_is_hidden(gtkconv)) { | |
3150 /* add pending emblem */ | |
3151 if(size == GAIM_STATUS_ICON_SMALL) { | |
3152 emblems[0].filename="pending"; | |
3153 } | |
3154 else { | |
3155 emblems[3].filename=emblems[2].filename; | |
3156 emblems[2].filename="pending"; | |
3157 } | |
3158 } | |
3159 } | |
3160 } | |
3161 | |
3162 if(buddy && GAIM_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff) { | |
3163 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "login.png", NULL); | |
3164 } else if(buddy && !GAIM_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff) { | |
3165 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "logout.png", NULL); | |
3166 } else if(buddy || chat) { | |
3167 char *image = g_strdup_printf("%s.png", protoname); | |
3168 filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", image, NULL); | |
3169 g_free(image); | |
3170 } else { | |
3171 /* gaim dude */ | |
3172 filename = g_build_filename(DATADIR, "pixmaps", "gaim.png", NULL); | |
3173 } | |
3174 | |
3175 status = gdk_pixbuf_new_from_file(filename, NULL); | |
3176 g_free(filename); | |
3177 | |
3178 if(!status) { | |
3179 g_string_free(key, TRUE); | |
3180 return NULL; | |
3181 } | |
3182 | |
3183 scale = gdk_pixbuf_scale_simple(status, scalesize, scalesize, | |
3184 GDK_INTERP_BILINEAR); | |
3185 g_object_unref(status); | |
3186 | |
3187 if(buddy) { | |
3188 presence = gaim_buddy_get_presence(buddy); | |
3189 if (!GAIM_BUDDY_IS_ONLINE(buddy)) | |
3190 gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.0, FALSE); | |
3191 else if (gaim_presence_is_idle(presence)) | |
3192 { | |
3193 gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.25, FALSE); | |
3194 } | |
3195 | |
3196 if (!gaim_privacy_check(buddy->account, gaim_buddy_get_name(buddy))) | |
3197 { | |
3198 GdkPixbuf *emblem; | |
3199 char *filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "blocked.png", NULL); | |
3200 | |
3201 emblem = gdk_pixbuf_new_from_file(filename, NULL); | |
3202 g_free(filename); | |
3203 | |
3204 if (emblem) | |
3205 { | |
3206 gdk_pixbuf_composite(emblem, scale, | |
3207 0, 0, scalesize, scalesize, | |
3208 0, 0, | |
3209 (double)scalesize / gdk_pixbuf_get_width(emblem), | |
3210 (double)scalesize / gdk_pixbuf_get_height(emblem), | |
3211 GDK_INTERP_BILINEAR, | |
3212 224); | |
3213 g_object_unref(emblem); | |
3214 } | |
3215 } | |
3216 } | |
3217 | |
3218 /* Insert the new icon into the status icon hash table */ | |
3219 g_hash_table_insert (status_icon_hash_table, key, scale); | |
3220 gdk_pixbuf_ref(scale); | |
3221 | |
3222 return scale; | |
3223 #endif | |
3224 } | 3130 } |
3225 | 3131 |
3226 static gchar *gaim_gtk_blist_get_name_markup(GaimBuddy *b, gboolean selected) | 3132 static gchar *gaim_gtk_blist_get_name_markup(GaimBuddy *b, gboolean selected) |
3227 { | 3133 { |
3228 const char *name; | 3134 const char *name; |