Fix up theme popups

bzr-revno: 1273
This commit is contained in:
Tim Bentley 2011-02-05 20:10:25 +00:00
commit bb31adfc6e

View File

@ -260,7 +260,7 @@ class ThemeManager(QtGui.QWidget):
'You must select a theme to rename.')), 'You must select a theme to rename.')),
unicode(translate('OpenLP.ThemeManager', 'Rename Confirmation')), unicode(translate('OpenLP.ThemeManager', 'Rename Confirmation')),
unicode(translate('OpenLP.ThemeManager', 'Rename %s theme?')), unicode(translate('OpenLP.ThemeManager', 'Rename %s theme?')),
False): False, False):
item = self.themeListWidget.currentItem() item = self.themeListWidget.currentItem()
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
self.fileRenameForm.fileNameEdit.setText(oldThemeName) self.fileRenameForm.fileNameEdit.setText(oldThemeName)
@ -676,7 +676,7 @@ class ThemeManager(QtGui.QWidget):
return theme return theme
def _validate_theme_action(self, select_text, confirm_title, confirm_text, def _validate_theme_action(self, select_text, confirm_title, confirm_text,
testPlugin=True): testPlugin=True, confirm=True):
""" """
Check to see if theme has been selected and the destructive action Check to see if theme has been selected and the destructive action
is allowed. is allowed.
@ -688,6 +688,7 @@ class ThemeManager(QtGui.QWidget):
item = self.themeListWidget.currentItem() item = self.themeListWidget.currentItem()
theme = unicode(item.text()) theme = unicode(item.text())
# confirm deletion # confirm deletion
if confirm:
answer = QtGui.QMessageBox.question(self, confirm_title, answer = QtGui.QMessageBox.question(self, confirm_title,
confirm_text % theme, QtGui.QMessageBox.StandardButtons( confirm_text % theme, QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),