From cefae761c71e682beab413d3c0799024fadc184b Mon Sep 17 00:00:00 2001 From: David Schneider Date: Tue, 14 Feb 2012 19:29:35 -0800 Subject: [PATCH] Add an explicit tag and assume other text is raw. --- panel-plugin/main.c | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/panel-plugin/main.c b/panel-plugin/main.c index 1f7a029..b539ea0 100644 --- a/panel-plugin/main.c +++ b/panel-plugin/main.c @@ -205,13 +205,30 @@ static int DisplayCmdOutput (struct genmon_t *p_poPlugin) /* Get the text */ strncpy(buf, begin+5*sizeof(char), end-begin-5*sizeof(char)); buf[end-begin-5*sizeof(char)]='\0'; - gtk_label_set_markup (GTK_LABEL (poMonitor->wValue), buf); + 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 Pango 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_markup (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, ""); @@ -239,7 +256,7 @@ static int DisplayCmdOutput (struct genmon_t *p_poPlugin) if (newVersion == 0) { gtk_widget_show (poMonitor->wValue); - gtk_label_set_markup (GTK_LABEL (poMonitor->wValue), + gtk_label_set_text (GTK_LABEL (poMonitor->wValue), p_poPlugin->acValue); } -- 1.7.5.4