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