summaryrefslogtreecommitdiff
path: root/SoftwareProperties
diff options
context:
space:
mode:
authorSebastian Heinlein <renate@hph4>2006-04-17 16:02:01 +0200
committerSebastian Heinlein <renate@hph4>2006-04-17 16:02:01 +0200
commitb06e74048b8b959e4216e79af759d0d4ad365573 (patch)
tree565196570ae10d30b21cbcbcaa406e8017788e53 /SoftwareProperties
parent9df8fab9dfb94faaf938c9959e743c87a814a88f (diff)
downloadpython-apt-b06e74048b8b959e4216e79af759d0d4ad365573.tar.gz
* remove a source entry if it contains no components
Diffstat (limited to 'SoftwareProperties')
-rw-r--r--SoftwareProperties/dialog_add.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/SoftwareProperties/dialog_add.py b/SoftwareProperties/dialog_add.py
index fbf741c5..b5fbe07f 100644
--- a/SoftwareProperties/dialog_add.py
+++ b/SoftwareProperties/dialog_add.py
@@ -172,13 +172,19 @@ class dialog_add:
self.selected_comps = []
vbox = self.gladexml.get_widget("vbox_comps")
vbox.foreach(self.get_enabled_comps)
+
# check if we are in 'add' or 'edit' mode
if self.source_entry:
# 'edit' - ode
- if not self.custom:
- entry = self._make_source_entry()
- if entry:
- self.sourceslist.list[self.source_entry_index] = entry
+ # check if there are no selected components
+ if len(self.selected_comps) < 1:
+ # remove the source
+ self.sourceslist.remove(self.source_entry)
+ else:
+ if not self.custom:
+ entry = self._make_source_entry()
+ if entry:
+ self.sourceslist.list[self.source_entry_index] = entry
else:
# 'add' mode
self.sourceslist.add(self.selected.type,