mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
fix icons
This commit is contained in:
parent
632adfa54c
commit
e868b03454
@ -1,4 +1,4 @@
|
||||
Ver.1.9.1:
|
||||
Ver.1.10.0:
|
||||
+ added tags $memtotmb, $memtotgb, $swaptotmb, $swaptotgb
|
||||
+ added ability for force update text
|
||||
+ added support of clementine
|
||||
@ -7,6 +7,7 @@ Ver.1.9.1:
|
||||
+ added error checking of DataEngine variables
|
||||
+ added Brazillian Portuguese translation (@underr)
|
||||
+ added Ukrainian translation (Виктор Слободян)
|
||||
* refactoring of configuration interface
|
||||
* player settings was moved from plasmoid to dataengine
|
||||
* edited readme call
|
||||
* changed readme from md to html
|
||||
|
@ -1,4 +1,4 @@
|
||||
Вер.1.9.1:
|
||||
Вер.1.10.0:
|
||||
+ добавлены теги $memtotmb, $memtotgb, $swaptotmb, $swaptotgb
|
||||
+ добавлена возможность форсированного обновления
|
||||
+ добавлена поддержка clementine
|
||||
@ -7,6 +7,7 @@
|
||||
+ добавлена проверка ошибок для переменных DataEngine
|
||||
+ добавлен перевод Brazillian Portuguese (@underr)
|
||||
+ добавлена украинская локализация (Виктор Слободян)
|
||||
* рефакторинг конфигурационного интерфейса
|
||||
* настройки плеера были перенесены из виджета в dataengine
|
||||
* исправлен вызов readme под четырехсимвольное обозначение
|
||||
* перенос readme с md на html
|
||||
|
@ -1,11 +0,0 @@
|
||||
# set project name
|
||||
set (SUBPROJECT icons)
|
||||
message (STATUS "Subproject ${SUBPROJECT}")
|
||||
|
||||
# main icon
|
||||
install (FILES ptm.png DESTINATION share/pixmaps RENAME ptm.png)
|
||||
# configuration interface
|
||||
install (FILES ptm-64x64.png DESTINATION share/icons/hicolor/64x64/apps RENAME ptm.png)
|
||||
install (FILES ptm-advanced-64x64.png DESTINATION share/icons/hicolor/64x64/apps RENAME ptm-advanced.png)
|
||||
install (FILES ptm-appearance-64x64.png DESTINATION share/icons/hicolor/64x64/apps RENAME ptm-appearance.png)
|
||||
install (FILES ptm-tooltip-64x64.png DESTINATION share/icons/hicolor/64x64/apps RENAME ptm-tooltip.png)
|
@ -253,14 +253,14 @@ class ConfigDefinition:
|
||||
# add config page
|
||||
page = {}
|
||||
page['widget'] = parent.addPage(self.configpage['widget'], i18n("Widget"))
|
||||
page['widget'].setIcon(KIcon("ptm"))
|
||||
page['widget'].setIcon(KIcon("utilities-system-monitor"))
|
||||
page['advanced'] = parent.addPage(self.configpage['advanced'], i18n("Advanced"))
|
||||
page['advanced'].setIcon(KIcon("ptm-advanced"))
|
||||
page['advanced'].setIcon(KIcon("system-run"))
|
||||
page['tooltip'] = parent.addPage(self.configpage['tooltip'], i18n("Tooltip"))
|
||||
page['tooltip'].setIcon(KIcon("ptm-tooltip"))
|
||||
page['tooltip'].setIcon(KIcon("preferences-desktop-color"))
|
||||
page['appearance'] = parent.addPage(self.configpage['appearance'], i18n("Appearance"))
|
||||
page['appearance'].setIcon(KIcon("ptm-appearance"))
|
||||
page['appearance'].setIcon(KIcon("preferences-desktop-theme"))
|
||||
page['dataengine'] = parent.addPage(self.configpage['dataengine'], i18n("DataEngine"))
|
||||
page['dataengine'].setIcon(KIcon("ptm"))
|
||||
page['dataengine'].setIcon(KIcon("utilities-system-monitor"))
|
||||
|
||||
parent.okClicked.connect(self.configAccepted)
|
||||
|
@ -1,217 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
# This file is part of pytextmonitor #
|
||||
# #
|
||||
# pytextmonitor is free software: you can redistribute it and/or #
|
||||
# modify it under the terms of the GNU General Public License as #
|
||||
# published by the Free Software Foundation, either version 3 of the #
|
||||
# License, or (at your option) any later version. #
|
||||
# #
|
||||
# pytextmonitor is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with pytextmonitor. If not, see http://www.gnu.org/licenses/ #
|
||||
############################################################################
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyKDE4.plasma import *
|
||||
from PyQt4 import uic
|
||||
|
||||
|
||||
|
||||
class ConfigWindow(QWidget):
|
||||
def __init__(self, parent):
|
||||
"""settings window definition"""
|
||||
QWidget.__init__(self)
|
||||
self.ui = uic.loadUi(parent.package().filePath('ui', 'configwindow.ui'), self)
|
||||
self.parent = parent
|
||||
self.kcolorcombos = {'cpu':self.ui.kcolorcombo_cpu,
|
||||
'cpuclock':self.ui.kcolorcombo_cpuclock, 'down':self.ui.kcolorcombo_down,
|
||||
'mem':self.ui.kcolorcombo_mem, 'swap':self.ui.kcolorcombo_swap,
|
||||
'up':self.ui.kcolorcombo_up}
|
||||
self.checkboxes = {'bat':self.ui.checkBox_bat, 'cpu':self.ui.checkBox_cpu,
|
||||
'cpuclock':self.ui.checkBox_cpuclock, 'custom':self.ui.checkBox_custom,
|
||||
'disk':self.ui.checkBox_hddSpeed, 'gpu':self.ui.checkBox_gpu,
|
||||
'gputemp':self.ui.checkBox_gpuTemp, 'hdd':self.ui.checkBox_hdd,
|
||||
'hddtemp':self.ui.checkBox_hddTemp, 'mem':self.ui.checkBox_mem,
|
||||
'net':self.ui.checkBox_net, 'swap':self.ui.checkBox_swap,
|
||||
'temp':self.ui.checkBox_temp, 'uptime':self.ui.checkBox_uptime,
|
||||
'pkg':self.ui.checkBox_pkg, 'player':self.ui.checkBox_player,
|
||||
'ps':self.ui.checkBox_ps, 'time':self.ui.checkBox_time}
|
||||
self.lineedits = {'bat':self.ui.lineEdit_bat, 'cpu':self.ui.lineEdit_cpu,
|
||||
'cpuclock':self.ui.lineEdit_cpuclock, 'custom':self.ui.lineEdit_custom,
|
||||
'disk':self.ui.lineEdit_hddSpeed, 'gpu':self.ui.lineEdit_gpu,
|
||||
'gputemp':self.ui.lineEdit_gpuTemp, 'hdd':self.ui.lineEdit_hdd,
|
||||
'hddtemp':self.ui.lineEdit_hddTemp, 'mem':self.ui.lineEdit_mem,
|
||||
'net':self.ui.lineEdit_net, 'swap':self.ui.lineEdit_swap,
|
||||
'temp':self.ui.lineEdit_temp, 'uptime':self.ui.lineEdit_uptime,
|
||||
'pkg':self.ui.lineEdit_pkg, 'player':self.ui.lineEdit_player,
|
||||
'ps':self.ui.lineEdit_ps, 'time':self.ui.lineEdit_time}
|
||||
self.sliders = {'bat':self.ui.slider_bat, 'cpu':self.ui.slider_cpu,
|
||||
'cpuclock':self.ui.slider_cpuclock, 'custom':self.ui.slider_custom,
|
||||
'disk':self.ui.slider_hddSpeed, 'gpu':self.ui.slider_gpu,
|
||||
'gputemp':self.ui.slider_gpuTemp, 'hdd':self.ui.slider_hdd,
|
||||
'hddtemp':self.ui.slider_hddTemp, 'mem':self.ui.slider_mem,
|
||||
'net':self.ui.slider_net, 'swap':self.ui.slider_swap,
|
||||
'temp':self.ui.slider_temp, 'uptime':self.ui.slider_uptime,
|
||||
'pkg':self.ui.slider_pkg, 'player':self.ui.slider_player,
|
||||
'ps':self.ui.slider_ps, 'time':self.ui.slider_time}
|
||||
|
||||
QObject.connect(self.ui.checkBox_netdev, SIGNAL("stateChanged(int)"), self.setNetdevEnabled)
|
||||
QObject.connect(self.ui.pushButton_hddDevice, SIGNAL("clicked()"), self.addHddDevice)
|
||||
QObject.connect(self.ui.pushButton_hddSpeedDevice, SIGNAL("clicked()"), self.addHddSpeedDevice)
|
||||
QObject.connect(self.ui.pushButton_mount, SIGNAL("clicked()"), self.addMount)
|
||||
QObject.connect(self.ui.pushButton_tempDevice, SIGNAL("clicked()"), self.addTempDevice)
|
||||
QObject.connect(self.ui.pushButton_customCommand, SIGNAL("clicked()"), self.addCustomCommand)
|
||||
QObject.connect(self.ui.pushButton_pkgCommand, SIGNAL("clicked()"), self.addPkgCommand)
|
||||
QObject.connect(self.ui.listWidget_hddDevice, SIGNAL("itemActivated(QListWidgetItem*)"), self.ui.listWidget_hddDevice.openPersistentEditor)
|
||||
QObject.connect(self.ui.listWidget_mount, SIGNAL("itemActivated(QListWidgetItem*)"), self.ui.listWidget_mount.openPersistentEditor)
|
||||
QObject.connect(self.ui.listWidget_tempDevice, SIGNAL("itemActivated(QListWidgetItem*)"), self.ui.listWidget_tempDevice.openPersistentEditor)
|
||||
QObject.connect(self.ui.listWidget_pkgCommand, SIGNAL("itemActivated(QListWidgetItem*)"), self.ui.listWidget_pkgCommand.openPersistentEditor)
|
||||
QObject.connect(self.ui.comboBox_pkgCommand, SIGNAL("currentIndexChanged(int)"), self.updatePkgNullValue)
|
||||
QObject.connect(self.ui.comboBox_pkgCommand, SIGNAL("editTextChanged(QString)"), self.updatePkgNullValue)
|
||||
for item in self.sliders.values():
|
||||
QObject.connect(item, SIGNAL("valueChanged(int)"), self.setSlider)
|
||||
for item in self.checkboxes.values():
|
||||
QObject.connect(item, SIGNAL("stateChanged(int)"), self.setStatus)
|
||||
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
"""delete events"""
|
||||
if (event.key() == Qt.Key_Delete):
|
||||
if (self.ui.listWidget_hddDevice.hasFocus() and
|
||||
(self.ui.listWidget_hddDevice.currentRow() > -1)):
|
||||
self.ui.listWidget_hddDevice.takeItem(self.ui.listWidget_hddDevice.currentRow())
|
||||
elif (self.ui.listWidget_hddSpeedDevice.hasFocus() and
|
||||
(self.ui.listWidget_hddSpeedDevice.currentRow() > -1)):
|
||||
self.ui.listWidget_hddSpeedDevice.takeItem(self.ui.listWidget_hddSpeedDevice.currentRow())
|
||||
elif (self.ui.listWidget_mount.hasFocus() and
|
||||
(self.ui.listWidget_mount.currentRow() > -1)):
|
||||
self.ui.listWidget_mount.takeItem(self.ui.listWidget_mount.currentRow())
|
||||
elif (self.ui.listWidget_tempDevice.hasFocus() and
|
||||
(self.ui.listWidget_tempDevice.currentRow() > -1)):
|
||||
self.ui.listWidget_tempDevice.takeItem(self.ui.listWidget_tempDevice.currentRow())
|
||||
elif (self.ui.listWidget_customCommand.hasFocus() and
|
||||
(self.ui.listWidget_customCommand.currentRow() > -1)):
|
||||
self.ui.listWidget_customCommand.takeItem(self.ui.listWidget_customCommand.currentRow())
|
||||
elif (self.ui.listWidget_pkgCommand.hasFocus() and
|
||||
(self.ui.listWidget_pkgCommand.currentRow() > -1)):
|
||||
self.ui.listWidget_pkgCommand.takeItem(self.ui.listWidget_pkgCommand.currentRow())
|
||||
|
||||
|
||||
def addHddDevice(self):
|
||||
"""function to add mount points"""
|
||||
self.ui.listWidget_hddDevice.clearSelection()
|
||||
self.ui.listWidget_hddDevice.addItem(self.ui.comboBox_hddDevice.currentText())
|
||||
|
||||
|
||||
def addHddSpeedDevice(self):
|
||||
"""function to add disk device"""
|
||||
self.ui.listWidget_hddSpeedDevice.clearSelection()
|
||||
self.ui.listWidget_hddSpeedDevice.addItem(self.ui.comboBox_hddSpeedDevice.currentText())
|
||||
|
||||
|
||||
def addMount(self):
|
||||
"""function to add mount points"""
|
||||
self.ui.listWidget_mount.clearSelection()
|
||||
self.ui.listWidget_mount.addItem(self.ui.comboBox_mount.currentText())
|
||||
|
||||
|
||||
def addTempDevice(self):
|
||||
"""function to add temperature device"""
|
||||
self.ui.listWidget_tempDevice.clearSelection()
|
||||
self.ui.listWidget_tempDevice.addItem(self.ui.comboBox_tempDevice.currentText())
|
||||
|
||||
|
||||
def addCustomCommand(self):
|
||||
"""function to add custom command"""
|
||||
self.ui.listWidget_customCommand.clearSelection()
|
||||
self.ui.listWidget_customCommand.addItem(self.ui.lineEdit_customCommand.text())
|
||||
|
||||
|
||||
def addPkgCommand(self):
|
||||
"""function to add package manager command"""
|
||||
self.ui.listWidget_pkgCommand.clearSelection()
|
||||
self.ui.listWidget_pkgCommand.addItem(self.ui.comboBox_pkgCommand.currentText() +\
|
||||
QString(":") + QString.number(self.ui.spinBox_pkgCommandNum.value()))
|
||||
|
||||
|
||||
def updatePkgNullValue(self):
|
||||
"""function to set default values to PKGNULL spinbox"""
|
||||
if (self.ui.comboBox_pkgCommand.currentText().contains(QString("pacman -Qu"))):
|
||||
self.ui.spinBox_pkgCommandNum.setValue(0)
|
||||
elif (self.ui.comboBox_pkgCommand.currentText().contains(QString("apt-show-versions -u -b"))):
|
||||
self.ui.spinBox_pkgCommandNum.setValue(0)
|
||||
elif (self.ui.comboBox_pkgCommand.currentText().contains(QString("aptitude search '~U'"))):
|
||||
self.ui.spinBox_pkgCommandNum.setValue(0)
|
||||
elif (self.ui.comboBox_pkgCommand.currentText().contains(QString("yum list updates"))):
|
||||
self.ui.spinBox_pkgCommandNum.setValue(3)
|
||||
elif (self.ui.comboBox_pkgCommand.currentText().contains(QString("pkg_version -I -l '<'"))):
|
||||
self.ui.spinBox_pkgCommandNum.setValue(0)
|
||||
elif (self.ui.comboBox_pkgCommand.currentText().contains(QString("urpmq --auto-select"))):
|
||||
self.ui.spinBox_pkgCommandNum.setValue(0)
|
||||
|
||||
|
||||
def setNetdevEnabled(self):
|
||||
"""function to set enabled netdev"""
|
||||
if (self.ui.checkBox_netdev.checkState() == 0):
|
||||
self.ui.comboBox_netdev.setDisabled(True)
|
||||
else:
|
||||
self.ui.comboBox_netdev.setEnabled(True)
|
||||
|
||||
|
||||
def setSlider(self):
|
||||
"""function to set sliders"""
|
||||
if (self.sender().isEnabled() == True):
|
||||
second_slider = self.sender()
|
||||
order = []
|
||||
for slider in self.sliders.values():
|
||||
if (slider.isEnabled() == True):
|
||||
order.append(slider.value())
|
||||
if ((slider.value() == self.sender().value()) and (slider != self.sender())):
|
||||
second_slider = slider
|
||||
if (second_slider == self.sender()):
|
||||
return
|
||||
for value in range(len(order)):
|
||||
if (order.count(value+1) == 0):
|
||||
new_value = value + 1
|
||||
second_slider.setValue(new_value)
|
||||
|
||||
|
||||
def setStatus(self):
|
||||
"""function to enable label"""
|
||||
for label in self.checkboxes.keys():
|
||||
if ((self.checkboxes[label].checkState() > 0) and (self.sliders[label].isEnabled() == False)):
|
||||
self.lineedits[label].setEnabled(True)
|
||||
self.sliders[label].setEnabled(True)
|
||||
slider_label = 0
|
||||
for slider in self.sliders.values():
|
||||
if (slider.isEnabled() == True):
|
||||
slider_label += 1
|
||||
for slider in self.sliders.values():
|
||||
if (slider_label > 1):
|
||||
slider.setMaximum(slider.maximum()+1)
|
||||
elif (slider_label == 1):
|
||||
slider.setMaximum(1)
|
||||
self.sliders[label].setValue(self.sliders[label].maximum())
|
||||
elif ((self.checkboxes[label].checkState() == 0) and (self.sliders[label].isEnabled() == True)):
|
||||
self.lineedits[label].setDisabled(True)
|
||||
self.sliders[label].setDisabled(True)
|
||||
for slider in self.sliders.values():
|
||||
if ((slider.value() == slider.maximum()) and (slider != self.sliders[label])):
|
||||
slider.setValue(self.sliders[label].value())
|
||||
slider_label = 0
|
||||
for slider in self.sliders.values():
|
||||
if (slider.isEnabled() == True):
|
||||
slider_label += 1
|
||||
for slider in self.sliders.values():
|
||||
if (slider_label > 0):
|
||||
slider.setMaximum(slider.maximum()-1)
|
||||
else:
|
||||
slider.setMaximum(1)
|
||||
self.sliders[label].setValue(1)
|
Loading…
Reference in New Issue
Block a user