thememanager tweaks

This commit is contained in:
Jon Tibble 2010-06-10 01:03:38 +01:00
parent e40cdf792f
commit 1cfcdadbd1

View File

@ -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.'))