release 1.8.2

This commit is contained in:
arcan1s
2014-05-08 00:31:06 +04:00
parent 4857c6658f
commit 962478a27a
15 changed files with 621 additions and 594 deletions

View File

@ -48,6 +48,7 @@ class ConfigDefinition:
settings.set('custom_time', str(self.configpage.ui.lineEdit_timeFormat.text()))
settings.set('custom_uptime', str(self.configpage.ui.lineEdit_uptimeFormat.text()))
settings.set('temp_units', str(self.configpage.ui.comboBox_tempUnits.currentText()))
item = QStringList()
for i in range(self.configpage.ui.listWidget_tempDevice.count()):
item.append(self.configpage.ui.listWidget_tempDevice.item(i).text())
@ -133,6 +134,8 @@ class ConfigDefinition:
self.configpage.ui.lineEdit_timeFormat.setText(str(settings.get('custom_time', '$hh:$mm')))
self.configpage.ui.lineEdit_uptimeFormat.setText(str(settings.get('custom_uptime', '$ds,$hs,$ms')))
index = self.configpage.ui.comboBox_tempUnits.findText(str(settings.get('temp_units', "Celsius")))
self.configpage.ui.comboBox_tempUnits.setCurrentIndex(index)
commandOut = commands.getoutput("sensors")
for item in commandOut.split("\n\n"):
for device in item.split("\n"):

View File

@ -35,6 +35,17 @@ import tooltip
from util import *
def getTemp(temp, unit):
"""function to return temperature"""
if (unit == "Celsius"):
pass
elif (unit == "Fahrenheit"):
temp = str(round(((float(temp) * 9.0 / 5.0) + 32.0), 1))
elif (unit == "Kelvin"):
temp = str(round((float(temp) + 273.15), 1))
return temp
class CustomPlasmaLabel(Plasma.Label):
"""new Label with defined clicked() event"""
@ -374,7 +385,7 @@ class pyTextWidget(plasmascript.Applet):
for i in devices:
if (line.split('$hddtemp' + str(i))[0] != line):
line = line.split('$hddtemp' + str(i))[0] +\
str(self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]]) +\
getTemp(str(self.ptm['values']['hddtemp'][self.ptm['names']['hddtemp'][i]]), self.ptm['vars']['adv']['tempUnit']) +\
line.split('$hddtemp' + str(i))[1]
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
self.setText("hddtemp", text)
@ -443,7 +454,7 @@ class pyTextWidget(plasmascript.Applet):
for i in devices:
if (line.split('$temp' + str(i))[0] != line):
line = line.split('$temp' + str(i))[0] +\
str(self.ptm['values']['temp'][self.ptm['names']['temp'][i]]) +\
getTemp(str(self.ptm['values']['temp'][self.ptm['names']['temp'][i]]), self.ptm['vars']['adv']['tempUnits']) +\
line.split('$temp' + str(i))[1]
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
self.setText("temp", text)
@ -540,7 +551,7 @@ class pyTextWidget(plasmascript.Applet):
line = line.split('$gpu')[0] + text + line.split('$gpu')[1]
elif (name == "gputemp"):
if (line.split('$gputemp')[0] != line):
line = line.split('$gputemp')[0] + text + line.split('$gputemp')[1]
line = line.split('$gputemp')[0] + getTemp(text, self.ptm['vars']['adv']['tempUnits']) + line.split('$gputemp')[1]
elif (name == "pkg"):
for item in text.keys():
if (line.split('$' + item)[0] != line):

View File

@ -40,6 +40,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']['tempUnits'] = str(settings.get('temp_units', 'Celsius'))
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'))

View File

@ -1131,9 +1131,9 @@ $ps - list of running processes comma separated</string>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>328</width>
<height>611</height>
<y>-102</y>
<width>526</width>
<height>642</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
@ -1211,6 +1211,61 @@ $m - uptime minutes without zero</string>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="layout_tempUnits">
<item>
<widget class="QLabel" name="label_tempUnits">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Temperature units</string>
</property>
</widget>
</item>
<item>
<spacer name="spacer_tempUnits">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="comboBox_tempUnits">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
<string notr="true">Celsius</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Fahrenheit</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Kelvin</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_tempDevice">
<item>
@ -1578,17 +1633,17 @@ del - remove item</string>
</property>
<item>
<property name="text">
<string>amarok</string>
<string notr="true">amarok</string>
</property>
</item>
<item>
<property name="text">
<string>mpd</string>
<string notr="true">mpd</string>
</property>
</item>
<item>
<property name="text">
<string>qmmp</string>
<string notr="true">qmmp</string>
</property>
</item>
</widget>
@ -1642,8 +1697,8 @@ del - remove item</string>
<rect>
<x>0</x>
<y>0</y>
<width>326</width>
<height>227</height>
<width>544</width>
<height>504</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
@ -1976,8 +2031,8 @@ del - remove item</string>
<rect>
<x>0</x>
<y>0</y>
<width>326</width>
<height>190</height>
<width>544</width>
<height>540</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
@ -2373,17 +2428,17 @@ del - remove item</string>
</property>
<item>
<property name="text">
<string>auto</string>
<string notr="true">auto</string>
</property>
</item>
<item>
<property name="text">
<string>nvidia</string>
<string notr="true">nvidia</string>
</property>
</item>
<item>
<property name="text">
<string>ati</string>
<string notr="true">ati</string>
</property>
</item>
</widget>
@ -2704,6 +2759,7 @@ del - remove item</string>
<tabstop>scrollArea_advanced</tabstop>
<tabstop>lineEdit_timeFormat</tabstop>
<tabstop>lineEdit_uptimeFormat</tabstop>
<tabstop>comboBox_tempUnits</tabstop>
<tabstop>comboBox_tempDevice</tabstop>
<tabstop>pushButton_tempDevice</tabstop>
<tabstop>listWidget_tempDevice</tabstop>
@ -2742,6 +2798,10 @@ del - remove item</string>
<tabstop>comboBox_hdddev</tabstop>
<tabstop>lineEdit_mpdaddress</tabstop>
<tabstop>spinBox_mpdport</tabstop>
<tabstop>comboBox_pkgCommand</tabstop>
<tabstop>spinBox_pkgCommandNum</tabstop>
<tabstop>pushButton_pkgCommand</tabstop>
<tabstop>listWidget_pkgCommand</tabstop>
</tabstops>
<resources/>
<connections/>