pidgin/gtkdocklet.c

changeset 21013
c41da5ae8893
parent 21011
0b21b3224a68
child 21014
deec3bfa4380
equal deleted inserted replaced
21012:f03dae654cec 21013:c41da5ae8893
143 143
144 /* set tooltip if messages are pending */ 144 /* set tooltip if messages are pending */
145 if (ui_ops->set_tooltip) { 145 if (ui_ops->set_tooltip) {
146 GString *tooltip_text = g_string_new(""); 146 GString *tooltip_text = g_string_new("");
147 for (l = convs, count = 0 ; l != NULL ; l = l->next, count++) { 147 for (l = convs, count = 0 ; l != NULL ; l = l->next, count++) {
148 if (PIDGIN_IS_PIDGIN_CONVERSATION(l->data)) { 148 PurpleConversation *conv = (PurpleConversation *)l->data;
149 PidginConversation *gtkconv = PIDGIN_CONVERSATION((PurpleConversation *)l->data); 149 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
150 if (count == DOCKLET_TOOLTIP_LINE_LIMIT - 1) 150
151 g_string_append(tooltip_text, _("Right-click for more unread messages...\n")); 151 if (count == DOCKLET_TOOLTIP_LINE_LIMIT - 1) {
152 else 152 g_string_append(tooltip_text, _("Right-click for more unread messages...\n"));
153 g_string_append_printf(tooltip_text, 153 } else if(gtkconv) {
154 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count), 154 g_string_append_printf(tooltip_text,
155 gtkconv->unseen_count, 155 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count),
156 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label))); 156 gtkconv->unseen_count,
157 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
158 } else {
159 g_string_append_printf(tooltip_text,
160 ngettext("%d unread message from %s\n", "%d unread messages from %s\n",
161 GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count"))),
162 GPOINTER_TO_INT(purple_conversation_get_data(conv, "unseen-count")),
163 purple_conversation_get_name(conv));
157 } 164 }
158 } 165 }
159 166
160 /* get rid of the last newline */ 167 /* get rid of the last newline */
161 if (tooltip_text->len > 0) 168 if (tooltip_text->len > 0)
756 switch (button_type) { 763 switch (button_type) {
757 case 1: 764 case 1:
758 if (pending) { 765 if (pending) {
759 GList *l = get_pending_list(1); 766 GList *l = get_pending_list(1);
760 if (l != NULL) { 767 if (l != NULL) {
761 purple_conversation_present((PurpleConversation *)l->data); 768 pidgin_conv_present_conversation((PurpleConversation *)l->data);
762 g_list_free(l); 769 g_list_free(l);
763 } 770 }
764 } else { 771 } else {
765 pidgin_blist_toggle_visibility(); 772 pidgin_blist_toggle_visibility();
766 } 773 }

mercurial