From baf1c792e5cd0de28e868c39103277c1a952f784 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 5 May 2012 14:24:25 +0200 Subject: [PATCH] clean ups --- openlp/core/lib/dockwidget.py | 3 +-- openlp/core/lib/renderer.py | 2 +- openlp/core/lib/serviceitem.py | 17 ++++++----------- openlp/core/ui/servicemanager.py | 3 +-- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/openlp/core/lib/dockwidget.py b/openlp/core/lib/dockwidget.py index 4f74784ad..e08b5eee5 100644 --- a/openlp/core/lib/dockwidget.py +++ b/openlp/core/lib/dockwidget.py @@ -53,8 +53,7 @@ class OpenLPDockWidget(QtGui.QDockWidget): self.setWindowIcon(build_icon(icon)) # Sort out the minimum width. screens = ScreenList.get_instance() - screen_width = screens.current[u'size'].width() - mainwindow_docbars = screen_width / 5 + mainwindow_docbars = screens.current[u'size'].width() / 5 if mainwindow_docbars > 300: self.setMinimumWidth(300) else: diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 2c9d2a5d1..32ea0fb90 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -125,7 +125,7 @@ class Renderer(object): Set the appropriate theme depending on the theme level. Called by the service item when building a display frame - ``theme`` + ``override_theme`` The name of the song-level theme. None means the service item wants to use the given value. diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index c8fbe6d8a..36314ac7f 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -313,17 +313,12 @@ class ServiceItem(object): self.from_plugin = header[u'from_plugin'] self.capabilities = header[u'capabilities'] # Added later so may not be present in older services. - if u'search' in header: - self.search_string = header[u'search'] - self.data_string = header[u'data'] - if u'xml_version' in header: - self.xml_version = header[u'xml_version'] - if u'start_time' in header: - self.start_time = header[u'start_time'] - if u'end_time' in header: - self.end_time = header[u'end_time'] - if u'media_length' in header: - self.media_length = header[u'media_length'] + self.search_string = header.get(u'search', u'') + self.data_string = header.get(u'data', u'') + self.xml_version = header.get(u'xml_version') + self.start_time = header.get(u'start_time', 0) + self.end_time = header.get(u'end_time', 0) + self.media_length = header.get(u'media_length', 0) if u'background_audio' in header: self.background_audio = [] for filename in header[u'background_audio']: diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index c9dfeae50..4fa36cc2f 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -51,7 +51,7 @@ class ServiceManagerList(QtGui.QTreeWidget): """ Set up key bindings and mouse behaviour for the service list """ - def __init__(self, serviceManager, parent=None, name=None): + def __init__(self, serviceManager, parent=None): QtGui.QTreeWidget.__init__(self, parent) self.serviceManager = serviceManager @@ -101,7 +101,6 @@ class ServiceManager(QtGui.QWidget): QtGui.QWidget.__init__(self, parent) self.mainwindow = mainwindow self.serviceItems = [] - self.serviceName = u'' self.suffixes = [] self.dropPosition = 0 self.expandTabs = False