summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-04-12 20:21:59 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-04-12 20:21:59 +0200
commit00af0c2e8a7b983a1570e69a1a0696c51a58685b (patch)
treecd309e9b3303a4ae321f7ca77a037c337e26c4b0
parent01c2875f19b40695b75c1014f4d1adc536c081fe (diff)
downloadpython-apt-00af0c2e8a7b983a1570e69a1a0696c51a58685b.tar.gz
* fix disable and "no components selected"
-rw-r--r--SoftwareProperties/dialog_add.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/SoftwareProperties/dialog_add.py b/SoftwareProperties/dialog_add.py
index cee2f9b8..fbf741c5 100644
--- a/SoftwareProperties/dialog_add.py
+++ b/SoftwareProperties/dialog_add.py
@@ -120,7 +120,8 @@ class dialog_add:
# since we're passing the SourceEntry as it is now,
# this SourceEntry needs to be in the sourceslist,
# so temporarily swap the original for the current
- self.sourceslist.list[self.source_entry_index] = source_entry
+ if source_entry:
+ self.sourceslist.list[self.source_entry_index] = source_entry
dialog = dialog_edit.dialog_edit(self.parent, self.sourceslist,
source_entry, self.datadir)
res = dialog.run()
@@ -151,8 +152,13 @@ class dialog_add:
# we use "selected" for pretty much everything *but* we use
# self.source_entry.uri to make sure that the mirror information is
# preserved
+
line = "%s %s %s" % (self.selected.type, self.source_entry.uri, self.selected.dist)
- if len(self.selected_comps) > 0:
+ if self.source_entry.disabled:
+ line = "#" + line
+ if len(self.selected.comps) > 0 and len(self.selected_comps) == 0:
+ line = "#" + line
+ elif len(self.selected_comps) > 0:
line += " " + " ".join(self.selected_comps)
if self.selected.matches(self.source_entry) and self.source_entry.comment != "":
line += " #"+self.source_entry.comment
@@ -170,7 +176,9 @@ class dialog_add:
if self.source_entry:
# 'edit' - ode
if not self.custom:
- self.sourceslist.list[self.source_entry_index] = self._make_source_entry()
+ entry = self._make_source_entry()
+ if entry:
+ self.sourceslist.list[self.source_entry_index] = entry
else:
# 'add' mode
self.sourceslist.add(self.selected.type,