Fix theme export breakage and lack of feedback

This commit is contained in:
Jon Tibble 2010-06-10 00:28:02 +01:00
parent 0b1621923a
commit e40cdf792f

View File

@ -243,13 +243,20 @@ class ThemeManager(QtGui.QWidget):
try: try:
zip = zipfile.ZipFile(themePath, u'w') zip = zipfile.ZipFile(themePath, u'w')
source = os.path.join(self.path, theme) source = os.path.join(self.path, theme)
for files in os.walk(source)[2]: for files in os.walk(source):
for name in files: for name in files[2]:
zip.write( zip.write(os.path.join(source, name),
os.path.join(source, name),
os.path.join(theme, 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): except (IOError, OSError):
log.exception(u'Export Theme Failed') 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: finally:
if zip: if zip:
zip.close() zip.close()