From ab7f1a53d66d4812d5aacfa50bf75df379a65309 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Thu, 17 Apr 2014 01:33:09 +0200 Subject: [PATCH] added highest temperature as label of the application indicator --- src/ui_appindicator.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ui_appindicator.c b/src/ui_appindicator.c index 49ca58f..c6b3f52 100644 --- a/src/ui_appindicator.c +++ b/src/ui_appindicator.c @@ -175,12 +175,21 @@ static GtkWidget *get_menu(struct ui_psensor *ui) void ui_appindicator_update(struct ui_psensor *ui, unsigned int attention) { AppIndicatorStatus status; + char *label; + double v; if (!indicator) return; status = app_indicator_get_status(indicator); + v = psensor_get_max_current_value(ui->sensors, SENSOR_TYPE_TEMP); + if (v != UNKNOWN_DBL_VALUE) { + label = psensor_value_to_str(SENSOR_TYPE_TEMP, v, 1); + app_indicator_set_label(indicator, label, NULL); + free(label); + } + if (!attention && status == APP_INDICATOR_STATUS_ATTENTION) app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); -- 2.7.4