More busy and sort changes

bzr-revno: 1574
This commit is contained in:
Tim Bentley 2011-05-26 16:44:25 +01:00
commit fe4b5fb147
4 changed files with 19 additions and 0 deletions

View File

@ -1109,6 +1109,7 @@ class ServiceManager(QtGui.QWidget):
"""
Send the current item to the Preview slide controller
"""
Receiver.send_message(u'cursor_busy')
item, child = self.findServiceItem()
if self.serviceItems[item][u'service_item'].is_valid:
self.mainwindow.previewController.addServiceManagerItem(
@ -1118,6 +1119,7 @@ class ServiceManager(QtGui.QWidget):
translate('OpenLP.ServiceManager', 'Missing Display Handler'),
translate('OpenLP.ServiceManager', 'Your item cannot be '
'displayed as there is no handler to display it'))
Receiver.send_message(u'cursor_normal')
def getServiceItem(self):
"""
@ -1150,6 +1152,7 @@ class ServiceManager(QtGui.QWidget):
return
if row != -1:
child = row
Receiver.send_message(u'cursor_busy')
if self.serviceItems[item][u'service_item'].is_valid:
self.mainwindow.liveController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], child)
@ -1169,6 +1172,7 @@ class ServiceManager(QtGui.QWidget):
translate('OpenLP.ServiceManager', 'Your item cannot be '
'displayed as the plugin required to display it is missing '
'or inactive'))
Receiver.send_message(u'cursor_normal')
def remoteEdit(self):
"""

View File

@ -27,6 +27,7 @@
import logging
import os
import locale
from PyQt4 import QtCore, QtGui
@ -112,6 +113,10 @@ class ImageMediaItem(MediaManagerItem):
def loadList(self, list, initialLoad=False):
if not initialLoad:
self.parent.formparent.displayProgressBar(len(list))
# Sort the themes by its filename considering language specific
# characters. lower() is needed for windows!
list.sort(cmp=locale.strcoll,
key=lambda filename: os.path.split(unicode(filename))[1].lower())
for imageFile in list:
if not initialLoad:
self.parent.formparent.incrementProgressBar()

View File

@ -28,6 +28,7 @@
from datetime import datetime
import logging
import os
import locale
from PyQt4 import QtCore, QtGui
@ -202,6 +203,10 @@ class MediaMediaItem(MediaManagerItem):
self.settingsSection, self.getFileList())
def loadList(self, list):
# Sort the themes by its filename considering language specific
# characters. lower() is needed for windows!
list.sort(cmp=locale.strcoll,
key=lambda filename: os.path.split(unicode(filename))[1].lower())
for file in list:
filename = os.path.split(unicode(file))[1]
item_name = QtGui.QListWidgetItem(filename)

View File

@ -27,6 +27,7 @@
import logging
import os
import locale
from PyQt4 import QtCore, QtGui
@ -161,6 +162,10 @@ class PresentationMediaItem(MediaManagerItem):
Receiver.send_message(u'cursor_busy')
if not initialLoad:
self.parent.formparent.displayProgressBar(len(files))
# Sort the themes by its filename considering language specific
# characters. lower() is needed for windows!
files.sort(cmp=locale.strcoll,
key=lambda filename: os.path.split(unicode(filename))[1].lower())
for file in files:
if not initialLoad:
self.parent.formparent.incrementProgressBar()