comparison src/gtkblist.c @ 12239:36d3b1eaf20e

[gaim-migrate @ 14541] this makes more sense to me committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 27 Nov 2005 19:45:29 +0000
parents 375f1f3817a8
children 1c0fd404e07e
comparison
equal deleted inserted replaced
12238:40f6334bb424 12239:36d3b1eaf20e
3192 3192
3193 if (gaim_gtk_conversations_get_first_unseen(GAIM_CONV_TYPE_IM, GAIM_UNSEEN_TEXT)) { 3193 if (gaim_gtk_conversations_get_first_unseen(GAIM_CONV_TYPE_IM, GAIM_UNSEEN_TEXT)) {
3194 GList *convs = gaim_get_ims(); 3194 GList *convs = gaim_get_ims();
3195 tooltip_text = g_string_new(""); 3195 tooltip_text = g_string_new("");
3196 while (convs) { 3196 while (convs) {
3197 GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION((GaimConversation *)convs->data); 3197 if(GAIM_IS_GTK_CONVERSATION(convs->data)) {
3198 3198 GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION((GaimConversation *)convs->data);
3199 if (gtkconv->unseen_state >= GAIM_UNSEEN_TEXT) { 3199
3200 g_string_append_printf(tooltip_text, 3200 if (gtkconv->unseen_state >= GAIM_UNSEEN_TEXT && gaim_gtkconv_is_hidden(gtkconv)) {
3201 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count), 3201 g_string_append_printf(tooltip_text,
3202 gtkconv->unseen_count, 3202 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count),
3203 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label))); 3203 gtkconv->unseen_count,
3204 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
3205 }
3204 } 3206 }
3205 convs = convs->next; 3207 convs = convs->next;
3206 } 3208 }
3209 if(tooltip_text->len > 0) {
3207 /* get rid of the last newline */ 3210 /* get rid of the last newline */
3208 tooltip_text = g_string_truncate(tooltip_text, tooltip_text->len -1); 3211 tooltip_text = g_string_truncate(tooltip_text, tooltip_text->len -1);
3209 img = gtk_image_new_from_stock(GAIM_STOCK_PENDING, GTK_ICON_SIZE_MENU); 3212 img = gtk_image_new_from_stock(GAIM_STOCK_PENDING, GTK_ICON_SIZE_MENU);
3210 3213
3211 gtkblist->menutrayicon = gtk_event_box_new(); 3214 gtkblist->menutrayicon = gtk_event_box_new();
3212 gtk_container_add(GTK_CONTAINER(gtkblist->menutrayicon), img); 3215 gtk_container_add(GTK_CONTAINER(gtkblist->menutrayicon), img);
3213 gtk_widget_show(img); 3216 gtk_widget_show(img);
3214 gtk_widget_show(gtkblist->menutrayicon); 3217 gtk_widget_show(gtkblist->menutrayicon);
3215 g_signal_connect(G_OBJECT(gtkblist->menutrayicon), "button-press-event", G_CALLBACK(menutray_press_cb), NULL); 3218 g_signal_connect(G_OBJECT(gtkblist->menutrayicon), "button-press-event", G_CALLBACK(menutray_press_cb), NULL);
3216 3219
3217 gaim_gtk_menu_tray_append(GAIM_GTK_MENU_TRAY(gtkblist->menutray), gtkblist->menutrayicon, g_string_free(tooltip_text, FALSE)); 3220 gaim_gtk_menu_tray_append(GAIM_GTK_MENU_TRAY(gtkblist->menutray), gtkblist->menutrayicon, tooltip_text->str);
3221 }
3222 g_string_free(tooltip_text, FALSE);
3218 } 3223 }
3219 } 3224 }
3220 3225
3221 static void 3226 static void
3222 conversation_deleting_cb(GaimConversation *conv, GaimGtkBuddyList *gtkblist) 3227 conversation_deleting_cb(GaimConversation *conv, GaimGtkBuddyList *gtkblist)