forked from openlp/openlp
commit
bd514c2994
@ -526,13 +526,11 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
zip = zipfile.ZipFile(filename)
|
zip = zipfile.ZipFile(filename)
|
||||||
themename = None
|
themename = None
|
||||||
for file in zip.namelist():
|
for file in zip.namelist():
|
||||||
|
# Handle UTF-8 files
|
||||||
ucsfile = file_is_unicode(file)
|
ucsfile = file_is_unicode(file)
|
||||||
if not ucsfile:
|
if not ucsfile:
|
||||||
critical_error_message_box(
|
# Handle native Unicode files from Windows
|
||||||
message=translate('OpenLP.ThemeManager',
|
ucsfile = file
|
||||||
'File is not a valid theme.\n'
|
|
||||||
'The content encoding is not UTF-8.'))
|
|
||||||
continue
|
|
||||||
osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile))
|
osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile))
|
||||||
theme_dir = None
|
theme_dir = None
|
||||||
if osfile.endswith(os.path.sep):
|
if osfile.endswith(os.path.sep):
|
||||||
@ -620,7 +618,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
name = theme.theme_name
|
name = theme.theme_name
|
||||||
theme_pretty_xml = theme.extract_formatted_xml()
|
theme_pretty_xml = theme.extract_formatted_xml()
|
||||||
log.debug(u'saveTheme %s %s', name, theme_pretty_xml)
|
log.debug(u'saveTheme %s %s', name, theme_pretty_xml.decode(u'utf-8'))
|
||||||
theme_dir = os.path.join(self.path, name)
|
theme_dir = os.path.join(self.path, name)
|
||||||
check_directory_exists(theme_dir)
|
check_directory_exists(theme_dir)
|
||||||
theme_file = os.path.join(theme_dir, name + u'.xml')
|
theme_file = os.path.join(theme_dir, name + u'.xml')
|
||||||
|
Loading…
Reference in New Issue
Block a user