Add indication if service item has notes

Add display of notes as Tooltip

bzr-revno: 725
This commit is contained in:
Tim Bentley 2010-03-06 16:31:04 +00:00
commit 46a5f70335
2 changed files with 10 additions and 5 deletions

View File

@ -42,7 +42,6 @@ class ServiceManagerList(QtGui.QTreeWidget):
def __init__(self, parent=None, name=None): def __init__(self, parent=None, name=None):
QtGui.QTreeWidget.__init__(self,parent) QtGui.QTreeWidget.__init__(self,parent)
self.parent = parent self.parent = parent
self.setExpandsOnDoubleClick(False)
def keyPressEvent(self, event): def keyPressEvent(self, event):
if type(event) == QtGui.QKeyEvent: if type(event) == QtGui.QKeyEvent:
@ -250,6 +249,7 @@ class ServiceManager(QtGui.QWidget):
if self.serviceItemNoteForm.exec_(): if self.serviceItemNoteForm.exec_():
self.serviceItems[item][u'service_item'].notes = \ self.serviceItems[item][u'service_item'].notes = \
self.serviceItemNoteForm.textEdit.toPlainText() self.serviceItemNoteForm.textEdit.toPlainText()
self.repaintServiceList(item, 0)
def nextItem(self): def nextItem(self):
""" """
@ -429,7 +429,12 @@ class ServiceManager(QtGui.QWidget):
for itemcount, item in enumerate(self.serviceItems): for itemcount, item in enumerate(self.serviceItems):
serviceitem = item[u'service_item'] serviceitem = item[u'service_item']
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
treewidgetitem.setText(0,serviceitem.title) if len(serviceitem.notes) > 0:
title = u'%s - %s' % (self.trUtf8('(N)'), serviceitem.title)
else:
title = serviceitem.title
treewidgetitem.setText(0, title)
treewidgetitem.setToolTip(0, serviceitem.notes)
treewidgetitem.setIcon(0, serviceitem.iconic_representation) treewidgetitem.setIcon(0, serviceitem.iconic_representation)
treewidgetitem.setData(0, QtCore.Qt.UserRole, treewidgetitem.setData(0, QtCore.Qt.UserRole,
QtCore.QVariant(item[u'order'])) QtCore.QVariant(item[u'order']))

View File

@ -1 +1 @@
1.9.0-723 1.9.0-725