From e0bfaf07bc57a949ee4bfaae71d527b48b27f937 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 4 May 2010 21:01:45 +0100 Subject: [PATCH 1/7] Cleanup and finish bits --- openlp/core/lib/serviceitem.py | 1 + openlp/core/ui/generaltab.py | 3 +- openlp/core/ui/servicemanager.py | 81 +++++++++++-------- .../presentations/presentationplugin.py | 1 + 4 files changed, 52 insertions(+), 34 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 2f6d973e2..764875f4f 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -81,6 +81,7 @@ class ServiceItem(object): self.notes = u'' self.from_plugin = False self.capabilities = [] + self.isValid = True def add_capability(self, capability): self.capabilities.append(capability) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index ac4f92336..cef241aea 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -44,7 +44,8 @@ class GeneralTab(SettingsTab): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) self.MonitorNumber = settings.value(u'monitor', - QtCore.QVariant(self.screens.monitor_number)).toInt()[0] + QtCore.QVariant(self.screens.display_count - 1)).toInt()[0] + print self.MonitorNumber, self.screens.monitor_number, self.screens.display_count, self.screens.screen_list self.screens.set_current_display(self.MonitorNumber) self.screens.monitor_number = self.MonitorNumber self.DisplayOnMonitor = settings.value( diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 03cdbcecc..e13e72794 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -326,7 +326,7 @@ class ServiceManager(QtGui.QWidget): Called by a signal to select a specific item """ self.setItem(int(message[0])) - + def setItem(self, index): """ Makes a specific item in the service live @@ -495,19 +495,22 @@ class ServiceManager(QtGui.QWidget): for itemcount, item in enumerate(self.serviceItems): serviceitem = item[u'service_item'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) - if serviceitem.notes: - icon = QtGui.QImage(serviceitem.icon) - icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, - QtCore.Qt.SmoothTransformation) - overlay = QtGui.QImage(':/services/service_item_notes.png') - overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, - QtCore.Qt.SmoothTransformation) - painter = QtGui.QPainter(icon) - painter.drawImage(0, 0, overlay) - painter.end() - treewidgetitem.setIcon(0, build_icon(icon)) + if serviceitem.isValid: + if serviceitem.notes: + icon = QtGui.QImage(serviceitem.icon) + icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, + QtCore.Qt.SmoothTransformation) + overlay = QtGui.QImage(':/services/service_item_notes.png') + overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, + QtCore.Qt.SmoothTransformation) + painter = QtGui.QPainter(icon) + painter.drawImage(0, 0, overlay) + painter.end() + treewidgetitem.setIcon(0, build_icon(icon)) + else: + treewidgetitem.setIcon(0, serviceitem.iconic_representation) else: - treewidgetitem.setIcon(0, serviceitem.iconic_representation) + treewidgetitem.setIcon(0, build_icon(u':/general/general_delete.png')) treewidgetitem.setText(0, serviceitem.title) treewidgetitem.setToolTip(0, serviceitem.notes) treewidgetitem.setData(0, QtCore.Qt.UserRole, @@ -651,8 +654,8 @@ class ServiceManager(QtGui.QWidget): serviceitem = ServiceItem() serviceitem.RenderManager = self.parent.RenderManager serviceitem.set_from_service(item, self.servicePath) - if self.validateItem(serviceitem): - self.addServiceItem(serviceitem) + self.validateItem(serviceitem) + self.addServiceItem(serviceitem) try: if os.path.isfile(p_file): os.remove(p_file) @@ -671,12 +674,15 @@ class ServiceManager(QtGui.QWidget): self.parent.serviceChanged(True, self.serviceName) def validateItem(self, serviceItem): -# print "---" -# print serviceItem.name -# print serviceItem.title -# print serviceItem.service_item_path -# print serviceItem.service_item_type - return True + """ + Validates the service item and if the suffix matches an accepted + one it allows the item to be displayed + """ + print serviceItem.title + if serviceItem.is_command(): + type = serviceItem._raw_frames[0][u'title'].split(u'.')[1] + if type not in ['odp']: + serviceItem.isValid = False def cleanUp(self): """ @@ -778,17 +784,26 @@ class ServiceManager(QtGui.QWidget): Send the current item to the Live slide controller """ item, count = self.findServiceItem() - self.parent.LiveController.addServiceManagerItem( - self.serviceItems[item][u'service_item'], count) - if QtCore.QSettings().value( - self.parent.generalSettingsSection + u'/auto preview', - QtCore.QVariant(False)).toBool(): - item += 1 - if self.serviceItems and item < len(self.serviceItems) and \ - self.serviceItems[item][u'service_item'].is_capable( - ItemCapabilities.AllowsPreview): - self.parent.PreviewController.addServiceManagerItem( - self.serviceItems[item][u'service_item'], 0) + if self.serviceItems[item][u'service_item'].isValid: + self.parent.LiveController.addServiceManagerItem( + self.serviceItems[item][u'service_item'], count) + if QtCore.QSettings().value( + self.parent.generalSettingsSection + u'/auto preview', + QtCore.QVariant(False)).toBool(): + item += 1 + if self.serviceItems and item < len(self.serviceItems) and \ + self.serviceItems[item][u'service_item'].is_capable( + ItemCapabilities.AllowsPreview): + self.parent.PreviewController.addServiceManagerItem( + self.serviceItems[item][u'service_item'], 0) + else: + QtGui.QMessageBox.critical(self, + self.trUtf8('Missing Display Handler?'), + self.trUtf8('Your item cannot be display as ' + 'there is no handler to display it?'), + QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.Ok), + QtGui.QMessageBox.Ok) def remoteEdit(self): """ @@ -920,7 +935,7 @@ class ServiceManager(QtGui.QWidget): return item.data(0, QtCore.Qt.UserRole).toInt()[0] else: return parentitem.data(0, QtCore.Qt.UserRole).toInt()[0] - + def listRequest(self, message=None): data = [] curindex, count = self.findServiceItem() diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index dd1a5259b..9a8a5a182 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -53,6 +53,7 @@ class PresentationPlugin(Plugin): log.info(u'Presentations Initialising') Plugin.initialise(self) self.insert_toolbox_item() + presentation_types = [] for controller in self.controllers: if self.controllers[controller].enabled: self.controllers[controller].start_process() From e1f97fc9b92f03933c6a34fe9134fb54bbe1aaa6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 5 May 2010 18:35:11 +0100 Subject: [PATCH 2/7] Fix initial display --- openlp/core/ui/generaltab.py | 1 - openlp/plugins/media/mediaplugin.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index cef241aea..f55d81a70 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -45,7 +45,6 @@ class GeneralTab(SettingsTab): settings.beginGroup(self.settingsSection) self.MonitorNumber = settings.value(u'monitor', QtCore.QVariant(self.screens.display_count - 1)).toInt()[0] - print self.MonitorNumber, self.screens.monitor_number, self.screens.display_count, self.screens.screen_list self.screens.set_current_display(self.MonitorNumber) self.screens.monitor_number = self.MonitorNumber self.DisplayOnMonitor = settings.value( diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1fb7d7405..b73e9e425 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,6 +45,7 @@ class MediaPlugin(Plugin): self.video_list = u'' for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): mimetype = unicode(mimetype) + print mimetype type = mimetype.split(u'audio/x-') self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype) type = mimetype.split(u'audio/') From a8bbd540d45868ee4d53530938726496f6571e43 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 5 May 2010 19:07:57 +0100 Subject: [PATCH 3/7] service loading prefix check --- openlp/core/ui/servicemanager.py | 7 +++++-- openlp/plugins/media/mediaplugin.py | 3 ++- openlp/plugins/presentations/lib/mediaitem.py | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index e13e72794..0e6cba605 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -101,6 +101,7 @@ class ServiceManager(QtGui.QWidget): self.parent = parent self.serviceItems = [] self.serviceName = u'' + self.suffixes = u'' self.droppos = 0 #is a new service and has not been saved self.isNew = True @@ -228,6 +229,9 @@ class ServiceManager(QtGui.QWidget): self.themeMenu = QtGui.QMenu(self.trUtf8(u'&Change Item Theme')) self.menu.addMenu(self.themeMenu) + def supportedSuffixes(self, suffix): + self.suffixes = u'%s %s' % (self.suffixes, suffix) + def contextMenu(self, point): item = self.ServiceManagerList.itemAt(point) if item is None: @@ -678,10 +682,9 @@ class ServiceManager(QtGui.QWidget): Validates the service item and if the suffix matches an accepted one it allows the item to be displayed """ - print serviceItem.title if serviceItem.is_command(): type = serviceItem._raw_frames[0][u'title'].split(u'.')[1] - if type not in ['odp']: + if type not in self.suffixes: serviceItem.isValid = False def cleanUp(self): diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index b73e9e425..dcefa20c1 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,7 +45,6 @@ class MediaPlugin(Plugin): self.video_list = u'' for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): mimetype = unicode(mimetype) - print mimetype type = mimetype.split(u'audio/x-') self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype) type = mimetype.split(u'audio/') @@ -54,6 +53,8 @@ class MediaPlugin(Plugin): self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) type = mimetype.split(u'video/') self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) + self.service_manager.supportedSuffixes(self.audio_list) + self.service_manager.supportedSuffixes(self.video_list) def _add_to_list(self, list, value, type): if len(value) == 2: diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 9c654b198..3ae3136d5 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -75,6 +75,8 @@ class PresentationMediaItem(MediaManagerItem): if fileType.find(type) == -1: fileType += u'*%s ' % type self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType) + self.parent.service_manager.supportedSuffixes(fileType) + def requiredIcons(self): MediaManagerItem.requiredIcons(self) From 27a963a9c29cdbcba2d966b31a34ae69171d32b9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 5 May 2010 20:14:48 +0100 Subject: [PATCH 4/7] Validate Service item viewer loading --- openlp/core/ui/mainwindow.py | 1 + openlp/core/ui/servicemanager.py | 6 ++++++ openlp/core/ui/slidecontroller.py | 20 +++++++++++-------- openlp/plugins/media/mediaplugin.py | 1 + openlp/plugins/presentations/lib/mediaitem.py | 1 + 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index df275dd20..6a79958bd 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -550,6 +550,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): log.info(u'Load data from Settings') self.settingsForm.postSetUp() + def versionCheck(self, version): """ Checks the version of the Application called from openlp.pyw diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 0e6cba605..f1a41899a 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -102,6 +102,7 @@ class ServiceManager(QtGui.QWidget): self.serviceItems = [] self.serviceName = u'' self.suffixes = u'' + self.viewers = u'' self.droppos = 0 #is a new service and has not been saved self.isNew = True @@ -232,6 +233,9 @@ class ServiceManager(QtGui.QWidget): def supportedSuffixes(self, suffix): self.suffixes = u'%s %s' % (self.suffixes, suffix) + def supportedViewers(self, viewer): + self.viewers = u'%s %s' % (self.viewers, viewer) + def contextMenu(self, point): item = self.ServiceManagerList.itemAt(point) if item is None: @@ -686,6 +690,8 @@ class ServiceManager(QtGui.QWidget): type = serviceItem._raw_frames[0][u'title'].split(u'.')[1] if type not in self.suffixes: serviceItem.isValid = False + if serviceItem.title not in self.viewers: + serviceItem.isValid = False def cleanUp(self): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index c0d0d915f..d01babbfe 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -339,16 +339,16 @@ class SlideController(QtGui.QWidget): QtCore.SIGNAL(u'slidecontroller_%s_change' % self.type_prefix), self.onSlideChange) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_%s_set' % self.type_prefix), + QtCore.SIGNAL(u'slidecontroller_%s_set' % self.type_prefix), self.onSlideSelectedIndex) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_%s_blank' % self.type_prefix), + QtCore.SIGNAL(u'slidecontroller_%s_blank' % self.type_prefix), self.onSlideBlank) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_%s_unblank' % self.type_prefix), + QtCore.SIGNAL(u'slidecontroller_%s_unblank' % self.type_prefix), self.onSlideUnblank) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'slidecontroller_%s_text_request' % self.type_prefix), + QtCore.SIGNAL(u'slidecontroller_%s_text_request' % self.type_prefix), self.onTextRequest) QtCore.QObject.connect(self.Splitter, QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter) @@ -486,6 +486,7 @@ class SlideController(QtGui.QWidget): Display the slide number passed """ log.debug(u'processManagerItem') + self.onStopLoop() #If old item was a command tell it to stop if self.serviceItem and self.serviceItem.is_command(): self.onMediaStop() @@ -589,8 +590,8 @@ class SlideController(QtGui.QWidget): data_item[u'selected'] = \ (self.PreviewListWidget.currentRow() == framenumber) data.append(data_item) - Receiver.send_message(u'slidecontroller_%s_text_response' - % self.type_prefix, data) + Receiver.send_message(u'slidecontroller_%s_text_response' + % self.type_prefix, data) #Screen event methods def onSlideSelectedFirst(self): @@ -614,7 +615,7 @@ class SlideController(QtGui.QWidget): index = int(message[0]) if not self.serviceItem: return - Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(), + Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(), [self.serviceItem, self.isLive, index]) if self.serviceItem.is_command(): self.updatePreview() @@ -827,7 +828,10 @@ class SlideController(QtGui.QWidget): """ Stop the timer loop running """ - self.killTimer(self.timer_id) + if self.timer_id != 0: + self.killTimer(self.timer_id) + self.timer_id = 0 + def timerEvent(self, event): """ diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index dcefa20c1..1b1d9b984 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -55,6 +55,7 @@ class MediaPlugin(Plugin): self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) self.service_manager.supportedSuffixes(self.audio_list) self.service_manager.supportedSuffixes(self.video_list) + self.service_manager.supportedViewers(self.name) def _add_to_list(self, list, value, type): if len(value) == 2: diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 3ae3136d5..06a5e276d 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -71,6 +71,7 @@ class PresentationMediaItem(MediaManagerItem): if self.controllers[controller].enabled: types = self.controllers[controller].supports + \ self.controllers[controller].alsosupports + self.parent.service_manager.supportedViewers(controller) for type in types: if fileType.find(type) == -1: fileType += u'*%s ' % type From 0e7fb1c80c7bafe8c0ab5cb666a33cd2471071c4 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 5 May 2010 20:21:05 +0100 Subject: [PATCH 5/7] minor errors --- openlp/core/ui/mainwindow.py | 1 - openlp/plugins/presentations/presentationplugin.py | 1 - 2 files changed, 2 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6a79958bd..df275dd20 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -550,7 +550,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): log.info(u'Load data from Settings') self.settingsForm.postSetUp() - def versionCheck(self, version): """ Checks the version of the Application called from openlp.pyw diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 9a8a5a182..dd1a5259b 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -53,7 +53,6 @@ class PresentationPlugin(Plugin): log.info(u'Presentations Initialising') Plugin.initialise(self) self.insert_toolbox_item() - presentation_types = [] for controller in self.controllers: if self.controllers[controller].enabled: self.controllers[controller].start_process() From 6c9c9848dbbd845b2f4b4080035895b49a5369a7 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 6 May 2010 17:49:12 +0100 Subject: [PATCH 6/7] Clean up fixes --- openlp/core/ui/servicemanager.py | 27 ++++++++++--------- openlp/core/ui/slidecontroller.py | 1 - openlp/plugins/media/mediaplugin.py | 4 +-- openlp/plugins/presentations/lib/mediaitem.py | 4 +-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index f1a41899a..6778c402a 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -101,8 +101,7 @@ class ServiceManager(QtGui.QWidget): self.parent = parent self.serviceItems = [] self.serviceName = u'' - self.suffixes = u'' - self.viewers = u'' + self.suffixes = [] self.droppos = 0 #is a new service and has not been saved self.isNew = True @@ -231,10 +230,7 @@ class ServiceManager(QtGui.QWidget): self.menu.addMenu(self.themeMenu) def supportedSuffixes(self, suffix): - self.suffixes = u'%s %s' % (self.suffixes, suffix) - - def supportedViewers(self, viewer): - self.viewers = u'%s %s' % (self.viewers, viewer) + self.suffixes.append(suffix) def contextMenu(self, point): item = self.ServiceManagerList.itemAt(point) @@ -690,8 +686,6 @@ class ServiceManager(QtGui.QWidget): type = serviceItem._raw_frames[0][u'title'].split(u'.')[1] if type not in self.suffixes: serviceItem.isValid = False - if serviceItem.title not in self.viewers: - serviceItem.isValid = False def cleanUp(self): """ @@ -775,8 +769,17 @@ class ServiceManager(QtGui.QWidget): Send the current item to the Preview slide controller """ item, count = self.findServiceItem() - self.parent.PreviewController.addServiceManagerItem( - self.serviceItems[item][u'service_item'], count) + if self.serviceItems[item][u'service_item'].isValid: + self.parent.PreviewController.addServiceManagerItem( + self.serviceItems[item][u'service_item'], count) + else: + QtGui.QMessageBox.critical(self, + self.trUtf8('Missing Display Handler?'), + self.trUtf8('Your item cannot be displayed as ' + 'there is no handler to display it'), + QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.Ok), + QtGui.QMessageBox.Ok) def getServiceItem(self): """ @@ -808,8 +811,8 @@ class ServiceManager(QtGui.QWidget): else: QtGui.QMessageBox.critical(self, self.trUtf8('Missing Display Handler?'), - self.trUtf8('Your item cannot be display as ' - 'there is no handler to display it?'), + self.trUtf8('Your item cannot be displayed as ' + 'there is no handler to display it'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 754a97f59..15502423b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -846,7 +846,6 @@ class SlideController(QtGui.QWidget): self.killTimer(self.timer_id) self.timer_id = 0 - def timerEvent(self, event): """ If the timer event is for this window select next slide diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1b1d9b984..bdf28c8a4 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -53,14 +53,12 @@ class MediaPlugin(Plugin): self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) type = mimetype.split(u'video/') self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) - self.service_manager.supportedSuffixes(self.audio_list) - self.service_manager.supportedSuffixes(self.video_list) - self.service_manager.supportedViewers(self.name) def _add_to_list(self, list, value, type): if len(value) == 2: if list.find(value[1]) == -1: list += u'*.%s ' % value[1] + self.service_manager.supportedSuffixes(value[1]) type = u'' return list, type diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 06a5e276d..51663ad26 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -71,13 +71,11 @@ class PresentationMediaItem(MediaManagerItem): if self.controllers[controller].enabled: types = self.controllers[controller].supports + \ self.controllers[controller].alsosupports - self.parent.service_manager.supportedViewers(controller) for type in types: if fileType.find(type) == -1: fileType += u'*%s ' % type + self.parent.service_manager.supportedSuffixes(type) self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType) - self.parent.service_manager.supportedSuffixes(fileType) - def requiredIcons(self): MediaManagerItem.requiredIcons(self) From 14912955aecf40e2f82ccca1a5b534b764e4f360 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 6 May 2010 17:51:57 +0100 Subject: [PATCH 7/7] Remove ? --- openlp/core/ui/servicemanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 6778c402a..3a35a7a58 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -774,7 +774,7 @@ class ServiceManager(QtGui.QWidget): self.serviceItems[item][u'service_item'], count) else: QtGui.QMessageBox.critical(self, - self.trUtf8('Missing Display Handler?'), + self.trUtf8('Missing Display Handler'), self.trUtf8('Your item cannot be displayed as ' 'there is no handler to display it'), QtGui.QMessageBox.StandardButtons( @@ -810,7 +810,7 @@ class ServiceManager(QtGui.QWidget): self.serviceItems[item][u'service_item'], 0) else: QtGui.QMessageBox.critical(self, - self.trUtf8('Missing Display Handler?'), + self.trUtf8('Missing Display Handler'), self.trUtf8('Your item cannot be displayed as ' 'there is no handler to display it'), QtGui.QMessageBox.StandardButtons(