From f6973227ac1baa635283012ddb3265ef3be499a5 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 18 Aug 2007 19:22:31 +0000 Subject: [PATCH] highlight error torrents in red in the main window --- gtk/tr_window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gtk/tr_window.c b/gtk/tr_window.c index e8dfee03d..8a02f557d 100644 --- a/gtk/tr_window.c +++ b/gtk/tr_window.c @@ -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( "%s (%s)\n%s\n%s", - name, mb, top, - ( NULL == bottom ? "" : bottom ) ); + fmt = err==TR_OK + ? "%s (%s)\n%s\n%s" + : "%s (%s)\n%s\n%s"; + str = g_markup_printf_escaped( fmt, name, mb, top, (bottom ? bottom : "") ); g_object_set( rend, "markup", str, NULL ); g_free( name ); g_free( mb );