On 13 Sep 2007, at 23:42, David Chisnall wrote: > - It seems to be Linux-only. Étoilé is a cross-platform project, and > there is no abstraction layer between the Linux-specific code and the > rest, which will make this very difficult to port to other > platforms. Take a look at Etoile/Services/Private/MenuServer/ > Subprojects/AboutEtoileEntry/ETMachineInfo* for a clean way of doing > this. This class provides info about the amount of real memory and > the CPU model / speed, and works on Linux, FreeBSD, OpenBSD, Darwin > and Solaris.
I have added two methods to ETMachineInfo: + (unsigned int) batteryLife; + (unsigned char) batteryPercent; + (BOOL) isUsingMains; These return the number of minutes remaining on battery, the percentage of battery life remaining, and whether the machine is on mains power. I have added code to the FreeBSD category on this class which implements this method. I suggest this class be moved into EtoileFoundation (or some other sensible framework), where it can be used by anything that needs to, and support be added for other operating systems as people use them. Thoughts? David _______________________________________________ Etoile-discuss mailing list [email protected] https://mail.gna.org/listinfo/etoile-discuss
