ListWidget usability improvement

bzr-revno: 886
This commit is contained in:
andreas 2010-06-25 19:38:16 +01:00 committed by Jon Tibble
commit 5135706761

View File

@ -74,8 +74,12 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog):
item_name = QtGui.QListWidgetItem(frame[u'title']) item_name = QtGui.QListWidgetItem(frame[u'title'])
self.listWidget.addItem(item_name) self.listWidget.addItem(item_name)
if self.listWidget.count() == 1: if self.listWidget.count() == 1:
self.downButton.setEnabled(False)
self.upButton.setEnabled(False)
self.deleteButton.setEnabled(False) self.deleteButton.setEnabled(False)
else: else:
self.downButton.setEnabled(True)
self.upButton.setEnabled(True)
self.deleteButton.setEnabled(True) self.deleteButton.setEnabled(True)
def onItemDelete(self): def onItemDelete(self):