Logo Search packages:      
Sourcecode: guidance-power-manager version File versions

def guidance-power-manager::PowerManager::_getIcon (   self  )  [private]

Set systray icon depending on battery status/level. 

Definition at line 536 of file guidance-power-manager.py.

00536                       :
        """ Set systray icon depending on battery status/level. """
        if self.powermanager.hasBattery:
            if self.batt_state == "not present":
                self.icon = "battery-missing"
            if self.batt_state == "charged":
                self.icon = "battery-charging"
            elif self.batt_state == "discharging":
                if self.batt_level >= 95:
                    self.icon = "battery-100"
                elif self.batt_level < 95 and self.batt_level >= 85:
                    self.icon = "battery-080"
                elif self.batt_level < 85 and self.batt_level >= 75:
                    self.icon = "battery-080"
                elif self.batt_level < 75 and self.batt_level >= 60:
                    self.icon = "battery-060"
                elif self.batt_level < 65 and self.batt_level >= 45:
                    self.icon = "battery-060"
                elif self.batt_level < 45 and self.batt_level >= 30:
                    self.icon = "battery-040"
                elif self.batt_level < 30 and self.batt_level >= 20:
                    self.icon = "battery-040"
                elif self.batt_level < 20 and self.batt_level >= 10:
                    self.icon = "battery-caution"
                elif self.batt_level < 10 and self.batt_level >= 5:
                    self.icon = "battery-low"
                else:
                    self.icon = "battery-low"
            elif self.batt_state == "charging":
                if self.batt_level >= 95:
                    self.icon = "battery-charging"
                elif self.batt_level < 95 and self.batt_level >= 85:
                    self.icon = "battery-charging-080"
                elif self.batt_level < 85 and self.batt_level >= 75:
                    self.icon = "battery-charging-080"
                elif self.batt_level < 75 and self.batt_level >= 60:
                    self.icon = "battery-charging-060"
                elif self.batt_level < 65 and self.batt_level >= 45:
                    self.icon = "battery-charging-060"
                elif self.batt_level < 45 and self.batt_level >= 30:
                    self.icon = "battery-charging-040"
                elif self.batt_level < 30 and self.batt_level >= 20:
                    self.icon = "battery-charging-040"
                elif self.batt_level < 20 and self.batt_level >= 10:
                    self.icon = "battery-charging-caution"
                elif self.batt_level < 10 and self.batt_level >= 5:
                    self.icon = "battery-charging-low"
                else:
                    self.icon = "battery-charging-low"
        else:
            self.icon = "battery-missing"
        return self.icon

    def getIcon(self):


Generated by  Doxygen 1.6.0   Back to index