From: Jean-Philippe Orsini Date: Wed, 16 Apr 2014 23:33:09 +0000 (+0200) Subject: added highest temperature as label of the application indicator X-Git-Tag: v1.0.1~53 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=ab7f1a53d66d4812d5aacfa50bf75df379a65309 added highest temperature as label of the application indicator --- 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);