Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/modules/battery
Modified Files:
e_mod_main.c
Log Message:
support unfilled middles (finally fix theme to have proepr shading - was lazy
at the start) - faster :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/battery/e_mod_main.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- e_mod_main.c 22 Mar 2005 19:30:30 -0000 1.23
+++ e_mod_main.c 31 Mar 2005 11:40:38 -0000 1.24
@@ -893,8 +893,11 @@
else if (discharging)
{
stat->state = BATTERY_STATE_DISCHARGING;
- if (((hours * 60) + minutes) <= ef->conf->alarm)
- stat->alarm = 1;
+ if (stat->level < 0.1)
+ {
+ if (((hours * 60) + minutes) <= ef->conf->alarm)
+ stat->alarm = 1;
+ }
}
if (level_unknown)
{
@@ -966,11 +969,13 @@
stat->level = 1.0;
return stat;
}
-
+
+
ef->battery_prev_battery = 1;
stat->has_battery = 1;
- if (bat_val > 0)
+ if (bat_val >= 0)
{
+ if (bat_val > 100) bat_val = 100;
snprintf(buf, sizeof(buf), "%i%%", bat_val);
stat->reading = strdup(buf);
stat->level = (double)bat_val / 100.0;
@@ -1012,9 +1017,11 @@
minutes = (time_val / 60) % 60;
snprintf(buf, sizeof(buf), "%i:%02i", hours, minutes);
stat->time = strdup(buf);
-
- if (((hours * 60) + minutes) <= ef->conf->alarm)
- stat->alarm = 1;
+ if (stat->level < 0.1)
+ {
+ if (((hours * 60) + minutes) <= ef->conf->alarm)
+ stat->alarm = 1;
+ }
}
return stat;
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs