From fb8519694ef6a17244dd3d6fc8462d5dd920f290 Mon Sep 17 00:00:00 2001 From: Edwin Lunando Date: Sun, 20 May 2012 21:05:06 +0700 Subject: [PATCH] updated the set_default_header_footer method on lib/theme.py all the works and the import is inside the method. --- openlp/core/lib/theme.py | 7 +++++-- openlp/core/ui/thememanager.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 8b701443a..dc701f6ad 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -36,6 +36,7 @@ from lxml import etree, objectify from openlp.core.lib import str_to_bool + log = logging.getLogger(__name__) BLANK_THEME_XML = \ @@ -444,12 +445,14 @@ class ThemeXML(object): element.appendChild(child) return child - def set_default_header_footer(self, current_screen): + def set_default_header_footer(self): """ Set the header and footer size into the current primary screen """ #10 px border set round display - self.font_main_y = 0; + from openlp.core.ui import ScreenList + current_screen = ScreenList.get_instance().current + self.font_main_y = 0 self.font_main_width = current_screen[u'size'].width() - 20 self.font_main_height = current_screen[u'size'].height() * 9 / 10 self.font_footer_width = current_screen[u'size'].width() - 20 diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 18547042b..f2d313fd7 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -43,7 +43,7 @@ from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \ from openlp.core.lib.ui import UiStrings, critical_error_message_box, \ create_widget_action from openlp.core.theme import Theme -from openlp.core.ui import FileRenameForm, ThemeForm, ScreenList +from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.utils import AppLocation, delete_file, get_filesystem_encoding log = logging.getLogger(__name__) @@ -255,7 +255,7 @@ class ThemeManager(QtGui.QWidget): editing form for the user to make their customisations. """ theme = ThemeXML() - theme.set_default_header_footer(ScreenList.get_instance().current) + theme.set_default_header_footer() self.themeForm.theme = theme self.themeForm.exec_()