From: Jean-Philippe Orsini Date: Mon, 30 Apr 2012 09:29:43 +0000 (+0000) Subject: added fan alerts support X-Git-Tag: v0.8.0.5~343 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=7d6c646146c04c25ebc4cc265492f353d771395f added fan alerts support --- diff --git a/NEWS b/NEWS index d9c6953..b88a43e 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,7 @@ ** psensor: fixed i18n support for the application indicator menu. ** psensor: fixed i18n support for the application menu. ** psensor: added low thresold support for alerts. +** psensor: added fan alert support. * v0.6.2.18 ** added Slovenian translation file. diff --git a/src/glade/sensor-edit.glade b/src/glade/sensor-edit.glade index 1c163e1..ef1fab4 100644 --- a/src/glade/sensor-edit.glade +++ b/src/glade/sensor-edit.glade @@ -1,9 +1,15 @@ + + -9999 + 9999 + 1 + 10 + - -255 - 255 + -9999 + 9999 1 10 @@ -298,7 +304,7 @@ True False False - temp_limit + alarm_high_thresold_value 1 True True @@ -454,10 +460,4 @@ - - -255 - 255 - 1 - 10 - diff --git a/src/main.c b/src/main.c index d16174e..6ed42c5 100644 --- a/src/main.c +++ b/src/main.c @@ -296,7 +296,7 @@ associate_cb_alarm_raised(struct psensor **sensors, struct ui_psensor *ui) s->alarm_low_thresold = config_get_sensor_alarm_low_thresold(s->id); - if (is_temp_type(s->type)) { + if (is_temp_type(s->type) || is_fan_type(s->type)) { s->alarm_enabled = config_get_sensor_alarm_enabled(s->id); } else { diff --git a/src/ui_sensorpref.c b/src/ui_sensorpref.c index 58382de..e9ae6c0 100644 --- a/src/ui_sensorpref.c +++ b/src/ui_sensorpref.c @@ -317,7 +317,7 @@ update_pref(struct psensor *s, psensor_type_to_unit_str(s->type, use_celcius)); - if (is_temp_type(s->type)) { + 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_thresold, p->alarm_high_thresold); @@ -405,14 +405,15 @@ apply_prefs(struct sensor_pref **prefs, config_set_sensor_enabled(s->id, s->enabled); } - if (is_temp_type(s->type) && cfg->temperature_unit == CELCIUS) { - s->alarm_high_thresold = p->alarm_high_thresold; - s->alarm_low_thresold = p->alarm_low_thresold; - } else { + if (is_temp_type(s->type) + && cfg->temperature_unit == FAHRENHEIT) { s->alarm_high_thresold = fahrenheit_to_celcius (p->alarm_high_thresold); s->alarm_low_thresold = fahrenheit_to_celcius (p->alarm_low_thresold); + } else { + s->alarm_high_thresold = p->alarm_high_thresold; + s->alarm_low_thresold = p->alarm_low_thresold; } config_set_sensor_alarm_high_thresold(s->id,