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