From e40cdf792f9064f954a796a7c5bc794c8ab6649f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Jun 2010 00:28:02 +0100 Subject: [PATCH] Fix theme export breakage and lack of feedback --- openlp/core/ui/thememanager.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 85cf0f069..1e4baa72a 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -243,13 +243,20 @@ class ThemeManager(QtGui.QWidget): try: zip = zipfile.ZipFile(themePath, u'w') source = os.path.join(self.path, theme) - for files in os.walk(source)[2]: - for name in files: - zip.write( - os.path.join(source, name), + for files in os.walk(source): + for name in files[2]: + zip.write(os.path.join(source, name), os.path.join(theme, name)) + QtGui.QMessageBox.information(self, + translate(u'ThemeManager', u'Theme Exported'), + translate(u'ThemeManager', + u'Your theme has been successfully exported.')) except (IOError, OSError): log.exception(u'Export Theme Failed') + QtGui.QMessageBox.information(self, + translate(u'ThemeManager', u'Theme Export Failed'), + translate(u'ThemeManager', + u'Your theme could not be exported due to an error.')) finally: if zip: zip.close()