Don't select the child item if not selected

This commit is contained in:
Andreas Preikschat 2011-01-20 17:43:29 +01:00
parent ff2ac445f0
commit 7e57fa2f95
2 changed files with 7 additions and 4 deletions

View File

@ -844,13 +844,13 @@ class ServiceManager(QtGui.QWidget):
treewidgetitem1.setText(0, text[:40])
treewidgetitem1.setData(0, QtCore.Qt.UserRole,
QtCore.QVariant(count))
if serviceItem == itemcount and serviceItemCount == count:
if serviceItem == itemcount:
# Preserve expanding status as setCurrentItem sets it to
# True.
temp = item[u'expanded']
if item[u'expanded']:
if item[u'expanded'] and serviceItemCount == count:
self.serviceManagerList.setCurrentItem(treewidgetitem1)
else:
elif serviceItemCount == -1:
self.serviceManagerList.setCurrentItem(treewidgetitem)
item[u'expanded'] = temp
treewidgetitem.setExpanded(item[u'expanded'])
@ -1060,7 +1060,7 @@ class ServiceManager(QtGui.QWidget):
"""
items = self.serviceManagerList.selectedItems()
pos = 0
count = 0
count = -1
for item in items:
parentitem = item.parent()
if parentitem is None:

View File

@ -525,6 +525,9 @@ class SlideController(QtGui.QWidget):
Called by ServiceManager
"""
log.debug(u'addServiceManagerItem live = %s' % self.isLive)
# If no valid slide number is specified we take the first one.
if slideno == -1:
slideno = 0
# If service item is the same as the current on only change slide
if item.__eq__(self.serviceItem):
if slideno + 1 < self.PreviewListWidget.rowCount():