← Back to team overview

openlp-core team mailing list archive

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

 

Jon Tibble has proposed merging lp:~meths/openlp/testing into lp:openlp.

Requested reviews:
    Raoul Snyman (raoul-snyman)

Fix theme handling
-- 
https://code.launchpad.net/~meths/openlp/testing/+merge/11665
Your team openlp.org Core is subscribed to branch lp:openlp.
=== 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 @@
 
 from openlp.core.ui import AmendThemeForm, ServiceManager
 from openlp.core.theme import Theme
-from openlp.core.lib import PluginConfig,  \
-    OpenLPToolbar, ThemeXML, Renderer, translate, \
-    file_to_xml, buildIcon,  Receiver
+from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, Renderer, \
+        translate, str_to_bool, file_to_xml, buildIcon, Receiver
 from openlp.core.utils import ConfigHelper
 
 class ThemeManager(QtGui.QWidget):
@@ -230,21 +229,25 @@
 
     def getThemeData(self, themename):
         log.debug(u'getthemedata for theme %s', themename)
-        xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml')
+        xml_file = os.path.join(self.path, unicode(themename),
+            unicode(themename) + u'.xml')
         try:
             xml = file_to_xml(xml_file)
         except:
             newtheme = ThemeXML()
             newtheme.new_document(u'New Theme')
             newtheme.add_background_solid(unicode(u'#000000'))
-            newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False')
-            newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
-            newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', unicode(u'#FFFFFF'),
-                unicode(0), unicode(0), unicode(0))
+            newtheme.add_font(unicode(QtGui.QFont().family()),
+                unicode(u'#FFFFFF'), unicode(30), u'False')
+            newtheme.add_font(unicode(QtGui.QFont().family()),
+                unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
+            newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
+                unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0))
             xml = newtheme.extract_xml()
         theme = ThemeXML()
         theme.parse(xml)
         theme.extend_image_filename(self.path)
+        self.cleanTheme(theme)
         return theme
 
     def checkThemesExists(self, dir):


References