highlight error torrents in red in the main window

This commit is contained in:
Charles Kerr 2007-08-18 19:22:31 +00:00
parent 10ecd7e169
commit f6973227ac
1 changed files with 5 additions and 3 deletions

View File

@ -79,6 +79,7 @@ formatname( GtkTreeViewColumn * col SHUTUP, GtkCellRenderer * rend,
{
TrTorrent * gtor;
char * name, * mb, * str, * top, * bottom;
const char * fmt;
guint64 size;
int status, err, eta, tpeers, upeers, dpeers;
@ -112,9 +113,10 @@ formatname( GtkTreeViewColumn * col SHUTUP, GtkCellRenderer * rend,
bottom = NULL;
}
str = g_markup_printf_escaped( "<b>%s (%s)</b>\n<small>%s\n%s</small>",
name, mb, top,
( NULL == bottom ? "" : bottom ) );
fmt = err==TR_OK
? "<b>%s (%s)</b>\n<small>%s\n%s</small>"
: "<span color='red'><b>%s (%s)</b>\n<small>%s\n%s</small></span>";
str = g_markup_printf_escaped( fmt, name, mb, top, (bottom ? bottom : "") );
g_object_set( rend, "markup", str, NULL );
g_free( name );
g_free( mb );