openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #15253
[Merge] lp:~phill-ridout/openlp/progress_bar into lp:openlp
phill has proposed merging lp:~phill-ridout/openlp/progress_bar into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/progress_bar/+merge/101983
Implements the progress bar for all media items for which it is possible. This shows OpenLP is doing 'something' rather than just hung.
--
https://code.launchpad.net/~phill-ridout/openlp/progress_bar/+merge/101983
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/progress_bar into lp:openlp.
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2012-03-16 22:56:06 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2012-04-13 21:52:39 +0000
@@ -105,26 +105,30 @@
'You must select an image to delete.')):
row_list = [item.row() for item in self.listView.selectedIndexes()]
row_list.sort(reverse=True)
+ Receiver.send_message(u'cursor_busy')
+ self.plugin.formparent.displayProgressBar(len(row_list))
for row in row_list:
text = self.listView.item(row)
if text:
delete_file(os.path.join(self.servicePath,
unicode(text.text())))
self.listView.takeItem(row)
+ self.plugin.formparent.incrementProgressBar()
SettingsManager.set_list(self.settingsSection,
u'images', self.getFileList())
+ self.plugin.formparent.finishedProgressBar()
+ Receiver.send_message(u'cursor_normal')
self.listView.blockSignals(False)
def loadList(self, images, initialLoad=False):
if not initialLoad:
+ Receiver.send_message(u'cursor_busy')
self.plugin.formparent.displayProgressBar(len(images))
# Sort the themes by its filename considering language specific
# characters. lower() is needed for windows!
images.sort(cmp=locale.strcoll,
key=lambda filename: os.path.split(unicode(filename))[1].lower())
for imageFile in images:
- if not initialLoad:
- self.plugin.formparent.incrementProgressBar()
filename = os.path.split(unicode(imageFile))[1]
thumb = os.path.join(self.servicePath, filename)
if not os.path.exists(unicode(imageFile)):
@@ -139,8 +143,11 @@
item_name.setToolTip(imageFile)
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(imageFile))
self.listView.addItem(item_name)
+ if not initialLoad:
+ self.plugin.formparent.incrementProgressBar()
if not initialLoad:
self.plugin.formparent.finishedProgressBar()
+ Receiver.send_message(u'cursor_normal')
def generateSlideData(self, service_item, item=None, xmlVersion=False,
remote=False):
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2012-04-01 21:19:56 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2012-04-13 21:52:39 +0000
@@ -165,6 +165,7 @@
titles = [os.path.split(file)[1] for file in currlist]
Receiver.send_message(u'cursor_busy')
if not initialLoad:
+ Receiver.send_message(u'cursor_busy')
self.plugin.formparent.displayProgressBar(len(files))
# Sort the themes by its filename considering language specific
# characters. lower() is needed for windows!
@@ -217,6 +218,7 @@
Receiver.send_message(u'cursor_normal')
if not initialLoad:
self.plugin.formparent.finishedProgressBar()
+ Receiver.send_message(u'cursor_normal')
def onDeleteClick(self):
"""
@@ -226,6 +228,8 @@
items = self.listView.selectedIndexes()
row_list = [item.row() for item in items]
row_list.sort(reverse=True)
+ Receiver.send_message(u'cursor_busy')
+ self.plugin.formparent.displayProgressBar(len(row_list))
for item in items:
filepath = unicode(item.data(
QtCore.Qt.UserRole).toString())
@@ -233,6 +237,9 @@
doc = self.controllers[cidx].add_document(filepath)
doc.presentation_deleted()
doc.close_presentation()
+ self.plugin.formparent.incrementProgressBar()
+ self.plugin.formparent.finishedProgressBar()
+ Receiver.send_message(u'cursor_normal')
for row in row_list:
self.listView.takeItem(row)
SettingsManager.set_list(self.settingsSection,
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2012-04-02 00:19:16 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2012-04-13 21:52:39 +0000
@@ -408,6 +408,8 @@
QtGui.QMessageBox.No),
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.No:
return
+ Receiver.send_message(u'cursor_busy')
+ self.plugin.formparent.displayProgressBar(len(items))
for item in items:
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
media_files = self.plugin.manager.get_all_objects(MediaFile,
@@ -426,6 +428,9 @@
except OSError:
log.exception(u'Could not remove directory: %s', save_path)
self.plugin.manager.delete_object(Song, item_id)
+ self.plugin.formparent.incrementProgressBar()
+ self.plugin.formparent.finishedProgressBar()
+ Receiver.send_message(u'cursor_normal')
self.onSearchTextButtonClicked()
def onCloneClick(self):
Follow ups