prepare to release 1.10.3

+ added ability to set transparent background
This commit is contained in:
arcan1s
2014-07-08 10:12:20 +04:00
parent 43ee40a65d
commit 11a6f01ae3
20 changed files with 794 additions and 703 deletions

View File

@ -55,6 +55,7 @@ class ConfigDefinition:
settings.set('font_style', str(self.configpage['appearance'].ui.comboBox_style.currentText()))
settings.set('font_weight', self.configpage['appearance'].ui.spinBox_weight.value())
settings.set('background', self.configpage['advanced'].ui.checkBox_background.checkState())
settings.set('layout', self.configpage['advanced'].ui.checkBox_layout.checkState())
settings.set('popup', self.configpage['advanced'].ui.checkBox_popup.checkState())
settings.set('left_stretch', self.configpage['advanced'].ui.checkBox_leftStretch.checkState())
@ -154,6 +155,7 @@ class ConfigDefinition:
self.configpage['appearance'].ui.comboBox_style.setCurrentIndex(1)
self.configpage['appearance'].ui.spinBox_weight.setValue(settings.get('font_weight', 400).toInt()[0])
self.configpage['advanced'].ui.checkBox_background.setCheckState(settings.get('background', 2).toInt()[0])
self.configpage['advanced'].ui.checkBox_layout.setCheckState(settings.get('layout', 0).toInt()[0])
self.configpage['advanced'].ui.checkBox_popup.setCheckState(settings.get('popup', 2).toInt()[0])
self.configpage['advanced'].ui.checkBox_leftStretch.setCheckState(settings.get('left_stretch', 2).toInt()[0])

View File

@ -96,12 +96,10 @@ class pyTextWidget(plasmascript.Applet):
self.timer = QTimer()
QObject.connect(self.timer, SIGNAL("timeout()"), self.startPolling)
self.theme = Plasma.Svg(self)
self.initTooltip()
self.reInit()
self.applet.setLayout(self.ptm['layout'])
self.theme = Plasma.Svg(self)
self.theme.setImagePath("widgets/background")
self.setBackgroundHints(Plasma.Applet.DefaultBackground)
self.setHasConfigurationInterface(True)
@ -694,6 +692,19 @@ class pyTextWidget(plasmascript.Applet):
self.startPolling()
def setTransparentBackground(self, hasBackground=2):
"""function to set background to the widget"""
if self.debug: qDebug("[PTM] [main.py] [setTransparentBackground]")
if self.debug: qDebug("[PTM] [main.py] [setTransparentBackground] : Run function with hasBackground '%s'" %(hasBackground))
if (hasBackground == 2):
self.theme.setImagePath("widgets/background")
self.setBackgroundHints(Plasma.Applet.DefaultBackground)
else:
self.theme.setImagePath("")
self.setBackgroundHints(Plasma.Applet.NoBackground)
def setNetdev(self):
"""function to set network device"""
if self.debug: qDebug("[PTM] [main.py] [setNetdev]")

View File

@ -49,6 +49,7 @@ class Reinit():
ptmVars['adv']['acDev'] = str(settings.get('ac_device', '/sys/class/power_supply/AC/online'))
ptmVars['adv']['acOnline'] = str(settings.get('ac_online', '(*)'))
ptmVars['adv']['acOffline'] = str(settings.get('ac_offline', '( )'))
ptmVars['adv']['background'] = settings.get('background', 2).toInt()[0]
ptmVars['adv']['batDev'] = str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity'))
ptmVars['adv']['customTime'] = str(settings.get('custom_time', '$hh:$mm'))
ptmVars['adv']['customUptime'] = str(settings.get('custom_uptime', '$dd,$hh,$mm'))
@ -91,6 +92,7 @@ class Reinit():
if self.debug: qDebug("[PTM] [reinit.py] [reinit] : Returns names '%s'" %(ptmNames))
self.parent.applySettings('names', ptmNames)
self.parent.setTransparentBackground(ptmVars['adv']['background'])
self.parent.createLayout(ptmVars['adv']['layout'], ptmVars['adv']['leftStretch'])
ptmVars['formats'] = {}
ptmVars['tooltip']['required'] = []