added support of alarm for sensors expressed as percent.
* Added 'Hide' menu item in the contextual menu of the list of
sensors.
* Added free memory support.
+* Added alarm support of sensors expressed as percent.
v1.1.1
------
Added free memory support.\r
</p>\r
</li>\r
+<li>\r
+<p>\r
+Added alarm support of sensors expressed as percent.\r
+</p>\r
+</li>\r
</ul></div>\r
</div>\r
</div>\r
<div id="footnotes"><hr /></div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 2014-09-08 21:59:03 CEST\r
+Last updated 2014-09-09 08:33:08 CEST\r
</div>\r
</div>\r
</body>\r
struct psensor *s = *sensor_cur;
no_graphs = 0;
- if (is_fan_type(s->type)) {
+ if (s->type & SENSOR_TYPE_RPM) {
min = min_rpm;
max = max_rpm;
} else if (s->type & SENSOR_TYPE_PERCENT) {
cr_pixmap = gdk_cairo_create(gtk_widget_get_window(w_graph));
if (cr_pixmap) {
-
if (config->alpha_channel_enabled)
cairo_set_operator(cr_pixmap, CAIRO_OPERATOR_SOURCE);
return type & SENSOR_TYPE_TEMP;
}
-int is_fan_type(unsigned int type)
-{
- return type & SENSOR_TYPE_FAN;
-}
-
char *
psensor_value_to_str(unsigned int type, double value, int use_celsius)
{
return "\302\260C";
else
return "\302\260F";
- } else if (is_fan_type(type)) {
+ } else if (type & SENSOR_TYPE_RPM) {
return _("RPM");
- } else if (type & SENSOR_TYPE_CPU_USAGE) {
+ } else if (type & SENSOR_TYPE_PERCENT) {
return _("%");
} else {
return _("N/A");
int psensor_list_contains_type(struct psensor **sensors, unsigned int type);
int is_temp_type(unsigned int type);
-int is_fan_type(unsigned int type);
double get_min_temp(struct psensor **sensors);
double get_max_temp(struct psensor **sensors);
s->alarm_low_threshold
= config_get_sensor_alarm_low_threshold(s->id);
- if (is_temp_type(s->type) || is_fan_type(s->type)) {
- s->alarm_enabled
+ s->alarm_enabled
= config_get_sensor_alarm_enabled(s->id);
- } else {
- s->alarm_high_threshold = 0;
- s->alarm_enabled = 0;
- }
sensor_cur++;
}
if (is_temp_type((*p)->type))
str = "999UUU";
- else if (is_fan_type((*p)->type))
+ else if ((*p)->type & SENSOR_TYPE_RPM)
str = "999UUU";
- else /* cpu load */
+ else /* percent */
str = "999%";
if (guide == NULL) {
if (is_temp_type(sensor->type))
summary = _("Temperature alert");
- else if (is_fan_type(sensor->type))
- summary = _("Fan alert");
+ else if (sensor->type & SENSOR_TYPE_RPM)
+ summary = _("Fan speed alert");
else
summary = _("N/A");
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);