forked from openlp/openlp
Fix Custom edit bug
bzr-revno: 1147 Fixes: https://launchpad.net/bugs/690335
This commit is contained in:
commit
b7c6ace677
@ -224,27 +224,24 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
|||||||
``edit_all``
|
``edit_all``
|
||||||
Indicates if all slides or only one slide has been edited.
|
Indicates if all slides or only one slide has been edited.
|
||||||
"""
|
"""
|
||||||
if len(slides) == 1:
|
if edit_all:
|
||||||
self.slideListView.currentItem().setText(slides[0])
|
self.slideListView.clear()
|
||||||
|
for slide in slides:
|
||||||
|
self.slideListView.addItem(slide)
|
||||||
else:
|
else:
|
||||||
if edit_all:
|
old_slides = []
|
||||||
self.slideListView.clear()
|
old_row = self.slideListView.currentRow()
|
||||||
for slide in slides:
|
# Create a list with all (old/unedited) slides.
|
||||||
self.slideListView.addItem(slide)
|
old_slides = [self.slideListView.item(row).text() for row in \
|
||||||
else:
|
range(0, self.slideListView.count())]
|
||||||
old_slides = []
|
self.slideListView.clear()
|
||||||
old_row = self.slideListView.currentRow()
|
old_slides.pop(old_row)
|
||||||
# Create a list with all (old/unedited) slides.
|
# Insert all slides to make the old_slides list complete.
|
||||||
old_slides = [self.slideListView.item(row).text() for row in \
|
for slide in slides:
|
||||||
range(0, self.slideListView.count())]
|
old_slides.insert(old_row, slide)
|
||||||
self.slideListView.clear()
|
for slide in old_slides:
|
||||||
old_slides.pop(old_row)
|
self.slideListView.addItem(slide)
|
||||||
# Insert all slides to make the old_slides list complete.
|
self.slideListView.repaint()
|
||||||
for slide in slides:
|
|
||||||
old_slides.insert(old_row, slide)
|
|
||||||
for slide in old_slides:
|
|
||||||
self.slideListView.addItem(slide)
|
|
||||||
self.slideListView.repaint()
|
|
||||||
|
|
||||||
def onDeleteButtonPressed(self):
|
def onDeleteButtonPressed(self):
|
||||||
self.slideListView.takeItem(self.slideListView.currentRow())
|
self.slideListView.takeItem(self.slideListView.currentRow())
|
||||||
|
Loading…
Reference in New Issue
Block a user