class CollectionListItem(QtGui.QWidget): def __init__(self, parent, item, collection): QtGui.QWidget.__init__(self, parent) self.ui = Ui_AutoInstallationListItemWidget() self.ui.setupUi(self) self.collection = collection self.parent = parent self.item = item self.ui.labelName.setText(collection.title) self.ui.labelDesc.setText(collection.description) self.ui.labelIcon.setPixmap(QtGui.QPixmap(collection.icon)) self.connect(self.ui.checkBox, SIGNAL("stateChanged(int)"), self.slotSelectCollection) def setChecked(self, state): self.ui.checkBox.setCheckState(state) def isChecked(self): return self.ui.checkBox.isChecked() def setKernelType(self): isPAEKernelAvailable = None if self.parent.ui.kernelTypeGroupBox.isVisible(): isPAEKernelAvailable = yali4.pisiiface.getNeededKernel(paeKernel, self.collection.index) if isPAEKernelAvailable: self.parent.ui.kernelTypeGroupBox.setEnabled(True) else: self.parent.ui.kernelTypeGroupBox.setEnabled(False) def slotSelectCollection(self, state): if state == Qt.Checked and self.parent.currentChoice != self: if self.parent.currentChoice: self.parent.currentChoice.setChecked(Qt.Unchecked) self.parent.previousChoice = self.parent.currentChoice self.parent.currentChoice = self elif state == Qt.Unchecked and self.parent.currentChoice == self: self.parent.currentChoice = None self.setKernelType() self.parent.update()
def __init__(self, parent, item, collection): QtGui.QWidget.__init__(self, parent) self.ui = Ui_AutoInstallationListItemWidget() self.ui.setupUi(self) self.collection = collection self.parent = parent self.item = item self.ui.labelName.setText(collection.title) self.ui.labelDesc.setText(collection.description) self.ui.labelIcon.setPixmap(QtGui.QPixmap(collection.icon)) self.connect(self.ui.checkBox, SIGNAL("stateChanged(int)"), self.slotSelectCollection)
def __init__(self, collection, parent, item): QtGui.QWidget.__init__(self, parent) self.ui = Ui_AutoInstallationListItemWidget() self.ui.setupUi(self) self.collection = collection self.parent = parent self.item = item self.ui.labelName.setText(collection.title) self.ui.labelDesc.setText(collection.description.content) self.ui.labelIcon.setPixmap(QtGui.QPixmap(collection.icon)) self.connect(self.ui.checkToggler, SIGNAL("clicked()"), self.slotToggleCollection)
class CollectionListItem(QtGui.QWidget): def __init__(self, collection, parent, item): QtGui.QWidget.__init__(self, parent) self.ui = Ui_AutoInstallationListItemWidget() self.ui.setupUi(self) self.collection = collection self.parent = parent self.item = item self.ui.labelName.setText(collection.title) self.ui.labelDesc.setText(collection.description.content) self.ui.labelIcon.setPixmap(QtGui.QPixmap(collection.icon)) self.connect(self.ui.checkToggler, SIGNAL("clicked()"), self.slotToggleCollection) def slotToggleCollection(self): if self.ui.checkToggler.isChecked(): self.parent.selectedCollection = self.collection self.parent.lastChoice = self.item self.parent.isManualInstallation = True ctx.debugger.log("Manual Install selected Packages from %s Collection as %s" % (self.collection.uniqueTag, self.collection.title))