From 581f88cfca14ac0e1aa7f0ab46983255e21b96c6 Mon Sep 17 00:00:00 2001 From: David Schneider Date: Tue, 14 Feb 2012 15:44:20 -0800 Subject: [PATCH] Bug 8316: Add tag for non-Pango text. --- panel-plugin/main.c | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/panel-plugin/main.c b/panel-plugin/main.c index 1f7a029..94cb4b6 100644 --- a/panel-plugin/main.c +++ b/panel-plugin/main.c @@ -211,7 +211,24 @@ static int DisplayCmdOutput (struct genmon_t *p_poPlugin) newVersion=1; } else - gtk_widget_hide (poMonitor->wValue); + { + /* Test if the result is a Raw Text */ + begin=strstr(p_poPlugin->acValue, ""); + end=strstr(p_poPlugin->acValue, ""); + if ((begin != NULL) && (end != NULL) && (begin < end) && (end-begin < BUFMAX*sizeof(char))) + { + char buf[BUFMAX]; + /* Get the text */ + strncpy(buf, begin+5*sizeof(char), end-begin-5*sizeof(char)); + buf[end-begin-5*sizeof(char)]='\0'; + gtk_label_set_text (GTK_LABEL (poMonitor->wValue), buf); + gtk_widget_show (poMonitor->wValue); + + newVersion=1; + } + else + gtk_widget_hide (poMonitor->wValue); + } /* Test if the result is a Bar */ begin=strstr(p_poPlugin->acValue, ""); -- 1.7.5.4