Merge lp:~meths/openlp/testing into lp:openlp

Proposed by Jon Tibble
Status: Merged
Merged at revision: not available
Proposed branch: lp:~meths/openlp/testing
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~meths/openlp/testing
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Raoul Snyman Approve
Review via email: mp+11665@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jon Tibble (meths) wrote :

Fix theme handling

Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve
Revision history for this message
Tim Bentley (trb143) wrote :

Approved

review: Approve
lp:~meths/openlp/testing updated
534. By Jon Tibble

For Jon
Fix themes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2009-09-12 17:24:16 +0000
+++ openlp/core/ui/thememanager.py 2009-09-13 13:24:58 +0000
@@ -33,9 +33,8 @@
3333
34from openlp.core.ui import AmendThemeForm, ServiceManager34from openlp.core.ui import AmendThemeForm, ServiceManager
35from openlp.core.theme import Theme35from openlp.core.theme import Theme
36from openlp.core.lib import PluginConfig, \36from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, Renderer, \
37 OpenLPToolbar, ThemeXML, Renderer, translate, \37 translate, str_to_bool, file_to_xml, buildIcon, Receiver
38 file_to_xml, buildIcon, Receiver
39from openlp.core.utils import ConfigHelper38from openlp.core.utils import ConfigHelper
4039
41class ThemeManager(QtGui.QWidget):40class ThemeManager(QtGui.QWidget):
@@ -230,21 +229,25 @@
230229
231 def getThemeData(self, themename):230 def getThemeData(self, themename):
232 log.debug(u'getthemedata for theme %s', themename)231 log.debug(u'getthemedata for theme %s', themename)
233 xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml')232 xml_file = os.path.join(self.path, unicode(themename),
233 unicode(themename) + u'.xml')
234 try:234 try:
235 xml = file_to_xml(xml_file)235 xml = file_to_xml(xml_file)
236 except:236 except:
237 newtheme = ThemeXML()237 newtheme = ThemeXML()
238 newtheme.new_document(u'New Theme')238 newtheme.new_document(u'New Theme')
239 newtheme.add_background_solid(unicode(u'#000000'))239 newtheme.add_background_solid(unicode(u'#000000'))
240 newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False')240 newtheme.add_font(unicode(QtGui.QFont().family()),
241 newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')241 unicode(u'#FFFFFF'), unicode(30), u'False')
242 newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', unicode(u'#FFFFFF'),242 newtheme.add_font(unicode(QtGui.QFont().family()),
243 unicode(0), unicode(0), unicode(0))243 unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
244 newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
245 unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0))
244 xml = newtheme.extract_xml()246 xml = newtheme.extract_xml()
245 theme = ThemeXML()247 theme = ThemeXML()
246 theme.parse(xml)248 theme.parse(xml)
247 theme.extend_image_filename(self.path)249 theme.extend_image_filename(self.path)
250 self.cleanTheme(theme)
248 return theme251 return theme
249252
250 def checkThemesExists(self, dir):253 def checkThemesExists(self, dir):