- fixed a traceback when pressing the delete button in the theme manager when no theme has been selected

- fixed the delete button being hidden/visible although a theme was selected (using the down/up keys)

bzr-revno: 1515
This commit is contained in:
Andreas Preikschat 2011-05-04 07:02:33 +02:00
commit f2ee6ae8eb

View File

@ -127,8 +127,8 @@ class ThemeManager(QtGui.QWidget):
QtCore.QObject.connect(self.themeListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.changeGlobalFromScreen)
QtCore.QObject.connect(self.themeListWidget,
QtCore.SIGNAL(u'itemClicked(QListWidgetItem *)'),
QtCore.QObject.connect(self.themeListWidget, QtCore.SIGNAL(
u'currentItemChanged(QListWidgetItem *, QListWidgetItem *)'),
self.checkListState)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab)
@ -170,6 +170,8 @@ class ThemeManager(QtGui.QWidget):
"""
If Default theme selected remove delete button.
"""
if item is None:
return
realThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
themeName = unicode(item.text())
# If default theme restrict actions
@ -748,7 +750,8 @@ class ThemeManager(QtGui.QWidget):
'Theme %s is used in the %s plugin.')) % \
(theme, plugin.name))
return False
return True
return True
return False
def _migrateVersion122(self, xml_data):
"""
@ -807,3 +810,4 @@ class ThemeManager(QtGui.QWidget):
newtheme.display_horizontal_align = theme.HorizontalAlign
newtheme.display_vertical_align = vAlignCorrection
return newtheme.extract_xml()