diff options
author | Erik Troan <ewt@redhat.com> | 2000-05-26 15:29:16 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2000-05-26 15:29:16 +0000 |
commit | 2aa1d14296098f460b7aa8bb03024fa0e2826423 (patch) | |
tree | bdaed968763d93a11c22abc4d8f9688567ba567a /iw/package_gui.py | |
parent | c9c1348c53f82eb33c43b5d374b558b10cc667d4 (diff) | |
download | anaconda-2aa1d14296098f460b7aa8bb03024fa0e2826423.tar.gz anaconda-2aa1d14296098f460b7aa8bb03024fa0e2826423.tar.xz anaconda-2aa1d14296098f460b7aa8bb03024fa0e2826423.zip |
reworked package selection mechanism
Diffstat (limited to 'iw/package_gui.py')
-rw-r--r-- | iw/package_gui.py | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/iw/package_gui.py b/iw/package_gui.py index c7339ad63..1441a4ed5 100644 --- a/iw/package_gui.py +++ b/iw/package_gui.py @@ -186,7 +186,7 @@ class IndividualPackageSelectionWindow (InstallWindow): # drop the leading slash off the package namespace for header in self.flat_groups[ctree.node_get_row_data (node)[1:]]: - if header.selected: + if header.isSelected(): packageIcon = self.packageSelectedImage self.cbutton.set_active (TRUE) else: @@ -210,23 +210,23 @@ class IndividualPackageSelectionWindow (InstallWindow): def installButtonToggled (self, cbutton, *args): if not self.currentPackage: return - oldSelectedStatus = self.currentPackage.selected + oldSelectedStatus = self.currentPackage.isSelected() if cbutton.get_active (): - self.currentPackage.selected = 1 + self.currentPackage.select() else: - self.currentPackage.selected = 0 + self.currentPackage.unselect() self.updateSize() - if oldSelectedStatus != self.currentPackage.selected: + if oldSelectedStatus != self.currentPackage.isSelected(): self.updatingIcons = TRUE self.ctree.select (self.ctree.selection[0]) self.iconList.select_icon (self.currentPackagePos) self.updatingIcons = FALSE # self.iconList.freeze () -# if self.currentPackage.selected: +# if self.currentPackage.isSelected() # packageIcon = "/home/devel/pnfisher/gnome-package-checked.png" # else: # packageIcon = "/usr/src/gnorpm/gnome-package.xpm" @@ -268,7 +268,7 @@ class IndividualPackageSelectionWindow (InstallWindow): if not groups.has_key (header[rpm.RPMTAG_GROUP]): groups[header[rpm.RPMTAG_GROUP]] = [] # don't display package if it is in the Base group - if not self.todo.comps["Base"].items.has_key (header): + if not self.todo.comps["Base"].includesPackage (header): groups[header[rpm.RPMTAG_GROUP]].append (header) keys = groups.keys () @@ -413,19 +413,12 @@ class PackageSelectionWindow (InstallWindow): def setSize(self): self.sizelabel.set_text (_("Total install size: %s") % self.todo.comps.sizeStr()) - def componentToggled(self, widget): - # turn off all the comps - for comp in self.todo.comps: - if not comp.hidden: comp.unselect(0) - - # it's a shame component selection sucks -# self.todo.comps['Base'].select (1) - self.todo.updateInstClassComps() - + def componentToggled(self, widget, comp): # turn on all the comps we selected - for (button, comp) in self.checkButtons: - if button.get_active (): - comp.select (1) + if widget.get_active (): + comp.select () + else: + comp.unselect () self.setSize() @@ -479,8 +472,8 @@ class PackageSelectionWindow (InstallWindow): else: checkButton = GtkCheckButton (comp.name) - checkButton.set_active (comp.selected) - checkButton.connect('toggled', self.componentToggled) + checkButton.set_active (comp.isSelected()) + checkButton.connect('toggled', self.componentToggled, comp) self.checkButtons.append ((checkButton, comp)) box.pack_start (checkButton) |