Use Icon to show we have Notes

This commit is contained in:
Tim Bentley 2010-03-07 20:45:27 +00:00
parent 5560aac575
commit 6f87c362d1
4 changed files with 15 additions and 5 deletions

View File

@ -430,12 +430,21 @@ class ServiceManager(QtGui.QWidget):
serviceitem = item[u'service_item']
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
if len(serviceitem.notes) > 0:
title = u'%s - %s' % (self.trUtf8('(N)'), serviceitem.title)
icon = QtGui.QImage(serviceitem.icon)
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation)
overlay = QtGui.QImage(':/services/service_item_notes.png')
overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation)
painter = QtGui.QPainter(icon)
painter.drawImage(0, 0, overlay)
painter.end()
treewidgetitem.setIcon(0, build_icon(icon))
else:
title = serviceitem.title
treewidgetitem.setText(0, title)
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
treewidgetitem.setText(0, serviceitem.title)
treewidgetitem.setToolTip(0, serviceitem.notes)
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
treewidgetitem.setData(0, QtCore.Qt.UserRole,
QtCore.QVariant(item[u'order']))
treewidgetitem.setExpanded(item[u'expanded'])

View File

@ -61,7 +61,7 @@ class ImageMediaItem(MediaManagerItem):
def retranslateUi(self):
self.OnNewPrompt = self.trUtf8('Select Image(s)')
self.OnNewFileMasks = \
self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp)')
self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp);; All files (*)')
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)

View File

@ -78,6 +78,7 @@
<qresource prefix="services">
<file>service_edit.png</file>
<file>service_notes.png</file>
<file>service_item_notes.png</file>
<file>service_bottom.png</file>
<file>service_down.png</file>
<file>service_top.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B