From 1cfcdadbd108b5ef69db30f5720eeeaa97737cd5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Jun 2010 01:03:38 +0100 Subject: [PATCH] thememanager tweaks --- openlp/core/ui/thememanager.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 1e4baa72a..f52beade4 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -197,12 +197,12 @@ class ThemeManager(QtGui.QWidget): u'Theme %s is use in %s plugin' % (theme, plugin.name))) return - if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme: - QtGui.QMessageBox.critical( - self, translate(u'ThemeManager',u'Error'), + if unicode(self.parent.ServiceManagerContents.ThemeComboBox \ + .currentText()) == theme: + QtGui.QMessageBox.critical(self, + translate(u'ThemeManager', u'Error'), translate(u'ThemeManager', - u'Theme %s is use by Service Manager' % theme), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) + u'Theme %s is use by Service Manager' % theme)) return self.themelist.remove(theme) th = theme + u'.png' @@ -228,8 +228,7 @@ class ThemeManager(QtGui.QWidget): if item is None: QtGui.QMessageBox.critical(self, translate(u'ThemeManager', u'Error'), - translate(u'ThemeManager', u'You have not selected a theme.'), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) + translate(u'ThemeManager', u'You have not selected a theme.')) return theme = unicode(item.data(QtCore.Qt.UserRole).toString()) path = QtGui.QFileDialog.getExistingDirectory(self, @@ -245,7 +244,8 @@ class ThemeManager(QtGui.QWidget): source = os.path.join(self.path, theme) for files in os.walk(source): for name in files[2]: - zip.write(os.path.join(source, name), + zip.write( + os.path.join(source, name), os.path.join(theme, name)) QtGui.QMessageBox.information(self, translate(u'ThemeManager', u'Theme Exported'), @@ -253,7 +253,7 @@ class ThemeManager(QtGui.QWidget): u'Your theme has been successfully exported.')) except (IOError, OSError): log.exception(u'Export Theme Failed') - QtGui.QMessageBox.information(self, + QtGui.QMessageBox.critical(self, translate(u'ThemeManager', u'Theme Export Failed'), translate(u'ThemeManager', u'Your theme could not be exported due to an error.'))