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
1=== modified file 'openlp/core/ui/thememanager.py'
2--- openlp/core/ui/thememanager.py 2009-09-12 17:24:16 +0000
3+++ openlp/core/ui/thememanager.py 2009-09-13 13:24:58 +0000
4@@ -33,9 +33,8 @@
5
6 from openlp.core.ui import AmendThemeForm, ServiceManager
7 from openlp.core.theme import Theme
8-from openlp.core.lib import PluginConfig, \
9- OpenLPToolbar, ThemeXML, Renderer, translate, \
10- file_to_xml, buildIcon, Receiver
11+from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, Renderer, \
12+ translate, str_to_bool, file_to_xml, buildIcon, Receiver
13 from openlp.core.utils import ConfigHelper
14
15 class ThemeManager(QtGui.QWidget):
16@@ -230,21 +229,25 @@
17
18 def getThemeData(self, themename):
19 log.debug(u'getthemedata for theme %s', themename)
20- xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml')
21+ xml_file = os.path.join(self.path, unicode(themename),
22+ unicode(themename) + u'.xml')
23 try:
24 xml = file_to_xml(xml_file)
25 except:
26 newtheme = ThemeXML()
27 newtheme.new_document(u'New Theme')
28 newtheme.add_background_solid(unicode(u'#000000'))
29- newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False')
30- newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
31- newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', unicode(u'#FFFFFF'),
32- unicode(0), unicode(0), unicode(0))
33+ newtheme.add_font(unicode(QtGui.QFont().family()),
34+ unicode(u'#FFFFFF'), unicode(30), u'False')
35+ newtheme.add_font(unicode(QtGui.QFont().family()),
36+ unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
37+ newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
38+ unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0))
39 xml = newtheme.extract_xml()
40 theme = ThemeXML()
41 theme.parse(xml)
42 theme.extend_image_filename(self.path)
43+ self.cleanTheme(theme)
44 return theme
45
46 def checkThemesExists(self, dir):