[Xfce4-commits] <xfce4-diskperf-plugin:master> Show tooltip when device stats are not available. (bug #6749)
Landry Breuil
noreply at xfce.org
Wed Apr 25 19:44:01 CEST 2012
Updating branch refs/heads/master
to eddc5ce5a21930526246390e9eca2ce9223676ff (commit)
from 0b00a179f8679d23b47fb09693594228742b6fc8 (commit)
commit eddc5ce5a21930526246390e9eca2ce9223676ff
Author: Harald Judt <h.judt at gmx.at>
Date: Wed Apr 25 19:40:38 2012 +0200
Show tooltip when device stats are not available. (bug #6749)
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.
panel-plugin/main.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/panel-plugin/main.c b/panel-plugin/main.c
index 05ce707..0b4ae8c 100644
--- a/panel-plugin/main.c
+++ b/panel-plugin/main.c
@@ -171,8 +171,13 @@ static int DisplayPerf (struct diskperf_t *p_poPlugin)
#else
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;
More information about the Xfce4-commits
mailing list