forked from openlp/openlp
A unicode fix for themes
This commit is contained in:
parent
b100731dc4
commit
a821179a63
@ -30,7 +30,7 @@ from xml.etree.ElementTree import ElementTree, XML
|
||||
from openlp.core.lib import str_to_bool
|
||||
|
||||
blankthemexml=\
|
||||
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
'''<?xml version="1.0" encoding="utf-8"?>
|
||||
<theme version="1.0">
|
||||
<name>BlankStyle</name>
|
||||
<background mode="transparent"/>
|
||||
@ -348,6 +348,7 @@ class ThemeXML(object):
|
||||
iter = theme_xml.getiterator()
|
||||
master = u''
|
||||
for element in iter:
|
||||
element.text = unicode(element.text).decode('unicode-escape')
|
||||
if len(element.getchildren()) > 0:
|
||||
master = element.tag + u'_'
|
||||
else:
|
||||
|
@ -126,7 +126,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||
def accept(self):
|
||||
new_theme = ThemeXML()
|
||||
theme_name = unicode(self.ThemeNameEdit.displayText())
|
||||
new_theme.new_document(theme_name)
|
||||
new_theme.new_document(theme_name.encode('unicode-escape'))
|
||||
save_from = None
|
||||
save_to = None
|
||||
if self.theme.background_mode == u'transparent':
|
||||
@ -144,7 +144,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||
(path, filename) = \
|
||||
os.path.split(unicode(self.theme.background_filename))
|
||||
new_theme.add_background_image(filename)
|
||||
save_to= os.path.join(self.path, theme_name, filename )
|
||||
save_to = os.path.join(self.path, theme_name, filename)
|
||||
save_from = self.theme.background_filename
|
||||
|
||||
new_theme.add_font(unicode(self.theme.font_main_name),
|
||||
|
@ -676,7 +676,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.setWindowTitle(title)
|
||||
|
||||
def defaultThemeChanged(self, theme):
|
||||
self.DefaultThemeLabel.setText(self.defaultThemeText + theme)
|
||||
self.DefaultThemeLabel.setText(
|
||||
u'%s %s' % (self.defaultThemeText, theme))
|
||||
|
||||
def toggleMediaManager(self, visible):
|
||||
if self.MediaManagerDock.isVisible() != visible:
|
||||
|
Loading…
Reference in New Issue
Block a user