commit bd056a0c0c79944777c0da45ee18f92204f4fd7f Author: Harald Judt Date: Tue Apr 24 19:29:47 2012 +0200 Show tooltip when device stats are not available. When a device does not exist, or the stats are not available for whatever reason, make the tooltip convey that information to the user. Without this patch, no tooltip will be shown at all. diff --git a/panel-plugin/main.c b/panel-plugin/main.c index af925e3..e42dba9 100644 --- a/panel-plugin/main.c +++ b/panel-plugin/main.c @@ -174,8 +174,13 @@ static int DisplayPerf (struct diskperf_t *p_poPlugin) poConf->st_rdev = oStat.st_rdev; status = DevGetPerfData (&(poConf->st_rdev), &oPerf); #endif - if (status == -1) + if (status == -1) { + snprintf (acToolTips, sizeof(acToolTips), "%s: Device statistics unavailable.", + poConf->acTitle); + gtk_tooltips_set_tip (s_poToolTips, GTK_WIDGET (poMonitor->wEventBox), + acToolTips, 0); return (-1); + } if (poMonitor->oPrevPerf.timestamp_ns) { iInterval_ns = oPerf.timestamp_ns - poMonitor->oPrevPerf.timestamp_ns;