added highest temperature as label of the application indicator
authorJean-Philippe Orsini <jeanfi@gmail.com>
Wed, 16 Apr 2014 23:33:09 +0000 (01:33 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Wed, 16 Apr 2014 23:33:09 +0000 (01:33 +0200)
src/ui_appindicator.c

index 49ca58f..c6b3f52 100644 (file)
@@ -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);