forked from openlp/openlp
do not override list
This commit is contained in:
parent
3359726be2
commit
5a7aa2fb9f
@ -135,15 +135,15 @@ class CustomMediaItem(MediaManagerItem):
|
||||
self.onPreviewClick()
|
||||
self.onRemoteEditClear()
|
||||
|
||||
def loadList(self, list):
|
||||
def loadList(self, custom_slides):
|
||||
self.listView.clear()
|
||||
# Sort the customs by its title considering language specific
|
||||
# characters.
|
||||
list.sort(cmp=locale.strcoll, key=operator.attrgetter('title'))
|
||||
for customSlide in list:
|
||||
custom_name = QtGui.QListWidgetItem(customSlide.title)
|
||||
custom_slides.sort(cmp=locale.strcoll, key=operator.attrgetter('title'))
|
||||
for custom_slide in custom_slides:
|
||||
custom_name = QtGui.QListWidgetItem(custom_slide.title)
|
||||
custom_name.setData(
|
||||
QtCore.Qt.UserRole, QtCore.QVariant(customSlide.id))
|
||||
QtCore.Qt.UserRole, QtCore.QVariant(custom_slide.id))
|
||||
self.listView.addItem(custom_name)
|
||||
|
||||
def onNewClick(self):
|
||||
|
@ -149,20 +149,18 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
else:
|
||||
self.presentationWidget.hide()
|
||||
|
||||
def loadList(self, list, initialLoad=False):
|
||||
def loadList(self, files, initialLoad=False):
|
||||
"""
|
||||
Add presentations into the media manager
|
||||
This is called both on initial load of the plugin to populate with
|
||||
existing files, and when the user adds new files via the media manager
|
||||
"""
|
||||
currlist = self.getFileList()
|
||||
titles = []
|
||||
for file in currlist:
|
||||
titles.append(os.path.split(file)[1])
|
||||
titles = [os.path.split(file)[1] for file in currlist]
|
||||
Receiver.send_message(u'cursor_busy')
|
||||
if not initialLoad:
|
||||
self.parent.formparent.displayProgressBar(len(list))
|
||||
for file in list:
|
||||
self.parent.formparent.displayProgressBar(len(files))
|
||||
for file in files:
|
||||
if not initialLoad:
|
||||
self.parent.formparent.incrementProgressBar()
|
||||
if currlist.count(file) > 0:
|
||||
|
Loading…
Reference in New Issue
Block a user