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

def guidance-power-manager::PowerManager::uiToConfig (   self  ) 

Read all values from the UI and write them to the config file. 

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

00390                         :
        """ Read all values from the UI and write them to the config file. """
        self.config.writeEntry("poweredBrightness", QVariant(self.PoweredBrightnessSlider.value()))
        self.config.writeEntry("batteryBrightness", QVariant(self.BatteryBrightnessSlider.value()))

        self.config.writeEntry("poweredIdleTime", QVariant(self.PoweredIdleTime.value()))
        self.config.writeEntry("poweredIdleAction", QVariant(self._getCB(self.PoweredIdleCombo, self.cb_act)))
        self.config.writeEntry("batteryIdleTime", QVariant(self.BatteryIdleTime.value()))
        self.config.writeEntry("batteryIdleAction", QVariant(self._getCB(self.BatteryIdleCombo, self.cb_act)))
        self.config.writeEntry("poweredFreqPolicy", QVariant(self._getCB(self.PoweredFreqCombo, self.cb_freq)))
        self.config.writeEntry("batteryFreqPolicy", QVariant(self._getCB(self.BatteryFreqCombo, self.cb_freq)))

        self.config.writeEntry("batteryCriticalAction", QVariant(self._getCB(self.BatteryCriticalCombo, self.cb_act)))
        self.config.writeEntry("criticalRemainTime", QVariant(self.CriticalRemainTime.value()))

        self.config.writeEntry("laptopLidAction", QVariant(self._getRB(self.LaptopLidRadios, self.lid_act)))
        self.config.writeEntry("lockOnResume", QVariant(self.lockScreenOnResume.isChecked()))

        self.criticalLevel = self.CriticalRemainTime.value()

        self.config.sync()

    #FIXME add global key bindings for these
    #def showBrightnessPopup(self):
    #    if self.powermanager.onBattery():
    #        value=self.BatteryBrightnessSlider.value()*100/self.BatteryBrightnessSlider.maxValue()
    #    else:
    #        value=self.PoweredBrightnessSlider.value()*100/self.PoweredBrightnessSlider.maxValue()
    #    self.brightnessPopup = KPassivePopup.message('<b>Brightness:</b> '+str(value)+'%', self.systray)
    #    """pop.setTimeout(3000)"""
    #    self.brightnessPopup.show()

    #def setBrightnessUp(self):
    #    """Increments slider value by 10%"""
    #    if self.powermanager.onBattery():
    #        #self.BatteryBrightnessSlider.setValue(float(self.BatteryBrightnessSlider.value())+max(float(self.BatteryBrightnessSlider.maxValue())/float(10),1))
    #    else:
    #        self.PoweredBrightnessSlider.setValue(float(self.PoweredBrightnessSlider.value())+max(float(self.PoweredBrightnessSlider.maxValue())/float(10),1))
     #   self.showBrightnessPopup()

    #def setBrightnessDown(self):
    #    """Decrements slider value by 10%"""
    #    if self.powermanager.onBattery():
    #        self.BatteryBrightnessSlider.setValue(float(self.BatteryBrightnessSlider.value())-max(float(self.BatteryBrightnessSlider.maxValue())/float(10),1))
    #    else:
    #        self.PoweredBrightnessSlider.setValue(float(self.PoweredBrightnessSlider.value())-max(float(self.PoweredBrightnessSlider.maxValue())/float(10),1))
    #    self.showBrightnessPopup()

    #def getBrightness(self):
    #  """Work with percentages - it's a bit nicer"""
    #  if self.powermanager.onBattery():
    #    value=self.BatteryBrightnessSlider.value()*100/self.BatteryBrightnessSlider.maxValue()
    #  else:
    #    value=self.PoweredBrightnessSlider.value()*100/self.PoweredBrightnessSlider.maxValue()
    #  return QString(str(value))

    def lockScreen(self):


Generated by  Doxygen 1.6.0   Back to index