comparison pidgin/gtkblist.c @ 20323:ee70ed741ada

applied changes from 61346ebfdbe38e90d131141a7fa41abeda7984c5 through 2ed39e287c8bc0502ecaf3b390fc0441ab160a99
author Luke Schierer <lschiere@pidgin.im>
date Fri, 19 Oct 2007 17:56:36 +0000
parents 6b8bc3309ab7
children 24ce4fcce5b0
comparison
equal deleted inserted replaced
20322:aad0f10eb4dc 20323:ee70ed741ada
3457 idletime = g_strdup_printf(_("Idle %dm"), imin); 3457 idletime = g_strdup_printf(_("Idle %dm"), imin);
3458 } 3458 }
3459 else 3459 else
3460 idletime = g_strdup(_("Idle")); 3460 idletime = g_strdup(_("Idle"));
3461 3461
3462 if (!selected) 3462 if (!selected) {
3463 g_free(text);
3463 text = g_strdup_printf("<span color='%s'>%s</span>\n" 3464 text = g_strdup_printf("<span color='%s'>%s</span>\n"
3464 "<span color='%s' size='smaller'>%s%s%s</span>", 3465 "<span color='%s' size='smaller'>%s%s%s</span>",
3465 dim_grey(), esc, dim_grey(), 3466 dim_grey(), esc, dim_grey(),
3466 idletime != NULL ? idletime : "", 3467 idletime != NULL ? idletime : "",
3467 (idletime != NULL && statustext != NULL) ? " - " : "", 3468 (idletime != NULL && statustext != NULL) ? " - " : "",
3468 statustext != NULL ? statustext : ""); 3469 statustext != NULL ? statustext : "");
3469 } 3470 }
3470 else if (!selected && !statustext) /* We handle selected text later */ 3471 }
3472 else if (!selected && !statustext) {/* We handle selected text later */
3473 g_free(text);
3471 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); 3474 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
3472 else if (!selected && !text) 3475 } else if (!selected && !text) {
3476 g_free(text);
3473 text = g_strdup_printf("<span color='%s'>%s</span>\n" 3477 text = g_strdup_printf("<span color='%s'>%s</span>\n"
3474 "<span color='%s' size='smaller'>%s</span>", 3478 "<span color='%s' size='smaller'>%s</span>",
3475 dim_grey(), esc, dim_grey(), 3479 dim_grey(), esc, dim_grey(),
3476 statustext != NULL ? statustext : ""); 3480 statustext != NULL ? statustext : "");
3481 }
3477 } else if (!PURPLE_BUDDY_IS_ONLINE(b)) { 3482 } else if (!PURPLE_BUDDY_IS_ONLINE(b)) {
3478 if (!selected && !statustext) /* We handle selected text later */ 3483 if (!selected && !statustext) {/* We handle selected text later */
3484 g_free(text);
3479 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); 3485 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
3480 else if (!selected && !text) 3486 } else if (!selected && !text)
3481 text = g_strdup_printf("<span color='%s'>%s</span>\n" 3487 text = g_strdup_printf("<span color='%s'>%s</span>\n"
3482 "<span color='%s' size='smaller'>%s</span>", 3488 "<span color='%s' size='smaller'>%s</span>",
3483 dim_grey(), esc, dim_grey(), 3489 dim_grey(), esc, dim_grey(),
3484 statustext != NULL ? statustext : ""); 3490 statustext != NULL ? statustext : "");
3485 3491
3492 esc, dim_grey(), 3498 esc, dim_grey(),
3493 statustext != NULL ? statustext : ""); 3499 statustext != NULL ? statustext : "");
3494 } 3500 }
3495 3501
3496 /* It is selected. */ 3502 /* It is selected. */
3497 if ((selected && !text) || (selected && idletime)) 3503 if ((selected && !text) || (selected && idletime)) {
3504 g_free(text);
3498 text = g_strdup_printf("%s\n" 3505 text = g_strdup_printf("%s\n"
3499 "<span size='smaller'>%s%s%s</span>", 3506 "<span size='smaller'>%s%s%s</span>",
3500 esc, 3507 esc,
3501 idletime != NULL ? idletime : "", 3508 idletime != NULL ? idletime : "",
3502 (idletime != NULL && statustext != NULL) ? " - " : "", 3509 (idletime != NULL && statustext != NULL) ? " - " : "",
3503 statustext != NULL ? statustext : ""); 3510 statustext != NULL ? statustext : "");
3511 }
3504 3512
3505 g_free(idletime); 3513 g_free(idletime);
3506 g_free(statustext); 3514 g_free(statustext);
3507 g_free(esc); 3515 g_free(esc);
3508 3516