diff --git a/documentation/source/core/lib.rst b/documentation/source/core/lib.rst index 12c7b702c..43ca90b3b 100644 --- a/documentation/source/core/lib.rst +++ b/documentation/source/core/lib.rst @@ -60,18 +60,6 @@ .. autoclass:: openlp.core.lib.settingstab.SettingsTab :members: -:mod:`SongXMLBuilder` ---------------------- - -.. autoclass:: openlp.core.lib.songxmlhandler.SongXMLBuilder - :members: - -:mod:`SongXMLParser` --------------------- - -.. autoclass:: openlp.core.lib.songxmlhandler.SongXMLParser - :members: - :mod:`ThemeXML` --------------- @@ -83,10 +71,3 @@ .. autoclass:: openlp.core.lib.toolbar.OpenLPToolbar :members: - -:mod:`XmlRootClass` -------------------- - -.. autoclass:: openlp.core.lib.xmlrootclass.XmlRootClass - :members: - diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index d6f805c98..4718e289e 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -202,28 +202,17 @@ def check_item_selected(list_widget, message): return False return True - -class ThemeLevel(object): - """ - Provides an enumeration for the level a theme applies to - """ - Global = 1 - Service = 2 - Song = 3 - from eventreceiver import Receiver from settingsmanager import SettingsManager from plugin import PluginStatus, Plugin from pluginmanager import PluginManager from settingstab import SettingsTab -from xmlrootclass import XmlRootClass from serviceitem import ServiceItem from serviceitem import ServiceItemType from serviceitem import ItemCapabilities from toolbar import OpenLPToolbar from dockwidget import OpenLPDockWidget -from songxmlhandler import SongXMLBuilder, SongXMLParser -from themexmlhandler import ThemeXML +from theme import ThemeLevel, ThemeXML from renderer import Renderer from rendermanager import RenderManager from mediamanageritem import MediaManagerItem diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index f20f3ab38..8acc79541 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -189,7 +189,7 @@ class Manager(object): Any parameters to order the returned objects by. Defaults to None. """ query = self.session.query(object_class) - if order_by_ref: + if order_by_ref is not None: return query.order_by(order_by_ref).all() return query.all() @@ -208,7 +208,7 @@ class Manager(object): Any parameters to order the returned objects by. Defaults to None. """ query = self.session.query(object_class).filter(filter_clause) - if order_by_ref: + if order_by_ref is not None: return query.order_by(order_by_ref).all() return query.all() diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 322ce8cd0..8ebfe88ae 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -443,7 +443,7 @@ class MediaManagerItem(QtGui.QWidget): service_item = self.buildServiceItem() if service_item: service_item.from_plugin = True - self.parent.preview_controller.addServiceItem(service_item) + self.parent.previewController.addServiceItem(service_item) def onLiveClick(self): """ @@ -460,7 +460,7 @@ class MediaManagerItem(QtGui.QWidget): service_item = self.buildServiceItem() if service_item: service_item.from_plugin = True - self.parent.live_controller.addServiceItem(service_item) + self.parent.liveController.addServiceItem(service_item) def onAddClick(self): """ @@ -479,7 +479,7 @@ class MediaManagerItem(QtGui.QWidget): service_item = self.buildServiceItem() if service_item: service_item.from_plugin = False - self.parent.service_manager.addServiceItem(service_item, + self.parent.serviceManager.addServiceItem(service_item, replace=self.remoteTriggered) else: items = self.ListView.selectedIndexes() @@ -487,7 +487,7 @@ class MediaManagerItem(QtGui.QWidget): service_item = self.buildServiceItem(item) if service_item: service_item.from_plugin = False - self.parent.service_manager.addServiceItem(service_item) + self.parent.serviceManager.addServiceItem(service_item) def onAddEditClick(self): """ @@ -500,7 +500,7 @@ class MediaManagerItem(QtGui.QWidget): 'You must select one or more items')) else: log.debug(self.PluginNameShort + u' Add requested') - service_item = self.parent.service_manager.getServiceItem() + service_item = self.parent.serviceManager.getServiceItem() if not service_item: QtGui.QMessageBox.information(self, translate('MediaManagerItem', 'No Service Item Selected'), @@ -508,7 +508,7 @@ class MediaManagerItem(QtGui.QWidget): 'You must select an existing service item to add to.')) elif self.title.lower() == service_item.name.lower(): self.generateSlideData(service_item) - self.parent.service_manager.addServiceItem(service_item, + self.parent.serviceManager.addServiceItem(service_item, replace=True) else: #Turn off the remote edit update message indicator diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 1450ef1fe..18d4bdc9e 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -67,23 +67,23 @@ class Plugin(QtCore.QObject): **Hook Functions** - ``check_pre_conditions()`` + ``checkPreConditions()`` Provides the Plugin with a handle to check if it can be loaded. - ``get_media_manager_item()`` + ``getMediaManagerItem()`` Returns an instance of MediaManagerItem to be used in the Media Manager. - ``add_import_menu_item(import_menu)`` + ``addImportMenuItem(import_menu)`` Add an item to the Import menu. - ``add_export_menu_item(export_menu)`` + ``addExportMenuItem(export_menu)`` Add an item to the Export menu. - ``get_settings_tab()`` + ``getSettingsTab()`` Returns an instance of SettingsTabItem to be used in the Settings dialog. - ``add_to_menu(menubar)`` + ``addToMenu(menubar)`` A method to add a menu item to anywhere in the menu, given the menu bar. ``handle_event(event)`` @@ -124,18 +124,19 @@ class Plugin(QtCore.QObject): self.status = PluginStatus.Inactive # Set up logging self.log = logging.getLogger(self.name) - self.preview_controller = plugin_helpers[u'preview'] - self.live_controller = plugin_helpers[u'live'] - self.render_manager = plugin_helpers[u'render'] - self.service_manager = plugin_helpers[u'service'] - self.settings_form = plugin_helpers[u'settings form'] + self.previewController = plugin_helpers[u'preview'] + self.liveController = plugin_helpers[u'live'] + self.renderManager = plugin_helpers[u'render'] + self.serviceManager = plugin_helpers[u'service'] + self.settingsForm = plugin_helpers[u'settings form'] self.mediadock = plugin_helpers[u'toolbox'] - self.maindisplay = plugin_helpers[u'maindisplay'] + self.displayManager = plugin_helpers[u'displaymanager'] + self.pluginManager = plugin_helpers[u'pluginmanager'] QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_add_service_item' % self.name), - self.process_add_service_event) + self.processAddServiceEvent) - def check_pre_conditions(self): + def checkPreConditions(self): """ Provides the Plugin with a handle to check if it can be loaded. Failing Preconditions does not stop a settings Tab being created @@ -144,7 +145,7 @@ class Plugin(QtCore.QObject): """ return True - def set_status(self): + def setStatus(self): """ Sets the status of the plugin """ @@ -152,7 +153,7 @@ class Plugin(QtCore.QObject): self.settingsSection + u'/status', QtCore.QVariant(PluginStatus.Inactive)).toInt()[0] - def toggle_status(self, new_status): + def toggleStatus(self, new_status): """ Changes the status of the plugin and remembers it """ @@ -160,7 +161,7 @@ class Plugin(QtCore.QObject): QtCore.QSettings().setValue( self.settingsSection + u'/status', QtCore.QVariant(self.status)) - def is_active(self): + def isActive(self): """ Indicates if the plugin is active @@ -168,47 +169,47 @@ class Plugin(QtCore.QObject): """ return self.status == PluginStatus.Active - def get_media_manager_item(self): + def getMediaManagerItem(self): """ Construct a MediaManagerItem object with all the buttons and things you need, and return it for integration into openlp.org. """ pass - def add_import_menu_item(self, import_menu): + def addImportMenuItem(self, importMenu): """ Create a menu item and add it to the "Import" menu. - ``import_menu`` + ``importMenu`` The Import menu. """ pass - def add_export_menu_item(self, export_menu): + def addExportMenuItem(self, exportMenu): """ Create a menu item and add it to the "Export" menu. - ``export_menu`` + ``exportMenu`` The Export menu """ pass - def add_tools_menu_item(self, tools_menu): + def addToolsMenuItem(self, toolsMenu): """ Create a menu item and add it to the "Tools" menu. - ``tools_menu`` + ``toolsMenu`` The Tools menu """ pass - def get_settings_tab(self): + def getSettingsTab(self): """ Create a tab for the settings window. """ pass - def add_to_menu(self, menubar): + def addToMenu(self, menubar): """ Add menu items to the menu, given the menubar. @@ -217,16 +218,16 @@ class Plugin(QtCore.QObject): """ pass - def process_add_service_event(self, replace=False): + def processAddServiceEvent(self, replace=False): """ Generic Drag and drop handler triggered from service_manager. """ - log.debug(u'process_add_service_event event called for plugin %s' % + log.debug(u'processAddServiceEvent event called for plugin %s' % self.name) if replace: - self.media_item.onAddEditClick() + self.mediaItem.onAddEditClick() else: - self.media_item.onAddClick() + self.mediaItem.onAddClick() def about(self): """ @@ -240,36 +241,36 @@ class Plugin(QtCore.QObject): """ Called by the plugin Manager to initialise anything it needs. """ - if self.media_item: - self.media_item.initialise() - self.insert_toolbox_item() + if self.mediaItem: + self.mediaItem.initialise() + self.insertToolboxItem() def finalise(self): """ Called by the plugin Manager to cleanup things. """ - self.remove_toolbox_item() + self.removeToolboxItem() - def remove_toolbox_item(self): + def removeToolboxItem(self): """ Called by the plugin to remove toolbar """ - if self.media_item: + if self.mediaItem: self.mediadock.remove_dock(self.name) if self.settings_tab: - self.settings_form.removeTab(self.name) + self.settingsForm.removeTab(self.name) - def insert_toolbox_item(self): + def insertToolboxItem(self): """ Called by plugin to replace toolbar """ - if self.media_item: - self.mediadock.insert_dock(self.media_item, self.icon, self.weight) + if self.mediaItem: + self.mediadock.insert_dock(self.mediaItem, self.icon, self.weight) if self.settings_tab: - self.settings_form.insertTab(self.settings_tab, self.weight) + self.settingsForm.insertTab(self.settings_tab, self.weight) - def can_delete_theme(self, theme): + def canDeleteTheme(self, theme): """ Called to ask the plugin if a theme can be deleted """ - return True + return True \ No newline at end of file diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index d9ae40845..20c8bc97b 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -109,9 +109,9 @@ class PluginManager(object): log.exception(u'loaded plugin %s has no helpers', unicode(p)) plugins_list = sorted(plugin_objects, self.order_by_weight) for plugin in plugins_list: - if plugin.check_pre_conditions(): + if plugin.checkPreConditions(): log.debug(u'Plugin %s active', unicode(plugin.name)) - plugin.set_status() + plugin.setStatus() else: plugin.status = PluginStatus.Disabled self.plugins.append(plugin) @@ -138,7 +138,7 @@ class PluginManager(object): """ for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: - plugin.media_item = plugin.get_media_manager_item() + plugin.mediaItem = plugin.getMediaManagerItem() def hook_settings_tabs(self, settingsform=None): """ @@ -151,7 +151,7 @@ class PluginManager(object): """ for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: - plugin.settings_tab = plugin.get_settings_tab() + plugin.settings_tab = plugin.getSettingsTab() if plugin.settings_tab: log.debug(u'Inserting settings tab item from %s' % plugin.name) @@ -169,7 +169,7 @@ class PluginManager(object): """ for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: - plugin.add_import_menu_item(import_menu) + plugin.addImportMenuItem(import_menu) def hook_export_menu(self, export_menu): """ @@ -181,7 +181,7 @@ class PluginManager(object): """ for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: - plugin.add_export_menu_item(export_menu) + plugin.addExportMenuItem(export_menu) def hook_tools_menu(self, tools_menu): """ @@ -193,7 +193,7 @@ class PluginManager(object): """ for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: - plugin.add_tools_menu_item(tools_menu) + plugin.addToolsMenuItem(tools_menu) def initialise_plugins(self): """ @@ -202,12 +202,12 @@ class PluginManager(object): """ for plugin in self.plugins: log.info(u'initialising plugins %s in a %s state' - % (plugin.name, plugin.is_active())) - if plugin.is_active(): + % (plugin.name, plugin.isActive())) + if plugin.isActive(): plugin.initialise() log.info(u'Initialisation Complete for %s ' % plugin.name) - if not plugin.is_active(): - plugin.remove_toolbox_item() + if not plugin.isActive(): + plugin.removeToolboxItem() def finalise_plugins(self): """ @@ -216,7 +216,6 @@ class PluginManager(object): """ log.info(u'finalising plugins') for plugin in self.plugins: - if plugin.is_active(): + if plugin.isActive(): plugin.finalise() - log.info(u'Finalisation Complete for %s ' % plugin.name) - + log.info(u'Finalisation Complete for %s ' % plugin.name) \ No newline at end of file diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index c7f96528c..04c854afa 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -29,6 +29,7 @@ format it for the output display. import logging from PyQt4 import QtGui, QtCore + from openlp.core.lib import resize_image log = logging.getLogger(__name__) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 431f74564..b3c46a5eb 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -27,8 +27,7 @@ import logging from PyQt4 import QtCore -from renderer import Renderer -from openlp.core.lib import ThemeLevel +from openlp.core.lib import Renderer, ThemeLevel log = logging.getLogger(__name__) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index c107a1872..a8988aa84 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -35,7 +35,6 @@ import uuid from PyQt4 import QtGui from openlp.core.lib import build_icon, resize_image -from openlp.core.utils import AppLocation log = logging.getLogger(__name__) @@ -74,7 +73,7 @@ class ServiceItem(object): The plugin that this service item belongs to. """ if plugin: - self.render_manager = plugin.render_manager + self.render_manager = plugin.renderManager self.name = plugin.name self.title = u'' self.shortname = u'' @@ -93,7 +92,6 @@ class ServiceItem(object): self.is_valid = True self.cache = {} self.icon = None - self.serviceItemPath = AppLocation.get_section_data_path(u'serviceItems') def add_capability(self, capability): """ @@ -155,12 +153,9 @@ class ServiceItem(object): del self.cache[len(self._display_frames)] log.log(15, u'Formatting took %4s' % (time.time() - before)) elif self.service_item_type == ServiceItemType.Image: - for count, slide in enumerate(self._raw_frames): + for slide in self._raw_frames: slide[u'image'] = resize_image(slide[u'image'], self.render_manager.width, self.render_manager.height) - path = os.path.join(self.serviceItemPath, self._uuid + unicode(count) + u'.png') - slide[u'image'].save(path) - slide[u'display'] = path elif self.service_item_type == ServiceItemType.Command: pass else: @@ -376,8 +371,7 @@ class ServiceItem(object): if self.service_item_type == ServiceItemType.Text: return self.render_individual(row) else: - return {u'main':self._raw_frames[row][u'image'], - u'trans':None, u'display':self._raw_frames[row][u'display']} + return {u'main':self._raw_frames[row][u'image'], u'trans':None} def get_frame_title(self, row=0): """ diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 74a5d4866..a8c8e7c50 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -57,15 +57,33 @@ class SettingsManager(object): self.mainwindow_left + self.mainwindow_right) - 100 ) / 2 self.slidecontroller_image = self.slidecontroller - 50 - self.showPreviewPanel = QtCore.QSettings().value( - u'user interface/preview panel', QtCore.QVariant(True)).toBool() - - def togglePreviewPanel(self, isVisible): + def get_preview_visibility(self): """ - Toggle the preview panel visibility. + Return the preview panel's visibility. + """ + return QtCore.QSettings().value(u'user interface/preview panel', + QtCore.QVariant(True)).toBool() + + def set_preview_visibility(self, visible): + """ + Set the preview panel's visibility. """ QtCore.QSettings().setValue(u'user interface/preview panel', - QtCore.QVariant(isVisible)) + QtCore.QVariant(visible)) + + def get_live_visibility(self): + """ + Return the live panel's visibility. + """ + return QtCore.QSettings().value(u'user interface/live panel', + QtCore.QVariant(True)).toBool() + + def set_live_visibility(self, visible): + """ + Set the live panel's visibility. + """ + QtCore.QSettings().setValue(u'user interface/live panel', + QtCore.QVariant(visible)) @staticmethod def get_last_dir(section, num=None): diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/theme.py similarity index 99% rename from openlp/core/lib/themexmlhandler.py rename to openlp/core/lib/theme.py index a5b4137ce..3f7b613d4 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/theme.py @@ -79,6 +79,14 @@ BLANK_THEME_XML = \ ''' +class ThemeLevel(object): + """ + Provides an enumeration for the level a theme applies to + """ + Global = 1 + Service = 2 + Song = 3 + class ThemeXML(object): """ A class to encapsulate the Theme XML. @@ -313,7 +321,6 @@ class ThemeXML(object): element.appendChild(value) background.appendChild(element) - def child_element(self, element, tag, value): """ Generic child element creator. @@ -351,14 +358,8 @@ class ThemeXML(object): ``xml`` The XML string to parse. """ - self.base_parse_xml() - self.parse_xml(xml) - - def base_parse_xml(self): - """ - Pull in the blank theme XML as a starting point. - """ self.parse_xml(BLANK_THEME_XML) + self.parse_xml(xml) def parse_xml(self, xml): """ @@ -414,4 +415,3 @@ class ThemeXML(object): if key[0:1] != u'_': theme_strings.append(u'%30s: %s' % (key, getattr(self, key))) return u'\n'.join(theme_strings) - diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index a2979746e..6b87f84fe 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -42,7 +42,7 @@ class OpenLPToolbar(QtGui.QToolBar): """ Initialise the toolbar. """ - QtGui.QToolBar.__init__(self, None) + QtGui.QToolBar.__init__(self, parent) # useful to be able to reuse button icons... self.icons = {} self.setIconSize(QtCore.QSize(20, 20)) diff --git a/openlp/core/lib/xmlrootclass.py b/openlp/core/lib/xmlrootclass.py deleted file mode 100644 index 1ea1d41a2..000000000 --- a/openlp/core/lib/xmlrootclass.py +++ /dev/null @@ -1,104 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 - -############################################################################### -# OpenLP - Open Source Lyrics Projection # -# --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin # -# Thompson, Jon Tibble, Carsten Tinggaard # -# --------------------------------------------------------------------------- # -# This program is free software; you can redistribute it and/or modify it # -# under the terms of the GNU General Public License as published by the Free # -# Software Foundation; version 2 of the License. # -# # -# This program is distributed in the hope that it will be useful, but WITHOUT # -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # -# more details. # -# # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., 59 # -# Temple Place, Suite 330, Boston, MA 02111-1307 USA # -############################################################################### - -import os -import sys - -from xml.etree.ElementTree import ElementTree, XML - -sys.path.append(os.path.abspath(os.path.join(u'.', u'..', u'..'))) - -class XmlRootClass(object): - """ - Root class for themes, songs etc - - This class provides interface for parsing xml files into object attributes. - - If you overload this class and provide a function called `post_tag_hook`, - it will be called thusly for each `tag, value` pair:: - - (element.tag, val) = self.post_tag_hook(element.tag, val) - """ - def _set_from_xml(self, xml, root_tag): - """ - Set song properties from given xml content. - - ``xml`` - Formatted xml tags and values. - ``root_tag`` - The root tag of the xml. - """ - root = ElementTree(element=XML(xml)) - xml_iter = root.getiterator() - for element in xml_iter: - if element.tag != root_tag: - text = element.text - if text is None: - val = text - elif isinstance(text, basestring): - # Strings need special handling to sort the colours out - if text[0] == u'$': - # This might be a hex number, let's try to convert it. - try: - val = int(text[1:], 16) - except ValueError: - pass - else: - # Let's just see if it's a integer. - try: - val = int(text) - except ValueError: - # Ok, it seems to be a string. - val = text - if hasattr(self, u'post_tag_hook'): - (element.tag, val) = \ - self.post_tag_hook(element.tag, val) - setattr(self, element.tag, val) - - def __str__(self): - """ - Return string with all public attributes - - The string is formatted with one attribute per line - If the string is split on newline then the length of the - list is equal to the number of attributes - """ - attributes = [] - for attrib in dir(self): - if not attrib.startswith(u'_'): - attributes.append( - u'%30s : %s' % (attrib, getattr(self, attrib))) - return u'\n'.join(attributes) - - def _get_as_string(self): - """ - Return one string with all public attributes - """ - result = u'' - for attrib in dir(self): - if not attrib.startswith(u'_'): - result += u'_%s_' % getattr(self, attrib) - return result - diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index 6cddbcb45..82e7ac2cc 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -222,4 +222,3 @@ class Theme(object): if key[0:1] != u'_': theme_strings.append(u'%30s : %s' % (key, getattr(self, key))) return u'\n'.join(theme_strings) - diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 2bb202964..a5cd69610 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -596,15 +596,15 @@ class Ui_AmendThemeDialog(object): self.TransitionGroupBox.setObjectName(u'TransitionGroupBox') self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox) self.gridLayout_5.setObjectName(u'gridLayout_5') - self.SlideTransitionCheckedBoxLabel = QtGui.QLabel( + self.SlideTransitionCheckBoxLabel = QtGui.QLabel( self.TransitionGroupBox) - self.SlideTransitionCheckedBoxLabel.setObjectName( - u'SlideTransitionCheckedBoxLabel') + self.SlideTransitionCheckBoxLabel.setObjectName( + u'SlideTransitionCheckBoxLabel') self.gridLayout_5.addWidget( - self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1) - self.SlideTransitionCheckedBox = QtGui.QCheckBox(self.AlignmentGroupBox) - self.SlideTransitionCheckedBox.setTristate(False) - self.gridLayout_5.addWidget(self.SlideTransitionCheckedBox, 0, 1, 1, 1) + self.SlideTransitionCheckBoxLabel, 0, 0, 1, 1) + self.SlideTransitionCheckBox = QtGui.QCheckBox(self.AlignmentGroupBox) + self.SlideTransitionCheckBox.setTristate(False) + self.gridLayout_5.addWidget(self.SlideTransitionCheckBox, 0, 1, 1, 1) self.OptionsRightLayout.addWidget(self.TransitionGroupBox) spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) @@ -864,7 +864,7 @@ class Ui_AmendThemeDialog(object): translate('AmendThemeForm', 'Bottom')) self.TransitionGroupBox.setTitle( translate('AmendThemeForm', 'Slide Transition')) - self.SlideTransitionCheckedBoxLabel.setText( + self.SlideTransitionCheckBoxLabel.setText( translate('AmendThemeForm', 'Transition active:')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.OtherOptionsTab), diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index c85eff4b8..1c2658dc3 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -133,9 +133,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): QtCore.QObject.connect(self.OutlineSpinBox, QtCore.SIGNAL(u'editingFinished()'), self.onOutlineSpinBoxChanged) - QtCore.QObject.connect(self.SlideTransitionCheckedBox, + QtCore.QObject.connect(self.SlideTransitionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onSlideTransitionCheckedBoxChanged) + self.onSlideTransitionCheckBoxChanged) def accept(self): new_theme = ThemeXML() @@ -500,7 +500,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.stateChanging(self.theme) self.previewTheme() - def onSlideTransitionCheckedBoxChanged(self, value): + def onSlideTransitionCheckBoxChanged(self, value): if value == 2: # checked self.theme.display_slideTransition = True else: @@ -624,9 +624,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.ShadowColorPushButton.setEnabled(False) self.ShadowSpinBox.setValue(int(self.theme.display_shadow_size)) if self.theme.display_slideTransition: - self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Checked) + self.SlideTransitionCheckBox.setCheckState(QtCore.Qt.Checked) else: - self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Unchecked) + self.SlideTransitionCheckBox.setCheckState(QtCore.Qt.Unchecked) self.HorizontalComboBox.setCurrentIndex( self.theme.display_horizontalAlign) self.VerticalComboBox.setCurrentIndex(self.theme.display_verticalAlign) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index ae6d400fe..530cd6124 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -25,37 +25,37 @@ import logging import os +import time from PyQt4 import QtCore, QtGui, QtWebKit from PyQt4.phonon import Phonon from openlp.core.lib import Receiver, resize_image from openlp.core.ui import HideMode -from openlp.core.utils import AppLocation log = logging.getLogger(__name__) -HTMLIMAGE = """ - - - - """ - #http://www.steveheffernan.com/html5-video-player/demo-video-player.html HTMLVIDEO = u""" - - \" - - + + + +