From baf6630e1531c73128aba1625c8758b0836b9028 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 22 Jul 2006 16:39:12 +0200 Subject: * also handle multiple repositories of a child source --- SoftwareProperties/SoftwareProperties.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'SoftwareProperties') diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index f9af3a58..60a0208a 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -255,20 +255,25 @@ class SoftwareProperties(SimpleGladeApp): self.vbox_updates.remove(checkbutton) for template in self.distro.source_template.children: checkbox = gtk.CheckButton(label=template.description) + comps = [] for child in self.distro.child_sources: if child.template == template: - # check if all comps of the main source are also enabled - # for the child source - if len(set(child.comps) - self.distro.enabled_comps) == 0: - checkbox.set_active(True) - else: - checkbox.set_active(False) - if len(self.distro.enabled_comps ^ set(child.comps)) > 0: - checkbox.set_inconsistent(True) - checkbox.set_active(False) - #FIXME: currently we don't handle multiple sources of the same - # child source - the required effort would be questionable - break + comps.extend(child.comps) + # check if all comps of the main source are also enabled + # for the corresponding child sources + if len(comps) > 0 and \ + len(self.distro.enabled_comps ^ set(comps)) == 0: + # the cild source covers all components + checkbox.set_active(True) + elif len(comps) > 0 and\ + len(self.distro.enabled_comps ^ set(comps)) != 0: + # the cild is enabled, but doesn't cover + # all components + checkbox.set_active(False) + checkbox.set_inconsistent(True) + else: + # there is no corresponding child source at all + checkbox.set_active(False) # setup the callback and show the checkbutton checkbox.connect("toggled", self.on_checkbutton_child_toggled, template) -- cgit v1.2.3