forked from openlp/openlp
Clean up fixes
This commit is contained in:
parent
0e7fb1c80c
commit
6c9c9848db
@ -101,8 +101,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.serviceItems = []
|
self.serviceItems = []
|
||||||
self.serviceName = u''
|
self.serviceName = u''
|
||||||
self.suffixes = u''
|
self.suffixes = []
|
||||||
self.viewers = u''
|
|
||||||
self.droppos = 0
|
self.droppos = 0
|
||||||
#is a new service and has not been saved
|
#is a new service and has not been saved
|
||||||
self.isNew = True
|
self.isNew = True
|
||||||
@ -231,10 +230,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.menu.addMenu(self.themeMenu)
|
self.menu.addMenu(self.themeMenu)
|
||||||
|
|
||||||
def supportedSuffixes(self, suffix):
|
def supportedSuffixes(self, suffix):
|
||||||
self.suffixes = u'%s %s' % (self.suffixes, suffix)
|
self.suffixes.append(suffix)
|
||||||
|
|
||||||
def supportedViewers(self, viewer):
|
|
||||||
self.viewers = u'%s %s' % (self.viewers, viewer)
|
|
||||||
|
|
||||||
def contextMenu(self, point):
|
def contextMenu(self, point):
|
||||||
item = self.ServiceManagerList.itemAt(point)
|
item = self.ServiceManagerList.itemAt(point)
|
||||||
@ -690,8 +686,6 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
type = serviceItem._raw_frames[0][u'title'].split(u'.')[1]
|
type = serviceItem._raw_frames[0][u'title'].split(u'.')[1]
|
||||||
if type not in self.suffixes:
|
if type not in self.suffixes:
|
||||||
serviceItem.isValid = False
|
serviceItem.isValid = False
|
||||||
if serviceItem.title not in self.viewers:
|
|
||||||
serviceItem.isValid = False
|
|
||||||
|
|
||||||
def cleanUp(self):
|
def cleanUp(self):
|
||||||
"""
|
"""
|
||||||
@ -775,8 +769,17 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Send the current item to the Preview slide controller
|
Send the current item to the Preview slide controller
|
||||||
"""
|
"""
|
||||||
item, count = self.findServiceItem()
|
item, count = self.findServiceItem()
|
||||||
self.parent.PreviewController.addServiceManagerItem(
|
if self.serviceItems[item][u'service_item'].isValid:
|
||||||
self.serviceItems[item][u'service_item'], count)
|
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):
|
def getServiceItem(self):
|
||||||
"""
|
"""
|
||||||
@ -808,8 +811,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
self.trUtf8('Missing Display Handler?'),
|
self.trUtf8('Missing Display Handler?'),
|
||||||
self.trUtf8('Your item cannot be display as '
|
self.trUtf8('Your item cannot be displayed as '
|
||||||
'there is no handler to display it?'),
|
'there is no handler to display it'),
|
||||||
QtGui.QMessageBox.StandardButtons(
|
QtGui.QMessageBox.StandardButtons(
|
||||||
QtGui.QMessageBox.Ok),
|
QtGui.QMessageBox.Ok),
|
||||||
QtGui.QMessageBox.Ok)
|
QtGui.QMessageBox.Ok)
|
||||||
|
@ -846,7 +846,6 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.killTimer(self.timer_id)
|
self.killTimer(self.timer_id)
|
||||||
self.timer_id = 0
|
self.timer_id = 0
|
||||||
|
|
||||||
|
|
||||||
def timerEvent(self, event):
|
def timerEvent(self, event):
|
||||||
"""
|
"""
|
||||||
If the timer event is for this window select next slide
|
If the timer event is for this window select next slide
|
||||||
|
@ -53,14 +53,12 @@ class MediaPlugin(Plugin):
|
|||||||
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype)
|
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype)
|
||||||
type = mimetype.split(u'video/')
|
type = mimetype.split(u'video/')
|
||||||
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype)
|
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):
|
def _add_to_list(self, list, value, type):
|
||||||
if len(value) == 2:
|
if len(value) == 2:
|
||||||
if list.find(value[1]) == -1:
|
if list.find(value[1]) == -1:
|
||||||
list += u'*.%s ' % value[1]
|
list += u'*.%s ' % value[1]
|
||||||
|
self.service_manager.supportedSuffixes(value[1])
|
||||||
type = u''
|
type = u''
|
||||||
return list, type
|
return list, type
|
||||||
|
|
||||||
|
@ -71,13 +71,11 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
if self.controllers[controller].enabled:
|
if self.controllers[controller].enabled:
|
||||||
types = self.controllers[controller].supports + \
|
types = self.controllers[controller].supports + \
|
||||||
self.controllers[controller].alsosupports
|
self.controllers[controller].alsosupports
|
||||||
self.parent.service_manager.supportedViewers(controller)
|
|
||||||
for type in types:
|
for type in types:
|
||||||
if fileType.find(type) == -1:
|
if fileType.find(type) == -1:
|
||||||
fileType += u'*%s ' % type
|
fileType += u'*%s ' % type
|
||||||
|
self.parent.service_manager.supportedSuffixes(type)
|
||||||
self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType)
|
self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType)
|
||||||
self.parent.service_manager.supportedSuffixes(fileType)
|
|
||||||
|
|
||||||
|
|
||||||
def requiredIcons(self):
|
def requiredIcons(self):
|
||||||
MediaManagerItem.requiredIcons(self)
|
MediaManagerItem.requiredIcons(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user