forked from openlp/openlp
Fix issues with plugins (inc. bug #605655)
This commit is contained in:
parent
ee80308997
commit
ab3efd2b3b
@ -77,7 +77,6 @@ class PluginManager(object):
|
||||
startdepth = len(os.path.abspath(plugin_dir).split(os.sep))
|
||||
log.debug(u'finding plugins in %s at depth %d',
|
||||
unicode(plugin_dir), startdepth)
|
||||
|
||||
for root, dirs, files in os.walk(plugin_dir):
|
||||
for name in files:
|
||||
if name.endswith(u'.py') and not name.startswith(u'__'):
|
||||
|
@ -28,7 +28,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
|
||||
from openlp.core.lib import Plugin, build_icon, translate
|
||||
from openlp.core.lib.db import Manager
|
||||
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
|
||||
from openlp.plugins.alerts.lib.db import init_schema
|
||||
@ -46,7 +46,6 @@ class AlertsPlugin(Plugin):
|
||||
self.alertsmanager = AlertsManager(self)
|
||||
self.manager = Manager(u'alerts', init_schema)
|
||||
self.alertForm = AlertForm(self.manager, self)
|
||||
self.status = PluginStatus.Active
|
||||
|
||||
def getSettingsTab(self):
|
||||
"""
|
||||
|
@ -28,7 +28,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
|
||||
from openlp.core.lib import Plugin, build_icon, translate
|
||||
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -41,8 +41,6 @@ class BiblePlugin(Plugin):
|
||||
self.weight = -9
|
||||
self.icon_path = u':/plugins/plugin_bibles.png'
|
||||
self.icon = build_icon(self.icon_path)
|
||||
# Register the bible Manager.
|
||||
self.status = PluginStatus.Active
|
||||
self.manager = None
|
||||
|
||||
def initialise(self):
|
||||
|
@ -28,7 +28,7 @@ import logging
|
||||
|
||||
from forms import EditCustomForm
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
|
||||
from openlp.core.lib import Plugin, build_icon, translate
|
||||
from openlp.core.lib.db import Manager
|
||||
from openlp.plugins.custom.lib import CustomMediaItem, CustomTab
|
||||
from openlp.plugins.custom.lib.db import CustomSlide, init_schema
|
||||
@ -53,7 +53,6 @@ class CustomPlugin(Plugin):
|
||||
self.edit_custom_form = EditCustomForm(self.custommanager)
|
||||
self.icon_path = u':/plugins/plugin_custom.png'
|
||||
self.icon = build_icon(self.icon_path)
|
||||
self.status = PluginStatus.Active
|
||||
|
||||
def getSettingsTab(self):
|
||||
return CustomTab(self.name)
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
|
||||
from openlp.core.lib import Plugin, build_icon, translate
|
||||
from openlp.plugins.images.lib import ImageMediaItem
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -39,7 +39,6 @@ class ImagePlugin(Plugin):
|
||||
self.weight = -7
|
||||
self.icon_path = u':/plugins/plugin_images.png'
|
||||
self.icon = build_icon(self.icon_path)
|
||||
self.status = PluginStatus.Active
|
||||
|
||||
def getMediaManagerItem(self):
|
||||
# Create the MediaManagerItem object
|
||||
|
@ -28,7 +28,7 @@ import logging
|
||||
|
||||
from PyQt4.phonon import Phonon
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
|
||||
from openlp.core.lib import Plugin, build_icon, translate
|
||||
from openlp.plugins.media.lib import MediaMediaItem
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -43,7 +43,6 @@ class MediaPlugin(Plugin):
|
||||
self.icon = build_icon(self.icon_path)
|
||||
# passed with drag and drop messages
|
||||
self.dnd_id = u'Media'
|
||||
self.status = PluginStatus.Active
|
||||
self.audio_list = u''
|
||||
self.video_list = u''
|
||||
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
||||
|
@ -69,8 +69,8 @@ class ImpressController(PresentationController):
|
||||
"""
|
||||
log.debug(u'Initialising')
|
||||
PresentationController.__init__(self, plugin, u'Impress')
|
||||
self.supports = [u'.odp']
|
||||
self.alsosupports = [u'.ppt', u'.pps', u'.pptx', u'.ppsx']
|
||||
self.supports = [u'odp']
|
||||
self.alsosupports = [u'ppt', u'pps', u'pptx', u'ppsx']
|
||||
self.process = None
|
||||
self.desktop = None
|
||||
self.manager = None
|
||||
|
@ -79,7 +79,6 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
'Select Presentation(s)')
|
||||
self.Automatic = translate('PresentationPlugin.MediaItem',
|
||||
'Automatic')
|
||||
self.buildFileMaskString()
|
||||
|
||||
def buildFileMaskString(self):
|
||||
"""
|
||||
@ -92,7 +91,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
self.controllers[controller].alsosupports
|
||||
for type in types:
|
||||
if fileType.find(type) == -1:
|
||||
fileType += u'*%s ' % type
|
||||
fileType += u'*.%s ' % type
|
||||
self.parent.serviceManager.supportedSuffixes(type)
|
||||
self.OnNewFileMasks = translate('PresentationPlugin.MediaItem',
|
||||
'Presentations (%s)' % fileType)
|
||||
@ -288,7 +287,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
"supports" the extension. If none found, then look for a controller
|
||||
which "alsosupports" it instead.
|
||||
"""
|
||||
filetype = os.path.splitext(filename)[1]
|
||||
filetype = filename.split(u'.')[1]
|
||||
if not filetype:
|
||||
return None
|
||||
for controller in self.controllers:
|
||||
|
@ -54,7 +54,7 @@ class PowerpointController(PresentationController):
|
||||
"""
|
||||
log.debug(u'Initialising')
|
||||
PresentationController.__init__(self, plugin, u'Powerpoint')
|
||||
self.supports = [u'.ppt', u'.pps', u'.pptx', u'.ppsx']
|
||||
self.supports = [u'ppt', u'pps', u'pptx', u'ppsx']
|
||||
self.process = None
|
||||
|
||||
def check_available(self):
|
||||
|
@ -50,7 +50,7 @@ class PptviewController(PresentationController):
|
||||
log.debug(u'Initialising')
|
||||
self.process = None
|
||||
PresentationController.__init__(self, plugin, u'Powerpoint Viewer')
|
||||
self.supports = [u'.ppt', u'.pps', u'.pptx', u'.ppsx']
|
||||
self.supports = [u'ppt', u'pps', u'pptx', u'ppsx']
|
||||
|
||||
def check_available(self):
|
||||
"""
|
||||
|
@ -30,7 +30,7 @@ presentations from a variety of document formats.
|
||||
import os
|
||||
import logging
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
|
||||
from openlp.core.lib import Plugin, build_icon, translate
|
||||
from openlp.core.utils import AppLocation
|
||||
from openlp.plugins.presentations.lib import PresentationController, \
|
||||
PresentationMediaItem, PresentationTab
|
||||
@ -55,7 +55,6 @@ class PresentationPlugin(Plugin):
|
||||
self.weight = -8
|
||||
self.icon_path = u':/plugins/plugin_presentations.png'
|
||||
self.icon = build_icon(self.icon_path)
|
||||
self.status = PluginStatus.Active
|
||||
|
||||
def getSettingsTab(self):
|
||||
"""
|
||||
@ -74,6 +73,7 @@ class PresentationPlugin(Plugin):
|
||||
for controller in self.controllers:
|
||||
if self.controllers[controller].enabled():
|
||||
self.controllers[controller].start_process()
|
||||
self.mediaItem.buildFileMaskString()
|
||||
|
||||
def finalise(self):
|
||||
"""
|
||||
|
@ -28,8 +28,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, \
|
||||
translate
|
||||
from openlp.core.lib import Plugin, build_icon, Receiver, translate
|
||||
from openlp.core.lib.db import Manager
|
||||
from openlp.plugins.songs.lib import OpenLPSongImport, SongMediaItem, SongsTab
|
||||
from openlp.plugins.songs.lib.db import init_schema, Song
|
||||
@ -63,7 +62,6 @@ class SongsPlugin(Plugin):
|
||||
self.manager = Manager(u'songs', init_schema)
|
||||
self.icon_path = u':/plugins/plugin_songs.png'
|
||||
self.icon = build_icon(self.icon_path)
|
||||
self.status = PluginStatus.Active
|
||||
|
||||
def getSettingsTab(self):
|
||||
return SongsTab(self.name)
|
||||
|
Loading…
Reference in New Issue
Block a user