X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor-pkg-ubuntu.git;a=blobdiff_plain;f=src%2Fui_sensorpref.c;h=6ca0815f8a57c19e7471f62f39fa9e8edb6de583;hp=126f33c22516ffba1a9f97d433ad632f8f740181;hb=5c1e07fec97e34a94331b6b47e25c98f2b2e4cce;hpb=4c50d430bea4b8462b0ae7ab70baf3f538f87718 diff --git a/src/ui_sensorpref.c b/src/ui_sensorpref.c index 126f33c..6ca0815 100644 --- a/src/ui_sensorpref.c +++ b/src/ui_sensorpref.c @@ -89,7 +89,7 @@ sensor_pref_new(struct psensor *s, struct config *cfg) static void sensor_pref_free(struct sensor_pref *p) { if (!p) - return ; + return; free(p->name); free(p->color); @@ -290,23 +290,12 @@ update_pref(struct sensor_pref *p, struct config *cfg, GtkBuilder *builder) w_appindicator_label_enabled = GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "indicator_label_checkbox")); - if (is_temp_type(s->type) || is_fan_type(s->type)) { - gtk_toggle_button_set_active(w_alarm, p->alarm_enabled); - gtk_spin_button_set_value(w_high_threshold, - p->alarm_high_threshold); - gtk_spin_button_set_value(w_low_threshold, - p->alarm_low_threshold); - gtk_widget_set_sensitive(GTK_WIDGET(w_alarm), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(w_high_threshold), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(w_low_threshold), TRUE); - } else { - gtk_toggle_button_set_active(w_alarm, 0); - gtk_spin_button_set_value(w_high_threshold, 0); - gtk_spin_button_set_value(w_low_threshold, 0); - gtk_widget_set_sensitive(GTK_WIDGET(w_alarm), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(w_high_threshold), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(w_low_threshold), FALSE); - } + gtk_toggle_button_set_active(w_alarm, p->alarm_enabled); + gtk_spin_button_set_value(w_high_threshold, p->alarm_high_threshold); + gtk_spin_button_set_value(w_low_threshold, p->alarm_low_threshold); + gtk_widget_set_sensitive(GTK_WIDGET(w_alarm), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(w_high_threshold), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(w_low_threshold), TRUE); gtk_toggle_button_set_active(w_appindicator_enabled, p->appindicator_enabled); @@ -453,7 +442,7 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) if (!ok) { log_printf(LOG_ERR, error->message); g_error_free(error); - return ; + return; } w_sensors_list