diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 9608a5219..113d15e2f 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -36,7 +36,6 @@ log = logging.getLogger(__name__) # FIXME: Add html5 doctype. However, do not break theme gradients. HTMLSRC = u""" - OpenLP Display @@ -283,7 +282,7 @@ def build_html(item, screen, alert, islive, background, plugins=None, \ if plugins: for plugin in plugins: css_additions += plugin.getDisplayCss() - js_additions += plugin.getDisplayJavascript() + js_additions += plugin.getDisplayJavaScript() html_additions += plugin.getDisplayHtml() html = HTMLSRC % (build_background_css(item, width, height), width, height, diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 4c79a4732..53e22ad20 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -168,7 +168,7 @@ class Plugin(QtCore.QObject): self.mediadock = plugin_helpers[u'toolbox'] self.pluginManager = plugin_helpers[u'pluginmanager'] self.formparent = plugin_helpers[u'formparent'] - self.mediaManager = plugin_helpers[u'mediamanager'] + self.mediaManager = plugin_helpers[u'mediacontroller'] QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_add_service_item' % self.name), self.processAddServiceEvent) @@ -376,7 +376,7 @@ class Plugin(QtCore.QObject): """ return u'' - def getDisplayJavascript(self): + def getDisplayJavaScript(self): """ Add javascript functions to htmlbuilder """ diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index f9b10dfb4..3a8a44e11 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -67,7 +67,6 @@ class Display(QtGui.QGraphicsView): self.width(), self.height()) self.webView.settings().setAttribute( QtWebKit.QWebSettings.PluginsEnabled, True) - self.webView.settings().setAttribute(7, True) self.page = self.webView.page() self.frame = self.page.mainFrame() self.frame.setScrollBarPolicy(QtCore.Qt.Vertical, @@ -130,7 +129,6 @@ class MainDisplay(Display): self.screen[u'size'].width(), self.screen[u'size'].height()) self.webView.settings().setAttribute( \ QtWebKit.QWebSettings.PluginsEnabled, True) - self.webView.settings().setAttribute(7, True) self.page = self.webView.page() self.frame = self.page.mainFrame() QtCore.QObject.connect(self.webView, @@ -209,7 +207,7 @@ class MainDisplay(Display): """ log.debug(u'alert to display') if self.height() != self.screen[u'size'].height() \ - or not self.isVisible():# or self.videoWidget.isVisible(): + or not self.isVisible(): shrink = True else: shrink = False diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 5954c6e71..4ca34f90a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -42,7 +42,7 @@ from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \ ShortcutListForm, FormattingTagForm -from openlp.core.ui.media import MediaManager +from openlp.core.ui.media import MediaController from openlp.core.utils import AppLocation, add_actions, LanguageManager, \ get_application_version, delete_file from openlp.core.utils.actions import ActionList, CategoryOrder @@ -148,7 +148,7 @@ class Ui_MainWindow(object): self.defaultThemeLabel = QtGui.QLabel(self.statusBar) self.defaultThemeLabel.setObjectName(u'defaultThemeLabel') self.statusBar.addPermanentWidget(self.defaultThemeLabel) - # Create the MediaManager + # Create the MediaController self.mediaManagerDock = OpenLPDockWidget(mainWindow, u'mediaManagerDock', u':/system/system_mediamanager.png') self.mediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE) @@ -557,7 +557,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.pluginManager = PluginManager(pluginpath) self.pluginHelpers = {} self.imageManager = ImageManager() - self.mediaManager = MediaManager(self) + self.mediaManager = MediaController(self) # Set up the interface self.setupUi(self) # Load settings after setupUi so default UI sizes are overwritten @@ -646,7 +646,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.pluginHelpers[u'toolbox'] = self.mediaDockManager self.pluginHelpers[u'pluginmanager'] = self.pluginManager self.pluginHelpers[u'formparent'] = self - self.pluginHelpers[u'mediamanager'] = self.mediaManager + self.pluginHelpers[u'mediacontroller'] = self.mediaManager self.pluginManager.find_plugins(pluginpath, self.pluginHelpers) # hook methods have to happen after find_plugins. Find plugins needs # the controllers hence the hooks have moved from setupUI() to here diff --git a/openlp/core/ui/media/__init__.py b/openlp/core/ui/media/__init__.py index edd1ad5f6..b028fbe37 100644 --- a/openlp/core/ui/media/__init__.py +++ b/openlp/core/ui/media/__init__.py @@ -42,8 +42,8 @@ class MediaType(object): Unused = 0 Audio = 1 Video = 2 - Cd = 3 - Dvd = 4 + CD = 3 + DVD = 4 Folder = 5 class MediaInfo(object): @@ -59,5 +59,5 @@ class MediaInfo(object): end_time = 0 media_type = MediaType() -from mediaapi import MediaAPI -from mediamanager import MediaManager +from media_api import MediaAPI +from mediacontroller import MediaController diff --git a/openlp/core/ui/media/mediaapi.py b/openlp/core/ui/media/media_api.py similarity index 97% rename from openlp/core/ui/media/mediaapi.py rename to openlp/core/ui/media/media_api.py index 58ecd49d0..344fcdecc 100644 --- a/openlp/core/ui/media/mediaapi.py +++ b/openlp/core/ui/media/media_api.py @@ -29,9 +29,10 @@ from openlp.core.ui.media import MediaState class MediaAPI(object): """ - Specialiced Media API class - to reflect Features of the related API + A generic media API class to provide OpenLP + with a pluggable media display framework. """ + def __init__(self, parent, name=u'MediaApi'): self.parent = parent self.name = name diff --git a/openlp/core/ui/media/mediamanager.py b/openlp/core/ui/media/mediacontroller.py similarity index 99% rename from openlp/core/ui/media/mediamanager.py rename to openlp/core/ui/media/mediacontroller.py index a43339c29..c038720e3 100644 --- a/openlp/core/ui/media/mediamanager.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -37,7 +37,7 @@ from openlp.core.utils import AppLocation log = logging.getLogger(__name__) -class MediaManager(object): +class MediaController(object): """ The implementation of a Media Manager The idea is to separate the media related implementation @@ -105,7 +105,7 @@ class MediaManager(object): u'core', u'ui', u'media') for filename in os.listdir(controller_dir): if filename.endswith(u'api.py') and \ - not filename == 'mediaapi.py': + not filename == 'media_api.py': path = os.path.join(controller_dir, filename) if os.path.isfile(path): modulename = u'openlp.core.ui.media.' + \ diff --git a/openlp/core/ui/media/phononapi.py b/openlp/core/ui/media/phononapi.py index 0fe8a1825..ff0192bc2 100644 --- a/openlp/core/ui/media/phononapi.py +++ b/openlp/core/ui/media/phononapi.py @@ -39,8 +39,8 @@ log = logging.getLogger(__name__) class PhononAPI(MediaAPI): """ - Specialiced MediaAPI class - to reflect Features of the Phonon API + A specialised version of the MediaAPI class, + which provides a Phonon display. """ def __init__(self, parent): diff --git a/openlp/core/ui/media/vlcapi.py b/openlp/core/ui/media/vlcapi.py index ffc928238..6a66d3401 100644 --- a/openlp/core/ui/media/vlcapi.py +++ b/openlp/core/ui/media/vlcapi.py @@ -42,9 +42,10 @@ log = logging.getLogger(__name__) class VlcAPI(MediaAPI): """ - Specialiced MediaAPI class - to reflect Features of the Vlc API + A specialised version of the MediaAPI class, + which provides a QtWebKit display. """ + def __init__(self, parent): MediaAPI.__init__(self, parent, u'Vlc') self.parent = parent diff --git a/openlp/core/ui/media/webkitapi.py b/openlp/core/ui/media/webkitapi.py index 1fbb54576..68ae02ab8 100644 --- a/openlp/core/ui/media/webkitapi.py +++ b/openlp/core/ui/media/webkitapi.py @@ -36,8 +36,8 @@ log = logging.getLogger(__name__) class WebkitAPI(MediaAPI): """ - Specialiced MediaAPI class - to reflect Features of the QtWebkit API + A specialised version of the MediaAPI class, + which provides a QtWebKit display. """ def __init__(self, parent): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 12d787966..6ae49723d 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -67,7 +67,7 @@ class Controller(QtGui.QWidget): created from within other plugins This function is needed to catch the current controller """ - sender = self.sender().objectName() or self.sender().text() + sender = self.sender().objectName() if self.sender().objectName() else self.sender().text() controller = self Receiver.send_message('%s' % sender, [controller, args]) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index d790eb8f6..68900a31d 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -126,7 +126,6 @@ class MediaMediaItem(MediaManagerItem): item = self.listView.currentItem() filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): - #(path, name) = os.path.split(filename) if self.plugin.liveController.mediaManager.video( \ self.plugin.liveController, filename, True, True): self.resetAction.setVisible(True) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index e0cf8d65e..a04d76b13 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -107,7 +107,7 @@ class MediaPlugin(Plugin): """ return self.mediaManager.get_media_display_css() - def getDisplayJavascript(self): + def getDisplayJavaScript(self): """ Add javascript functions to htmlbuilder """