mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 14:55:48 +00:00
moved player settings from plasmoid to dataengine
try to fix creating a lot of zombies
This commit is contained in:
@ -72,7 +72,6 @@ class ConfigDefinition:
|
||||
settings.set('ac_device', str(self.configpage.ui.lineEdit_acdev.text()))
|
||||
settings.set('ac_online', str(self.configpage.ui.lineEdit_acOnline.text()))
|
||||
settings.set('ac_offline', str(self.configpage.ui.lineEdit_acOffline.text()))
|
||||
settings.set('player_name', str(self.configpage.ui.comboBox_playerSelect.currentText()))
|
||||
|
||||
settings.set('tooltip_num', self.configpage.ui.spinBox_tooltipNum.value())
|
||||
for label in ['cpu', 'cpuclock', 'mem', 'swap', 'down', 'up']:
|
||||
@ -104,6 +103,7 @@ class ConfigDefinition:
|
||||
pkgNull.append("0")
|
||||
deConfigFile.write("PKGCMD=" + ','.join(pkgCmd) + "\n")
|
||||
deConfigFile.write("PKGNULL=" + ','.join(pkgNull) + "\n")
|
||||
deConfigFile.write("PLAYER=" + str(self.configpage.ui.comboBox_playerSelect.currentText()) + "\n")
|
||||
except:
|
||||
pass
|
||||
|
||||
@ -192,8 +192,6 @@ class ConfigDefinition:
|
||||
self.configpage.ui.lineEdit_acdev.setText(str(settings.get('ac_device', '/sys/class/power_supply/AC/online')))
|
||||
self.configpage.ui.lineEdit_acOnline.setText(str(settings.get('ac_online', '(*)')))
|
||||
self.configpage.ui.lineEdit_acOffline.setText(str(settings.get('ac_offline', '( )')))
|
||||
index = self.configpage.ui.comboBox_playerSelect.findText(str(settings.get('player_name', "amarok")))
|
||||
self.configpage.ui.comboBox_playerSelect.setCurrentIndex(index)
|
||||
|
||||
self.configpage.ui.spinBox_tooltipNum.setValue(settings.get('tooltip_num', 100).toInt()[0])
|
||||
self.configpage.ui.kcolorcombo_cpu.setColor(QColor(str(settings.get('cpu_color', '#ff0000'))))
|
||||
@ -205,7 +203,7 @@ class ConfigDefinition:
|
||||
|
||||
deSettings = {'CUSTOM':'wget -qO- http://ifconfig.me/ip', 'GPUDEV':'auto', 'HDDDEV':'all',
|
||||
'HDDTEMPCMD':'sudo hddtemp', 'MPDADDRESS':'localhost', 'MPDPORT':'6600', 'PKGCMD':'pacman -Qu',
|
||||
'PKGNULL':'0'}
|
||||
'PKGNULL':'0', 'PLAYER':'amarok'}
|
||||
dataengineConfig = unicode(KGlobal.dirs().localkdedir()) + "/share/config/extsysmon.conf"
|
||||
try:
|
||||
with open(dataengineConfig, 'r') as deConfigFile:
|
||||
@ -238,6 +236,8 @@ class ConfigDefinition:
|
||||
except:
|
||||
num = "0"
|
||||
self.configpage.ui.listWidget_pkgCommand.addItem(deSettings['PKGCMD'].split(',')[i] + ':' + num)
|
||||
index = self.configpage.ui.comboBox_playerSelect.findText(deSettings['PLAYER'])
|
||||
self.configpage.ui.comboBox_playerSelect.setCurrentIndex(index)
|
||||
|
||||
labelOrder = str(settings.get('label_order', '1345'))
|
||||
for label in self.defaults['order'].keys():
|
||||
|
@ -198,30 +198,11 @@ class DataEngine:
|
||||
elif (sourceName == "player"):
|
||||
updatedData['name'] = "player"
|
||||
updatedData['value'] = {}
|
||||
if (adv['player'] == "amarok"):
|
||||
updatedData['value']['album'] = str(data[QString(u'amarok_album')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['artist'] = str(data[QString(u'amarok_artist')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['progress'] = str(data[QString(u'amarok_progress')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['time'] = str(data[QString(u'amarok_duration')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['title'] = str(data[QString(u'amarok_title')].toUtf8()).decode("utf-8")
|
||||
elif (adv['player'] == "clementine"):
|
||||
updatedData['value']['album'] = str(data[QString(u'clementine_album')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['artist'] = str(data[QString(u'clementine_artist')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['progress'] = str(data[QString(u'clementine_progress')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['time'] = str(data[QString(u'clementine_duration')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['title'] = str(data[QString(u'clementine_title')].toUtf8()).decode("utf-8")
|
||||
elif (adv['player'] == "mpd"):
|
||||
updatedData['value']['album'] = str(data[QString(u'mpd_album')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['artist'] = str(data[QString(u'mpd_artist')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['progress'] = str(data[QString(u'mpd_progress')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['time'] = str(data[QString(u'mpd_duration')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['title'] = str(data[QString(u'mpd_title')].toUtf8()).decode("utf-8")
|
||||
elif (adv['player'] == "qmmp"):
|
||||
updatedData['value']['album'] = str(data[QString(u'qmmp_album')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['artist'] = str(data[QString(u'qmmp_artist')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['progress'] = str(data[QString(u'qmmp_progress')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['time'] = str(data[QString(u'qmmp_duration')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['title'] = str(data[QString(u'qmmp_title')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['album'] = str(data[QString(u'album')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['artist'] = str(data[QString(u'artist')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['progress'] = str(data[QString(u'progress')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['time'] = str(data[QString(u'duration')].toUtf8()).decode("utf-8")
|
||||
updatedData['value']['title'] = str(data[QString(u'title')].toUtf8()).decode("utf-8")
|
||||
elif (sourceName == "ps"):
|
||||
updatedData['name'] = "ps"
|
||||
updatedData['value'] = {}
|
||||
|
@ -47,7 +47,6 @@ class Reinit():
|
||||
ptmVars['adv']['netdevBool'] = settings.get('netdevBool', 0).toInt()[0]
|
||||
ptmVars['adv']['netdev'] = str(settings.get('custom_netdev', 'lo'))
|
||||
ptmVars['adv']['netDir'] = str(settings.get('netdir', '/sys/class/net'))
|
||||
ptmVars['adv']['player'] = str(settings.get('player_name', "amarok"))
|
||||
|
||||
ptmVars['app'] = {}
|
||||
ptmVars['app']['format'] = ["<pre><p align=\"center\"><span style=\" font-family:'" + str(settings.get('font_family', 'Terminus')) +\
|
||||
|
@ -1194,9 +1194,9 @@ $ps - list of running processes comma separated</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>328</width>
|
||||
<height>754</height>
|
||||
<y>-183</y>
|
||||
<width>526</width>
|
||||
<height>723</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
@ -1717,59 +1717,6 @@ del - remove item</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_playerSelect">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_playerSelect">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Music player</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_playerSelect">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">amarok</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">clementine</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">mpd</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">qmmp</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_advanced">
|
||||
<property name="orientation">
|
||||
@ -2485,8 +2432,8 @@ del - remove item</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>326</width>
|
||||
<height>414</height>
|
||||
<width>544</width>
|
||||
<height>540</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
@ -2841,6 +2788,59 @@ del - remove item</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_playerSelect">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_playerSelect">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Music player</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_playerSelect">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">amarok</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">clementine</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">mpd</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">qmmp</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_dataengine">
|
||||
<property name="orientation">
|
||||
@ -2951,7 +2951,6 @@ del - remove item</string>
|
||||
<tabstop>lineEdit_acOnline</tabstop>
|
||||
<tabstop>lineEdit_acOffline</tabstop>
|
||||
<tabstop>lineEdit_acdev</tabstop>
|
||||
<tabstop>comboBox_playerSelect</tabstop>
|
||||
<tabstop>scrollArea_tooltip</tabstop>
|
||||
<tabstop>spinBox_tooltipNum</tabstop>
|
||||
<tabstop>kcolorcombo_cpuclock</tabstop>
|
||||
|
Reference in New Issue
Block a user