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

def guidance-power-manager::PowerManager::_updateBatteryWidget (   self,
  batt,
  state,
  level,
  remain,
  rate 
) [private]

Retrieve battery information and update the related widgets accordingly. 

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

00775                                                                     :
        """ Retrieve battery information and update the related widgets accordingly. """
        self.BattProgress[batt].setEnabled(True)
        self.BattProgress[batt].setMaximum(100)
        self.BattProgress[batt].setValue(level)
        if state == "not present":
            self.BattProgress[batt].setFormat(i18n("not present"))
        elif state == "charging":
            self.BattProgress[batt].setFormat(i18n("Charging (%p%)"))
        elif state == "discharging":
            if rate > 0:
                showrate = rate/1000
                self.BattProgress[batt].setFormat(ki18nc("%1 is discharge rate in Watts", "Discharging (%p%) - %1 W").subs(showrate).toString())
            else:
                self.BattProgress[batt].setFormat(i18n("Discharging (%p%)"))
        else:
            self.BattProgress[batt].setFormat(i18n("%p%"))

    def _addCpuWidgets(self):


Generated by  Doxygen 1.6.0   Back to index