comparison src/gtkstatusbox.c @ 12228:f28e51bf9be8

[gaim-migrate @ 14530] patch by sadrul to make the per-accounts status boxes show error/connecting, etc. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sat, 26 Nov 2005 16:27:45 +0000
parents 152748df85cf
children 65477e67a712
comparison
equal deleted inserted replaced
12227:b4391f2ae8de 12228:f28e51bf9be8
229 } 229 }
230 230
231 static void 231 static void
232 gtk_gaim_status_box_refresh(GtkGaimStatusBox *status_box) 232 gtk_gaim_status_box_refresh(GtkGaimStatusBox *status_box)
233 { 233 {
234 char *text, *title; 234 char *text = NULL, *title;
235 char aa_color[8]; 235 char aa_color[8];
236 GdkPixbuf *pixbuf; 236 GdkPixbuf *pixbuf;
237 GtkTreePath *path; 237 GtkTreePath *path;
238 GtkStyle *style; 238 GtkStyle *style;
239 239
245 245
246 title = status_box->title; 246 title = status_box->title;
247 if (!title) 247 if (!title)
248 title = ""; 248 title = "";
249 249
250
251 if (status_box->error) { 250 if (status_box->error) {
252 text = g_strdup_printf("%s\n<span size=\"smaller\" weight=\"bold\" color=\"red\">%s</span>", 251 text = g_strdup_printf("<span size=\"smaller\" weight=\"bold\" color=\"red\">%s</span>",
253 title, status_box->error); 252 status_box->error);
254 } else if (status_box->typing) { 253 } else if (status_box->typing) {
255 text = g_strdup_printf("%s\n<span size=\"smaller\" color=\"%s\">%s</span>", 254 text = g_strdup_printf("<span size=\"smaller\" color=\"%s\">%s</span>",
256 title, aa_color, _("Typing")); 255 aa_color, _("Typing"));
257 } else if (status_box->connecting) { 256 } else if (status_box->connecting) {
258 text = g_strdup_printf("%s\n<span size=\"smaller\" color=\"%s\">%s</span>", 257 text = g_strdup_printf("<span size=\"smaller\" color=\"%s\">%s</span>",
259 title, aa_color, _("Connecting")); 258 aa_color, _("Connecting"));
260 } else if (status_box->desc) { 259 } else if (status_box->desc) {
261 text = g_strdup_printf("%s\n<span size=\"smaller\" color=\"%s\">%s</span>", 260 text = g_strdup_printf("<span size=\"smaller\" color=\"%s\">%s</span>",
262 title, aa_color, status_box->desc); 261 aa_color, status_box->desc);
263 } else {
264 text = g_strdup_printf("%s", title);
265 } 262 }
266 263
267 if (status_box->account) { 264 if (status_box->account) {
268 char *text2 = g_strdup_printf("%s\n<span size=\"smaller\">%s</span>", gaim_account_get_username(status_box->account), text); 265 char *text2 = g_strdup_printf("%s\n<span size=\"smaller\">%s</span>",
266 gaim_account_get_username(status_box->account),
267 text ? text : title);
269 g_free(text); 268 g_free(text);
270 text = text2; 269 text = text2;
271 } 270 } else if (text) {
272 271 char *text2 = g_strdup_printf("%s\n%s", title, text);
272 g_free(text);
273 text = text2;
274 } else {
275 text = g_strdup(title);
276 }
273 277
274 if (status_box->connecting) 278 if (status_box->connecting)
275 pixbuf = status_box->connecting_pixbufs[status_box->connecting_index]; 279 pixbuf = status_box->connecting_pixbufs[status_box->connecting_index];
276 else if (status_box->error) 280 else if (status_box->error)
277 pixbuf = status_box->error_pixbuf; 281 pixbuf = status_box->error_pixbuf;