From 0d18962ad55ef1fd31974e46a65fd2fffb4a9baa Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Wed, 28 Jun 2006 20:58:26 +0200 Subject: * start merging my old repo rewrite stuff --- SoftwareProperties/aptsources.py | 234 +++++++++++++-------------------------- UpdateManager/Common/DistInfo.py | 69 ++++++++---- channels/Ubuntu.info.in | 152 +++++++++++++++++++++++-- 3 files changed, 270 insertions(+), 185 deletions(-) diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 74ef2f4a..5735960b 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -89,6 +89,7 @@ class SourceEntry: file = apt_pkg.Config.FindDir("Dir::Etc")+apt_pkg.Config.Find("Dir::Etc::sourcelist") self.file = file self.parse(line) + self.template = None # works mostely like split but takes [] into account def mysplit(self, line): @@ -207,6 +208,7 @@ class SourceEntry: class SourcesList: def __init__(self): self.list = [] # of Type SourceEntries + self.matcher = SourceEntryMatcher() self.refresh() def refresh(self): @@ -219,6 +221,10 @@ class SourcesList: partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts") for file in glob.glob("%s/*.list" % partsdir): self.load(file) + # check if the source item fits a predefined template + for source in self.list: + if source.invalid == False: + self.matcher.match(source) def __iter__(self): for entry in self.list: @@ -241,7 +247,9 @@ class SourcesList: if comment != "": line = "%s #%s\n" %(line,comment) line = line + "\n" - self.list.insert(pos, SourceEntry(line)) + new_entry = SourceEntry(line) + self.matcher.match(new_entry) + self.list.insert(pos, new_entry) def remove(self, source_entry): self.list.remove(source_entry) @@ -271,12 +279,16 @@ class SourcesList: def load(self,file): """ (re)load the current sources """ - f = open(file, "r") - lines = f.readlines() - for line in lines: - source = SourceEntry(line,file) - self.list.append(source) - f.close() + try: + f = open(file, "r") + lines = f.readlines() + for line in lines: + source = SourceEntry(line,file) + self.list.append(source) + except: + print "could not open file '%s'" % file + else: + f.close() def save(self): """ save the current sources """ @@ -288,6 +300,41 @@ class SourcesList: for f in files: files[f].close() + def check_for_relations(self, sources_list): + """get all parent and child channels in the sources list""" + parents = [] + used_child_templates = {} + for source in sources_list: + # try to avoid checking uninterressting sources + if source.template == None: + continue + # set up a dict with all used child templates and corresponding + # source entries + if source.template.child == True: + key = source.template + if not used_child_templates.has_key(key): + used_child_templates[key] = [] + temp = used_child_templates[key] + temp.append(source) + else: + # store each source with children aka. a parent :) + if len(source.template.children) > 0: + parents.append(source) + #print self.used_child_templates + #print self.parents + return (parents, used_child_templates) + + def check_for_endangered_dists(self): + """set the components of a child source to the ones of the parent channel""" + (parents, used_child_templates) = self.check_for_relations(self.list) + # the magical part + for mother in parents: + for child_template in mother.template.children: + if used_child_templates.has_key(child_template): + for child in used_child_templates[child_template]: + if child.type == mother.type: + child.comps = mother.comps + # templates for the add dialog class SourceEntryTemplate(SourceEntry): def __init__(self,a_type,uri,dist,description,comps): @@ -354,121 +401,20 @@ class SourceEntryMatcher: self.comps_descriptions = l_comps_descr def __init__(self): - _ = gettext.gettext - self.type_list = [] - self.type_list.append(self.MatchType("^deb$",_("Binary"))) - self.type_list.append(self.MatchType("^deb-src$",_("Source"))) - - self.dist_list = [] - - ubuntu_comps = ["^main$","^restricted$","^universe$","^multiverse$"] - ubuntu_comps_descr = [_("Officially supported"), - _("Restricted copyright"), - _("Community maintained (Universe)"), - _("Non-free (Multiverse)")] - # CDs - self.dist_list.append(self.MatchDist("cdrom:\[Ubuntu.*6.06", - ".*", - _("CD disk with Ubuntu 6.06 LTS"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist("cdrom:\[Ubuntu.*5.10", - ".*", - _("CD disk with Ubuntu 5.10"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist("cdrom:\[Ubuntu.*5.04", - ".*", - _("CD disk with Ubuntu 5.04"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist("cdrom:\[Ubuntu.*4.10", - ".*", - _("CD disk with Ubuntu 4.10"), - ubuntu_comps, ubuntu_comps_descr)) - # URIs - # Warty - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^warty$", - "Ubuntu 4.10", - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*security.ubuntu.com/ubuntu", - "^warty-security$", - _("Ubuntu 4.10 Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^warty-security$", - _("Ubuntu 4.10 Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^warty-updates$", - _("Ubuntu 4.10 Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^warty-backports$", - _("Ubuntu 4.10 Backports"), - ubuntu_comps, ubuntu_comps_descr)) - # Hoary - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^hoary-security$", - _("Ubuntu 5.04 Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*security.ubuntu.com/ubuntu", - "^hoary-security$", - _("Ubuntu 5.04 Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^hoary$", - "Ubuntu 5.04", - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^hoary-updates$", - _("Ubuntu 5.04 Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^hoary-backports$", - _("Ubuntu 5.04 Backports"), - ubuntu_comps, ubuntu_comps_descr)) - # Breezy - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^breezy-security$", - _("Ubuntu 5.10 Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*security.ubuntu.com/ubuntu", - "^breezy-security$", - _("Ubuntu 5.10 Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^breezy$", - "Ubuntu 5.10", - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^breezy-backports$", - _("Ubuntu 5.10 Backports"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^breezy-updates$", - _("Ubuntu 5.10 Updates"), - ubuntu_comps, ubuntu_comps_descr)) - # dapper - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^dapper-security$", - _("Ubuntu 6.06 LTS Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*security.ubuntu.com/ubuntu", - "^dapper-security$", - _("Ubuntu 6.06 LTS Security Updates"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^dapper$", - "Ubuntu 6.06 LTS", - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^dapper-backports$", - _("Ubuntu 6.06 LTS Backports"), - ubuntu_comps, ubuntu_comps_descr)) - self.dist_list.append(self.MatchDist(".*archive.ubuntu.com/ubuntu", - "^dapper-updates$", - _("Ubuntu 6.06 LTS Updates"), - ubuntu_comps, ubuntu_comps_descr)) - + self.templates = [] + # Get the human readable channel and comp names from the channel .infos + spec_files = glob.glob("/usr/share/update-manager/channels/*.info") + for f in spec_files: + f = os.path.basename(f) + i = f.find(".info") + f = f[0:i] + dist = DistInfo(f) + for suite in dist.suites: + if suite.match_uri != None: + self.templates.append(suite) + + # FIXME: The specifications should go into the .info files + return # DEBIAN debian_comps = ["^main$","^contrib$","^non-free$","^non-US$"] @@ -518,43 +464,21 @@ class SourceEntryMatcher: self.dist_list.append(self.MatchDist(".*debian.org/debian-non-US", "^unstable.*$", _("Debian Non-US (Unstable)"), - debian_comps, debian_comps_descr)) + debian_comps, debian_comps_descr, + SOURCE_SYSTEM)) - - - - def match(self,source): + def match(self, source): + """Add a matching template to the source""" _ = gettext.gettext - # some sane defaults first - type_description = source.type - dist_description = source.uri + " " + source.dist - comp_description = "" - for c in source.comps: - comp_description = comp_description + " " + c - - for t in self.type_list: - if re.match(t.type, source.type): - type_description = _(t.description) - break - - for d in self.dist_list: + found = False + for template in self.templates: #print "'%s'" %source.uri - if re.match(d.uri, source.uri) and re.match(d.dist,source.dist): - dist_description = d.description - comp_description = "" - for c in source.comps: - found = False - for i in range(len(d.comps)): - if re.match(d.comps[i], c): - comp_description = comp_description+"\n"+d.comps_descriptions[i] - found = True - if found == False: - comp_description = comp_description+" "+c + if re.search(template.match_uri, source.uri) and \ + re.match(template.match_name, source.dist): + found = True + source.template = template break - - - return (type_description,dist_description,comp_description) - + return found # some simple tests if __name__ == "__main__": diff --git a/UpdateManager/Common/DistInfo.py b/UpdateManager/Common/DistInfo.py index 102b981c..873d7132 100644 --- a/UpdateManager/Common/DistInfo.py +++ b/UpdateManager/Common/DistInfo.py @@ -28,21 +28,29 @@ import ConfigParser _ = gettext.gettext class Suite: - name = None - description = None - base_uri = None - repository_type = None - components = None + def __init__(self): + self.name = None + self.child = False + self.match_name = None + self.description = None + self.base_uri = None + self.type = None + self.components = {} + self.children = [] + self.match_uri = None + self.distribution = None + self.available = True class Component: - name = None - description = None - enabled = None + def __init__(self): + self.name = None + self.description = None + self.enabled = None class DistInfo: def __init__(self, dist = None, - base_dir = "/usr/share/update-manager/dists"): + base_dir = "/usr/share/update-manager/channels"): self.metarelease_uri = '' self.suites = [] @@ -73,21 +81,36 @@ class DistInfo: elif field == 'Suite': if suite: if component: - suite.components.append (component) + suite.components["%s" % component.name] = \ + (component.description, component.enabled) component = None self.suites.append (suite) suite = Suite () suite.name = value - suite.components = [] + suite.distribution = dist + suite.match_name = "^%s$" % value + elif field == 'MatchName': + suite.match_name = value + elif field == 'ParentSuite': + suite.child = True + for nanny in self.suites: + if nanny.name == value: + nanny.children.append(suite) + elif field == 'Available': + suite.available = value elif field == 'RepositoryType': - suite.repository_type = value + suite.type = value elif field == 'BaseURI': suite.base_uri = value + suite.match_uri = value + elif field == 'MatchURI': + suite.match_uri = value elif field == 'Description': suite.description = _(value) elif field == 'Component': if component: - suite.components.append (component) + suite.components["%s" % component.name] = \ + (component.description, component.enabled) component = Component () component.name = value elif field == 'Enabled': @@ -96,20 +119,24 @@ class DistInfo: component.description = _(value) if suite: if component: - suite.components.append (component) + suite.components["%s" % component.name] = \ + (component.description, component.enabled) component = None self.suites.append (suite) suite = None if __name__ == "__main__": - d = DistInfo ("Debian", "../../channels") + d = DistInfo ("Ubuntu", "../../channels") print d.changelogs_uri for suite in d.suites: - print suite.name - print suite.description - print suite.base_uri + print "\nSuite: %s" % suite.name + print "Desc: %s" % suite.description + print "BaseURI: %s" % suite.base_uri + print "MatchURI: %s" % suite.match_uri for component in suite.components: - print component.name - print component.description - print component.enabled + print " %s - %s - %s " % (component.name, + component.description, + component.enabled) + for child in suite.children: + print " %s" % child.description diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in index 94833aca..4bda6077 100644 --- a/channels/Ubuntu.info.in +++ b/channels/Ubuntu.info.in @@ -3,7 +3,8 @@ _ChangelogURI: http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/chang Suite: dapper RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.06 LTS +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 6.04 'Dapper Drake' Component: main Enabled: 1 _CompDescription: Officially supported @@ -17,11 +18,44 @@ Component: multiverse Enabled: 0 _CompDescription: Non-free (Multiverse) +Suite: dapper +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*6.04 +_Description: Cdrom with Ubuntu 6.04 'Dapper Drake' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + Suite: dapper-security +ParentSuite: dapper RepositoryType: deb BaseURI: http://security.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.06 LTS Security Updates -Component: main +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Ubuntu 6.04 Security Updates + +Suite: dapper-updates +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 6.04 Updates + +Suite: dapper-backports +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 6.04 Backports + +Suite: dapper-backports +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.10 'Breezy Badger' Enabled: 1 _CompDescription: Officially supported Component: restricted @@ -34,13 +68,47 @@ Component: multiverse Enabled: 0 _CompDescription: Non-free (Multiverse) -Suite: dapper-updates +Suite: breezy +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*5.10 +_Description: Cdrom with Ubuntu 5.10 'Breezy Badger' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: breezy-security +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Ubuntu 5.10 Security Updates + +Suite: breezy-updates +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.10 Updates + +Suite: breezy-backports +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.10 Backports + +Suite: hoary RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.06 LTS Updates +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.04 'Hoary Hedgehog' Component: main Enabled: 1 -_CompDescription: Officially supported +_CompDescription: Oficially supported Component: restricted Enabled: 1 _CompDescription: Restricted copyright @@ -51,13 +119,47 @@ Component: multiverse Enabled: 0 _CompDescription: Non-free (Multiverse) -Suite: dapper-backports +Suite: hoary +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*5.04 +_Description: Cdrom with Ubuntu 5.04 'Hoary Hedgehog' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: hoary-security +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Ubuntu 5.04 Security Updates + +Suite: hoary-updates +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.04 Updates + +Suite: hoary-backports +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.04 Backports + +Suite: warty RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.06 LTS Backports +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 4.10 'Warty Warthog' Component: main Enabled: 1 -_CompDescription: Officially supported +_CompDescription: Oficially supported Component: restricted Enabled: 1 _CompDescription: Restricted copyright @@ -68,3 +170,35 @@ Component: multiverse Enabled: 0 _CompDescription: Non-free (Multiverse) +Suite: warty +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*4.10 +_Description: Cdrom with Ubuntu 4.10 'Warty Warthog' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: warty-security +ParentSuite: warty +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Ubuntu 4.10 Security Updates + +Suite: warty-updates +ParentSuite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 4.10 Updates + +Suite: warty-backports +ParentSuite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 4.10 Backports -- cgit v1.2.3 From f100900ea0709a71ebceae238f0b60fe28aa9232 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Wed, 28 Jun 2006 21:12:04 +0200 Subject: * more merging --- SoftwareProperties/SoftwareProperties.py | 238 ++++++++++++++++++++++++------- channels/README.channels | 47 ++++++ 2 files changed, 236 insertions(+), 49 deletions(-) create mode 100644 channels/README.channels diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 65b72cda..037f01fb 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -30,6 +30,7 @@ import gettext import tempfile from gettext import gettext as _ import os +import string #sys.path.append("@prefix/share/update-manager/python") @@ -39,6 +40,8 @@ import aptsources import dialog_add import dialog_edit import dialog_cache_outdated +#import dialog_edit_predefined +#import dialog_sources_list from dialog_apt_key import apt_key from utils import * @@ -54,11 +57,19 @@ CONF_MAP = { } +# columns of the source_store +(SORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4) + class SoftwareProperties(SimpleGladeApp): - def __init__(self, datadir=None, options=None, parent=None): + def __init__(self, datadir=None, options=None, parent=None, file=None): gtk.window_set_default_icon_name("software-properties") + # get the current LSB distribution name + pipe = os.popen("lsb_release -i | cut -d : -f 2-") + self.distribution = pipe.read().strip() + del pipe + # FIXME: some saner way is needed here if datadir == None: datadir = "/usr/share/update-manager/" @@ -184,30 +195,92 @@ class SoftwareProperties(SimpleGladeApp): self.init_keyslist() self.reload_keyslist() + # drag and drop support for sources.list + self.treeview_sources.drag_dest_set(gtk.DEST_DEFAULT_ALL, \ + [('text/uri-list',0, 0)], \ + gtk.gdk.ACTION_COPY) + self.treeview_sources.connect("drag_data_received",\ + self.on_sources_drag_data_received) + + # call the add sources.list dialog if we got a file from the cli + if self.file != None: + self.open_file(file) + + def open_file(self, file): + """Show an confirmation for adding the channels of the specified file""" + #dialog = dialog_sources_list.AddSourcesList(self.window_main, + # self.sourceslist, + # self.render_source, + # self.get_comparable, + # self.datadir, + # file) + #res = dialog.run() + #if res == gtk.RESPONSE_OK: + # self.modified_sourceslist() + print "droped a sources.list" + + def on_sources_drag_data_received(self, widget, context, x, y, + selection, target_type, timestamp): + """Extract the dropped file pathes and open the first file, only""" + uri = selection.data.strip() + uri_splitted = uri.split() + if len(uri_splitted)>0: + self.open_file(uri_splitted[0]) + def hide(self): self.window_main.hide() def init_sourceslist(self): - self.source_store = gtk.ListStore(str, bool, gobject.TYPE_PYOBJECT) + self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN, + gobject.TYPE_STRING, + gobject.TYPE_PYOBJECT, + gobject.TYPE_BOOLEAN) self.treeview_sources.set_model(self.source_store) - - tr = gtk.CellRendererText() - tr.set_property("xpad", 10) - tr.set_property("ypad", 10) - - source_col = gtk.TreeViewColumn("Description", tr, markup=LIST_MARKUP) - #source_col.set_max_width(500) - - toggle = gtk.CellRendererToggle() - toggle.connect("toggled", self.on_channel_toggled) - toggle_col = gtk.TreeViewColumn("Active", toggle, active=LIST_ENABLED) + self.treeview_sources.set_row_separator_func(self.is_separator, + STORE_SEPARATOR) + #self.treeview_sources.set_rules_hint(False) + + cell_desc = gtk.CellRendererText() + cell_desc.set_property("xpad", 2) + cell_desc.set_property("ypad", 2) + col_desc = gtk.TreeViewColumn(_("Software Channel"), cell_desc, + markup=COLUMN_DESC) + col_desc.set_max_width(1000) + + cell_toggle = gtk.CellRendererToggle() + cell_toggle.set_property("xpad", 2) + cell_toggle.set_property("ypad", 2) + cell_toggle.connect('toggled', self.on_channel_toggled) + col_active = gtk.TreeViewColumn(_("Active"), cell_toggle, + active=COLUMN_ACTIVE) + + self.treeview_sources.append_column(col_active) + self.treeview_sources.append_column(col_desc) - self.treeview_sources.append_column(toggle_col) - self.treeview_sources.append_column(source_col) - self.sourceslist = aptsources.SourcesList() - self.matcher = aptsources.SourceEntryMatcher() - + + def on_channel_activate(self, treeview, path, column): + """Open the edit dialog if a channel was double clicked""" + self.on_edit_clicked(treeview) + + def on_treeview_sources_cursor_changed(self, treeview): + """Enable the buttons remove and edit if a channel is selected""" + sel = self.treeview_sources.get_selection() + (model, iter) = sel.get_selected() + if iter: + self.button_edit.set_sensitive(True) + self.button_remove.set_sensitive(True) + else: + self.button_edit.set_sensitive(False) + self.button_remove.set_sensitive(False) + + def on_channel_toggled(self, cell_toggle, path): + """Enable or disable the selected channel""" + iter = self.source_store.get_iter((int(path),)) + source_entry = self.source_store.get_value(iter, STORE_SOURCE) + source_entry.disabled = not source_entry.disabled + self.modified_sourceslist() + def init_keyslist(self): self.keys_store = gtk.ListStore(str) self.treeview2.set_model(self.keys_store) @@ -217,29 +290,100 @@ class SoftwareProperties(SimpleGladeApp): keys_col = gtk.TreeViewColumn("Key", tr, text=0) self.treeview2.append_column(keys_col) + def on_button_revert_clicked(self, button): + """Restore the source list from the startup of the dialog""" + self.sourceslist.restoreBackup(".save") + self.sourceslist.clearBackup(".save") + self.sourceslist.backup(".save") + self.sourceslist.refresh() + self.reload_sourceslist() + self.button_revert.set_sensitive(False) + self.modified = False + + def modified_sourceslist(self): + """The sources list was changed and now needs to be saved and reloaded""" + self.button_revert.set_sensitive(True) + self.sourceslist.check_for_endangered_dists() + self.save_sourceslist() + self.reload_sourceslist() + self.modified = True + + def render_source(self, source): + """Render a nice output to show the source in a treeview""" + + if source.template == None: + if source.comment: + contents = "%s" % source.comment + # Only show the components if there are more than one + if len(source.comps) > 1: + for c in source.comps: + contents += " %s" % c + else: + contents = "%s %s" % (source.uri, source.dist) + for c in source.comps: + contents += " %s" % c + if source.type in ("deb-src", "rpm-src"): + contents += " %s" % _("(Source Code)") + return contents + else: + # try to make use of an corresponding template + contents = "%s" % source.template.description + if source.type in ("deb-src", "rpm-src"): + contents += " (%s)" % _("Source Code") + if source.comment: + contents +=" %s" % source.comment + if source.template.child == False: + for comp in source.comps: + if source.template.components.has_key(comp): + (desc, enabled) = source.template.components[comp] + contents += "\n%s" % desc + else: + contents += "\n%s" % comp + return contents + + def get_comparable(self, source): + """extract attributes to sort the sources""" + cur_sys = 1 + has_template = 1 + has_comment = 1 + is_source = 1 + revert_numbers = string.maketrans("0123456789", "9876543210") + if source.template: + has_template = 0 + desc = source.template.description + if source.template.distribution == self.distribution: + cur_sys = 0 + else: + desc = "%s %s %s" % (source.uri, source.dist, source.comps) + if source.comment: + has_comment = 0 + if source.type.find("src"): + is_source = 0 + return (cur_sys, has_template, has_comment, is_source, + desc.translate(revert_numbers)) + def reload_sourceslist(self): (path_x, path_y) = self.treeview_sources.get_cursor() self.source_store.clear() + self.sourceslist.refresh() + self.sourceslist_visible=[] for source in self.sourceslist.list: - if source.invalid: - continue - (a_type, dist, comps) = self.matcher.match(source) - - contents = "" - if source.comment != "": - contents += "%s\n\n" % (source.comment) - contents +="%s (%s) \n%s" % (dist,a_type, comps) - - self.source_store.append([contents, not source.disabled, source]) - # try to reselect the latest selected channel or if it fails the first - # one - if len(self.source_store) > 0 and \ - (path_x == None or self.treeview_sources.set_cursor(path_x)): - self.treeview_sources.set_cursor(0) - else: - # call the cursor_changed signal if no channel is selected - self.treeview_sources.emit("cursor_changed") + if not source.invalid: + self.sourceslist_visible.append(source) + + # Sort the sources list + self.sourceslist_visible.sort(key=self.get_comparable) + dist_first = False + for source in self.sourceslist_visible: + contents = self.render_source(source) + + self.source_store.append([not source.disabled, contents, + source, False]) + + def is_separator(self, model, iter, column): + return model.get_value(iter, column) + def reload_keyslist(self): self.keys_store.clear() for key in self.apt_key.list(): @@ -378,28 +522,24 @@ class SoftwareProperties(SimpleGladeApp): if not iter: return source_entry = model.get_value(iter, LIST_ENTRY_OBJ) - # see if we know what this thing should look like - found_matcher = False - for item in aptsources.SourceEntryTemplates(self.datadir).templates: - if item.matches(source_entry): - found_matcher = True - break - if found_matcher: - dialog = dialog_add.dialog_add(self.window_main, self.sourceslist, - self.datadir, source_entry) + if source_entry.template == None: + dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist, + source_entry, self.datadir) else: - dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist, - source_entry, self.datadir) + dialog = dialog_edit_predefined.dialog_edit_predefined(self.window_main, + self.sourceslist, + source_entry, self.datadir) if dialog.run() == gtk.RESPONSE_OK: - self.reload_sourceslist() - self.modified = True + self.modified_sourceslist() + # FIXME:outstanding from merge def on_channel_activated(self, treeview, path, column): """Open the edit dialog if a channel was double clicked""" # check if the channel can be edited if self.button_edit.get_property("sensitive") == True: self.on_edit_clicked(treeview) + # FIXME:outstanding from merge def on_treeview_sources_cursor_changed(self, treeview): """set the sensitiveness of the edit and remove button corresponding to the selected channel""" diff --git a/channels/README.channels b/channels/README.channels new file mode 100644 index 00000000..6bc76872 --- /dev/null +++ b/channels/README.channels @@ -0,0 +1,47 @@ +Channel Definition +------------------ + +The .info files allow to specify a set of default channels that is available +in the dialog "add channel". The .info file whose name corresponds to the +LSB release name is used, e.g. 'Ubuntu.info' on a Ubuntu system. + +Furthermore all .info files are used to render the channels presented in the +sources list more user friendly. + + +Tags +---- + +Suite: the name of the dist used in the repository + +MatchSuite: mainly used for cdroms. defaults to Suite + +ParentSuite: the channel only appears as a component of the parent suite in + the add dialog + the components/sections of the suite correspond to the ones of + the parent suite. specified components of the suite itself + are ignored + +Available: determs the availabilty of the suite in the add dialog. + defaults to False + +RepositoryType: does the repository contain binary or source packages + +BaseURI: the base URI of the repository + +MatchURI: used for identifing mirrors + +Description: description of the suite. the translation is done through + gettext at runtime + +Component: a component/section of the suite (ignored if ParentSuite is + set) + +Enabled: activate the component by default (ignored if ParentSuite is + set) + +CompDescription: humand readable description of the component/section + (ignored if ParentSuite is set). the translation is done + through gettext at runtime + + -- cgit v1.2.3 From 34bb7b2d05692dbaab36dbad43d4b4305e0ff905 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Thu, 29 Jun 2006 00:52:16 +0200 Subject: * fixed test output of DistInfo and channels desc for Ubuntu --- SoftwareProperties/SoftwareProperties.py | 5 +++++ UpdateManager/Common/DistInfo.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 037f01fb..e0d5f524 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -56,6 +56,11 @@ CONF_MAP = { "max_age" : "APT::Archives::MaxAge" } +( +COLUMN_ACTIVE, +COLUMN_DESC +) = range(2) + # columns of the source_store (SORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4) diff --git a/UpdateManager/Common/DistInfo.py b/UpdateManager/Common/DistInfo.py index 873d7132..ebf83516 100644 --- a/UpdateManager/Common/DistInfo.py +++ b/UpdateManager/Common/DistInfo.py @@ -135,8 +135,8 @@ if __name__ == "__main__": print "BaseURI: %s" % suite.base_uri print "MatchURI: %s" % suite.match_uri for component in suite.components: - print " %s - %s - %s " % (component.name, - component.description, - component.enabled) + print " %s - %s - %s " % (component, + suite.components[component][0], + suite.components[component][1]) for child in suite.children: print " %s" % child.description -- cgit v1.2.3 From 7c0fdd7a719a1127a838a33bc9415fa4800c453b Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Thu, 29 Jun 2006 01:20:02 +0200 Subject: * self.file got lost during merging * import UI changes from UDS Paris * fix Ubuntu channel template --- SoftwareProperties/SoftwareProperties.py | 2 + channels/Ubuntu.info.in | 1 + data/SoftwareProperties.glade | 985 +++++++++++++++++++------------ 3 files changed, 608 insertions(+), 380 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index e0d5f524..a5c9ba61 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -83,6 +83,8 @@ class SoftwareProperties(SimpleGladeApp): None, domain="update-manager") self.modified = False + self.file = file + #self.gnome_program = gnome.init("Software Properties", "0.41") #self.gconfclient = gconf.client_get_default() diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in index 4bda6077..eb88ceb9 100644 --- a/channels/Ubuntu.info.in +++ b/channels/Ubuntu.info.in @@ -56,6 +56,7 @@ RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ _Description: Ubuntu 5.10 'Breezy Badger' +Component: main Enabled: 1 _CompDescription: Officially supported Component: restricted diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 085a3a57..cbc87183 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -7,7 +7,7 @@ 6 620 400 - Software Preferences + Software Sources GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER False @@ -40,21 +40,88 @@ False - + 12 True False - 12 + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + + + + + + + + + + + + + True + + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + - + True 0 0.5 GTK_SHADOW_NONE - + True 0.5 0.5 @@ -66,167 +133,72 @@ 0 - + True False 6 - + True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - True - False - True - False - False - False - - - - + CD-ROM/DVD + True + GTK_RELIEF_NORMAL + True + False + False + True 0 - True - True + False + False - + True - GTK_BUTTONBOX_START - 6 - - - - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - + False + 12 - + True - True True - gtk-edit - True + Internet: + True GTK_RELIEF_NORMAL True - + False + False + True + + 0 + False + False + - + True - True - True - GTK_RELIEF_NORMAL + False True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-cdrom - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Add _Cdrom - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - + + 0 + True + True + 0 False - True + False @@ -235,9 +207,9 @@ - + True - <b>Channels</b> + <b>Location</b> False True GTK_JUSTIFY_LEFT @@ -259,7 +231,7 @@ 0 - True + False True @@ -271,9 +243,9 @@ - + True - Installation Media + False False GTK_JUSTIFY_LEFT @@ -294,191 +266,326 @@ - + 12 True - 0 - 0.5 - GTK_SHADOW_NONE + False + 18 - + True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 + 0 + 0.5 + GTK_SHADOW_NONE - + True - False - 6 + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 - + True False 6 - - True - True - _Check for updates automatically: - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - True - + - - True - - False - True - - - - 0 - True - True - + - - - 0 - False - False - - - - - True - True - _Download updates in the background, but do not install them - True - GTK_RELIEF_NORMAL - True - False - False - True - + + + - - 0 - False - False - + + - - - True - Only security updates from the official Ubuntu servers will be installed automatically - True - _Install security updates without confirmation - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - + + + True + <b>Internet Updates</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 - + + True False 6 - + True - True - D_elete downloaded software files: - True - GTK_RELIEF_NORMAL - True - False - False - True - + False + 6 + + + + True + True + _Check for updates automatically: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + True + + + + + + True + + False + True + + + + 0 + True + True + + 0 False - True + False - + True - - False - True - + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + True + _Download updates automatically, but do not install them + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + Only security updates from the official Ubuntu servers will be installed automatically + True + _Install security updates without confirmation + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + False + 6 + + + + True + True + D_elete downloaded software files: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + True + + + + + + True + + False + True + + + + 0 + True + True + + 0 - True + False True - - 0 - False - True - - - - - - True - <b>Internet updates</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + + + True + <b>Automatic Updates</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + - label_item + 0 + False + True @@ -489,9 +596,9 @@ - + True - Internet Updates + False False GTK_JUSTIFY_LEFT @@ -512,121 +619,102 @@ - + 12 True - 0 - 0.5 - GTK_SHADOW_NONE + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + False + False + False + + + + + + + 0 + True + True + + - + True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 + False + 18 - + True False 6 - + True + True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - True - False - True - False - False - False - - + gtk-add + True + GTK_RELIEF_NORMAL + True + 0 - True + False True - + True - False - 6 - - - - True - Restore the default keys of your distribution - True - Restore _Defaults - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - GTK_PACK_END - - + True + True + gtk-edit + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + True + + - - - True - Import the public key from a trusted software provider - True - _Import Key File - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - GTK_PACK_END - - + + + True + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + 0 @@ -635,30 +723,167 @@ + + 0 + True + True + + + + + + True + True + gtk-revert-to-saved + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + True + + + + + False + True + + + + + + True + Additional Software + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + False + False + False + + + 0 + True + True + - + True - <b>Keys</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + False + 6 + + + + True + Restore the default keys of your distribution + True + Restore _Defaults + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + GTK_PACK_END + + + + + + True + Import the public key from a trusted software provider + True + _Import Key File + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + GTK_PACK_END + + - label_item + 0 + False + True -- cgit v1.2.3 From 9d01fe4b4e6c370f76e83f500554cd7dd0512093 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Thu, 29 Jun 2006 02:47:36 +0200 Subject: * Extract the components and the child repos (updates) of the currently used distribution from the templates --- SoftwareProperties/SoftwareProperties.py | 60 ++++++++++++++++++++++++++++++-- data/SoftwareProperties.glade | 19 ++++++++-- 2 files changed, 74 insertions(+), 5 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index a5c9ba61..70c6f5dc 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -63,7 +63,7 @@ COLUMN_DESC # columns of the source_store -(SORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4) +(STORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4) class SoftwareProperties(SimpleGladeApp): @@ -75,6 +75,16 @@ class SoftwareProperties(SimpleGladeApp): self.distribution = pipe.read().strip() del pipe + # get the current LSB distribution description + pipe = os.popen("lsb_release -d | cut -d : -f 2-") + self.dist_desc = pipe.read().strip() + del pipe + + # get the current LSB distribution codename + pipe = os.popen("lsb_release -c | cut -d : -f 2-") + self.dist_codename = pipe.read().strip() + del pipe + # FIXME: some saner way is needed here if datadir == None: datadir = "/usr/share/update-manager/" @@ -101,11 +111,48 @@ class SoftwareProperties(SimpleGladeApp): toplevel = gtk.gdk.window_foreign_new(int(options.toplevel)) self.window_main.window.set_transient_for(toplevel) - self.window_main.show() - self.init_sourceslist() self.reload_sourceslist() + # Set up options in the user interface + # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu + self.label_updates.set_label(_("%s Updates") % self.distribution) + # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu + self.label_dist_software.set_label(_("%s Software") % self.distribution) + self.label_dist_name.set_label("%s" % self.dist_desc) + + # find the source entry for your current distribution + for template in self.sourceslist.matcher.templates: + if template.name == self.dist_codename and\ + template.distribution == template.distribution: + print "yeah! found source for %s" % self.dist_desc + print template.description, template.base_uri, template.components + self.dist_template = template + break + # FIXME: Make this configurable for reuse in Debian + #components = [("main", _("Free software that is supported by Canonical" + # " Ltd. (main)")), + # ("universe", _("Free software that is maintained by " + # "the community (universe)")), + # ("restricted", _("Non-free drivers (restricted)")), + # ("multiverse", _("Software that is restricted by copyright " + # "or legal issues (multiverse)"))] + + # Setup the checkbuttons for the components + print self.dist_template.components.keys() + for comp in self.dist_template.components.keys(): + checkbox = gtk.CheckButton(label=self.dist_template.components[comp][0]) + self.vbox_dist_comps.add(checkbox) + checkbox.show() + + # Setup the checkbuttons for the child repos / updates + for template in self.dist_template.children: + checkbox = gtk.CheckButton(label=template.description) + self.vbox_updates.add(checkbox) + checkbox.show() + + self.window_main.show() + # internet update setings # this maps the key (combo-box-index) to the auto-update-interval value @@ -238,6 +285,13 @@ class SoftwareProperties(SimpleGladeApp): self.window_main.hide() def init_sourceslist(self): + """ + Read all valid sources into our ListStore + """ + # STORE_ACTIVE - is the source enabled or disabled + # STORE_DESCRIPTION - description of the source entry + # STORE_SOURCE - the source entry object + # STORE_SEPARATOR - if the entry is a separator self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index cbc87183..ac81bd1b 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -7,7 +7,7 @@ 6 620 400 - Software Sources + Software Repositories GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER False @@ -76,7 +76,22 @@ - + + True + True + Source code + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + -- cgit v1.2.3 From 71424532c392df4612e170fb6a4737db3622c0b1 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Thu, 29 Jun 2006 12:58:59 +0200 Subject: * use a Distribution class to store distribution related information * main work on identifing the distribution repositories * show enabled comps and enabled updates * rename dialog to "software sources" * a lot of smaller stuff --- SoftwareProperties/SoftwareProperties.py | 279 ++++++++++++++++++++++++------- SoftwareProperties/aptsources.py | 1 + data/SoftwareProperties.glade | 23 ++- 3 files changed, 243 insertions(+), 60 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 70c6f5dc..0f4f5f66 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -57,34 +57,133 @@ CONF_MAP = { } ( -COLUMN_ACTIVE, -COLUMN_DESC + COLUMN_ACTIVE, + COLUMN_DESC ) = range(2) # columns of the source_store -(STORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4) +( + STORE_ACTIVE, + STORE_DESCRIPTION, + STORE_SOURCE, + STORE_SEPARATOR, + STORE_VISIBLE +) = range(5) + +class Distribution: + def __init__(self): + """" + Container for distribution specific informations + """ + # LSB information + self.id = "" + self.codename = "" + self.description = "" + self.release = "" + + # corresponding sources + self.source_template = None + self.child_sources = [] + self.main_sources = [] + self.enabled_comps = [] + self.used_media = [] + self.source_code_sources = [] + + # location of the sources + self.cdrom_available = False + self.use_internet = False + self.main_server = "" + self.nearest_server = "" + self.other_servers = [] + + # get the LSB information + lsb_info = [] + for lsb_option in ["-i", "-c", "-d", "-r"]: + pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option) + lsb_info.append(pipe.read().strip()) + del pipe + (self.id, self.codename, self.description, self.release) = lsb_info + + def get_sources(self, sources_list): + """ + Find the corresponding template, main and child sources + for the distribution + """ + # find the distro template + for template in sources_list.matcher.templates: + if template.name == self.codename and\ + template.distribution == self.id: + print "yeah! found a template for %s" % self.description + print template.description, template.base_uri, template.components + self.source_template = template + break + if self.source_template == None: + print "Error: could not find a distribution template" + sys.exit(1) + + # find main and child sources + media = [] + comps = [] + source_code = [] + for source in sources_list.list: + if source.disabled == False and source.invalid == False and\ + source.dist == self.codename and\ + source.template.name == self.codename: + print "yeah! found a distro repo: %s" % source.line + if source.type == "deb": + self.main_sources.append(source) + comps.extend(source.comps) + media.append(source.uri) + elif source.type == "deb-src": + self.source_code_sources.append(source) + if source.template in self.source_template.children: + print "yeah! child found: %s" % source.template.name + if source.type == "deb": + self.child_sources.append(source) + media.append(source.uri) + elif source.type == "deb-src": + self.source_code_sources.append(source) + self.enabled_comps = set(comps) + self.used_media = set(media) + + self.get_mirrors() + + def get_mirrors(self): + """ + Provide a set of mirrors where you can get the distribution from + """ + # the main server is stored in the template + self.main_server = self.source_template.base_uri + + # try to guess the nearest mirror from the locale + # FIXME: for debian we need something different + if self.id == "Ubuntu": + locale = os.getenv("LANG", default="en.UK") + a = locale.find("_") + z = locale.find(".") + if z == -1: + z = len(locale) + country = locale[a+1:z].lower() + self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % country + + # other used servers + for medium in self.used_media: + if medium.startswith("cdrom:"): + self.cdrom_available = True + else: + # seems to be a network source + self.use_internet = True + if medium != self.main_server or \ + medium != self.nearest_server: + self.other_servers.append(medium) + class SoftwareProperties(SimpleGladeApp): def __init__(self, datadir=None, options=None, parent=None, file=None): gtk.window_set_default_icon_name("software-properties") - # get the current LSB distribution name - pipe = os.popen("lsb_release -i | cut -d : -f 2-") - self.distribution = pipe.read().strip() - del pipe - - # get the current LSB distribution description - pipe = os.popen("lsb_release -d | cut -d : -f 2-") - self.dist_desc = pipe.read().strip() - del pipe - - # get the current LSB distribution codename - pipe = os.popen("lsb_release -c | cut -d : -f 2-") - self.dist_codename = pipe.read().strip() - del pipe - # FIXME: some saner way is needed here if datadir == None: datadir = "/usr/share/update-manager/" @@ -95,6 +194,8 @@ class SoftwareProperties(SimpleGladeApp): self.file = file + self.distribution = Distribution() + #self.gnome_program = gnome.init("Software Properties", "0.41") #self.gconfclient = gconf.client_get_default() @@ -114,43 +215,6 @@ class SoftwareProperties(SimpleGladeApp): self.init_sourceslist() self.reload_sourceslist() - # Set up options in the user interface - # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu - self.label_updates.set_label(_("%s Updates") % self.distribution) - # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu - self.label_dist_software.set_label(_("%s Software") % self.distribution) - self.label_dist_name.set_label("%s" % self.dist_desc) - - # find the source entry for your current distribution - for template in self.sourceslist.matcher.templates: - if template.name == self.dist_codename and\ - template.distribution == template.distribution: - print "yeah! found source for %s" % self.dist_desc - print template.description, template.base_uri, template.components - self.dist_template = template - break - # FIXME: Make this configurable for reuse in Debian - #components = [("main", _("Free software that is supported by Canonical" - # " Ltd. (main)")), - # ("universe", _("Free software that is maintained by " - # "the community (universe)")), - # ("restricted", _("Non-free drivers (restricted)")), - # ("multiverse", _("Software that is restricted by copyright " - # "or legal issues (multiverse)"))] - - # Setup the checkbuttons for the components - print self.dist_template.components.keys() - for comp in self.dist_template.components.keys(): - checkbox = gtk.CheckButton(label=self.dist_template.components[comp][0]) - self.vbox_dist_comps.add(checkbox) - checkbox.show() - - # Setup the checkbuttons for the child repos / updates - for template in self.dist_template.children: - checkbox = gtk.CheckButton(label=template.description) - self.vbox_updates.add(checkbox) - checkbox.show() - self.window_main.show() # internet update setings @@ -260,6 +324,101 @@ class SoftwareProperties(SimpleGladeApp): if self.file != None: self.open_file(file) + def distro_to_widgets(self): + """ + Represent the distro information in the user interface + """ + # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu + self.label_updates.set_label(_("%s Updates") % self.distribution.id) + # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu + self.label_dist_software.set_label(_("%s Software") % self.distribution.id) + self.label_dist_name.set_label("%s" % self.distribution.description) + + # Setup the checkbuttons for the components + for checkbutton in self.vbox_dist_comps.get_children(): + self.vbox_dist_comps.remove(checkbutton) + for comp in self.distribution.source_template.components.keys(): + checkbox = gtk.CheckButton(label=self.distribution.source_template.components[comp][0]) + # check if the comp is enabled + # FIXME: use inconsistence if there are main sources with not all comps + if comp in self.distribution.enabled_comps: + checkbox.set_active(True) + # do not allow to disable an enabled main component + if comp == "main": + checkbox.set_property("sensitive", False) + # setup the callback and show the checkbutton + checkbox.connect("toggled", self.on_checkbutton_comp_toggled, comp) + self.vbox_dist_comps.add(checkbox) + checkbox.show() + + # Setup the checkbuttons for the child repos / updates + for checkbutton in self.vbox_updates.get_children(): + self.vbox_updates.remove(checkbutton) + for template in self.distribution.source_template.children: + checkbox = gtk.CheckButton(label=template.description) + for child in self.distribution.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.distribution.enabled_comps) == 0: + checkbox.set_active(True) + elif len(set(child.comps) - self.distribution.enabled_comps) ==\ + len(self.distribution.enabled_comps): + checkbox.set_active(False) + else: + checkbox.set_inconsistent(True) + #FIXME: currently we don't handle multiple sources of the same + # child source - the required effort would be questionable + break + # setup the callback and show the checkbutton + checkbox.connect("toggled", self.on_checkbutton_child_toggled, + template.name) + self.vbox_updates.add(checkbox) + checkbox.show() + + # setup the location + # FIXME: how to handle uncommented cdroms? + if self.distribution.cdrom_available == True: + self.checkbutton_cdrom.set_active(True) + else: + self.checkbutton_cdrom.set_active(False) + + # FIXME: needs inconsistence + if self.distribution.use_internet == True: + self.checkbutton_internet.set_active(True) + self.combobox_server.set_property("sensitive", True) + else: + self.checkbutton_internet.set_active(False) + self.combobox_server.set_property("sensitive", False) + server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) + self.combobox_server.set_model(server_store) + cell = gtk.CellRendererText() + self.combobox_server.pack_start(cell, True) + self.combobox_server.add_attribute(cell, 'text', 0) + server_store.append([_("%s (default)") % self.distribution.main_server, + self.distribution.main_server]) + server_store.append([_("%s (nearest)") % self.distribution.nearest_server, + self.distribution.main_server]) + for server in self.distribution.other_servers: + server_store.append(["%s" % server, server]) + # FIXME: which one to choose? + self.combobox_server.set_active(0) + + + def on_checkbutton_comp_toggled(self, checkbutton, comp): + """ + Enable or disable a component for the distribution main repository + and its children + """ + print "Set %s to %s" % (checkbutton.get_active(), comp) + state = checkbutton.get_active() + + def on_checkbutton_child_toggled(self, checkbutton, child): + """ + Enable or disable a child repo of the distribution main repository + """ + print "Set %s to %s" % (checkbutton.get_active(), child) + def open_file(self, file): """Show an confirmation for adding the channels of the specified file""" #dialog = dialog_sources_list.AddSourcesList(self.window_main, @@ -292,9 +451,11 @@ class SoftwareProperties(SimpleGladeApp): # STORE_DESCRIPTION - description of the source entry # STORE_SOURCE - the source entry object # STORE_SEPARATOR - if the entry is a separator + # STORE_VISIBLE - if the entry is shown or hidden self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, + gobject.TYPE_BOOLEAN, gobject.TYPE_BOOLEAN) self.treeview_sources.set_model(self.source_store) self.treeview_sources.set_row_separator_func(self.is_separator, @@ -428,8 +589,11 @@ class SoftwareProperties(SimpleGladeApp): self.source_store.clear() self.sourceslist.refresh() self.sourceslist_visible=[] + self.distribution.get_sources(self.sourceslist) for source in self.sourceslist.list: - if not source.invalid: + if not source.invalid or\ + source not in self.distribution.main_sources or\ + source not in self.distribution.child_sources: self.sourceslist_visible.append(source) # Sort the sources list @@ -440,7 +604,8 @@ class SoftwareProperties(SimpleGladeApp): contents = self.render_source(source) self.source_store.append([not source.disabled, contents, - source, False]) + source, False, True]) + self.distro_to_widgets() def is_separator(self, model, iter, column): return model.get_value(iter, column) diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 5735960b..fc08fb12 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -90,6 +90,7 @@ class SourceEntry: self.file = file self.parse(line) self.template = None + self.children = [] # works mostely like split but takes [] into account def mysplit(self, line): diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index ac81bd1b..8f747689 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -7,7 +7,7 @@ 6 620 400 - Software Repositories + Software Sources GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER False @@ -66,13 +66,30 @@ 0 - + True False 6 - + + True + False + 6 + + + + + + + + + + + 0 + True + True + -- cgit v1.2.3 From 972a8ca2f1ff4466096505262305260bbd507caf Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Thu, 29 Jun 2006 13:48:14 +0200 Subject: * add long descriptions for components * fix some boolean stuff (hide distru sources) * also rename the menu entry of the app --- SoftwareProperties/SoftwareProperties.py | 20 +++++++++++--------- UpdateManager/Common/DistInfo.py | 21 ++++++++++++++------- channels/Ubuntu.info.in | 14 +++++++++----- data/software-properties.desktop.in | 6 +++--- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 0f4f5f66..da52b272 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -31,6 +31,7 @@ import tempfile from gettext import gettext as _ import os import string +import re #sys.path.append("@prefix/share/update-manager/python") @@ -120,6 +121,7 @@ class Distribution: break if self.source_template == None: print "Error: could not find a distribution template" + # FIXME: will go away - only for debugging issues sys.exit(1) # find main and child sources @@ -141,9 +143,6 @@ class Distribution: print "yeah! child found: %s" % source.template.name if source.type == "deb": self.child_sources.append(source) - media.append(source.uri) - elif source.type == "deb-src": - self.source_code_sources.append(source) self.enabled_comps = set(comps) self.used_media = set(media) @@ -174,8 +173,8 @@ class Distribution: else: # seems to be a network source self.use_internet = True - if medium != self.main_server or \ - medium != self.nearest_server: + if not re.match(medium, self.main_server) and \ + not re.match(medium, self.nearest_server): self.other_servers.append(medium) @@ -338,7 +337,7 @@ class SoftwareProperties(SimpleGladeApp): for checkbutton in self.vbox_dist_comps.get_children(): self.vbox_dist_comps.remove(checkbutton) for comp in self.distribution.source_template.components.keys(): - checkbox = gtk.CheckButton(label=self.distribution.source_template.components[comp][0]) + checkbox = gtk.CheckButton(label=self.distribution.source_template.components[comp][2]) # check if the comp is enabled # FIXME: use inconsistence if there are main sources with not all comps if comp in self.distribution.enabled_comps: @@ -395,6 +394,8 @@ class SoftwareProperties(SimpleGladeApp): cell = gtk.CellRendererText() self.combobox_server.pack_start(cell, True) self.combobox_server.add_attribute(cell, 'text', 0) + # load the mirror list in to the combo and select the one of the first + # main source server_store.append([_("%s (default)") % self.distribution.main_server, self.distribution.main_server]) server_store.append([_("%s (nearest)") % self.distribution.nearest_server, @@ -557,7 +558,8 @@ class SoftwareProperties(SimpleGladeApp): if source.template.child == False: for comp in source.comps: if source.template.components.has_key(comp): - (desc, enabled) = source.template.components[comp] + print source.template.components[comp] + (desc, enabled, desc_long) = source.template.components[comp] contents += "\n%s" % desc else: contents += "\n%s" % comp @@ -591,8 +593,8 @@ class SoftwareProperties(SimpleGladeApp): self.sourceslist_visible=[] self.distribution.get_sources(self.sourceslist) for source in self.sourceslist.list: - if not source.invalid or\ - source not in self.distribution.main_sources or\ + if not source.invalid and\ + source not in self.distribution.main_sources and\ source not in self.distribution.child_sources: self.sourceslist_visible.append(source) diff --git a/UpdateManager/Common/DistInfo.py b/UpdateManager/Common/DistInfo.py index ebf83516..7d2d37ad 100644 --- a/UpdateManager/Common/DistInfo.py +++ b/UpdateManager/Common/DistInfo.py @@ -43,8 +43,9 @@ class Suite: class Component: def __init__(self): - self.name = None - self.description = None + self.name = "" + self.description = "" + self.description_long = "" self.enabled = None class DistInfo: @@ -82,7 +83,8 @@ class DistInfo: if suite: if component: suite.components["%s" % component.name] = \ - (component.description, component.enabled) + (component.description, component.enabled, + component.description_long) component = None self.suites.append (suite) suite = Suite () @@ -110,17 +112,21 @@ class DistInfo: elif field == 'Component': if component: suite.components["%s" % component.name] = \ - (component.description, component.enabled) + (component.description, component.enabled, + component.description_long) component = Component () component.name = value elif field == 'Enabled': component.enabled = bool(int(value)) elif field == 'CompDescription': component.description = _(value) + elif field == 'CompDescriptionLong': + component.description_long = _(value) if suite: if component: suite.components["%s" % component.name] = \ - (component.description, component.enabled) + (component.description, component.enabled, + component.description_long) component = None self.suites.append (suite) suite = None @@ -135,8 +141,9 @@ if __name__ == "__main__": print "BaseURI: %s" % suite.base_uri print "MatchURI: %s" % suite.match_uri for component in suite.components: - print " %s - %s - %s " % (component, + print " %s - %s - %s - %s" % (component, suite.components[component][0], - suite.components[component][1]) + suite.components[component][1], + suite.components[component][2]) for child in suite.children: print " %s" % child.description diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in index eb88ceb9..f92d8b8b 100644 --- a/channels/Ubuntu.info.in +++ b/channels/Ubuntu.info.in @@ -8,15 +8,19 @@ _Description: Ubuntu 6.04 'Dapper Drake' Component: main Enabled: 1 _CompDescription: Officially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright +_CompDescriptionLong: Free software that is officially supported by Canonical Ltd. (main) Component: universe Enabled: 0 -_CompDescription: Community maintained (Universe) +_CompDescription: Community maintained (universe) +_CompDescriptionLong: Free software that is maintained by the community (universe) +Component: restricted +Enabled: 1 +_CompDescription: Non-free drivers +_CompDescriptionLong: Non-free drivers for devices (restricted) Component: multiverse Enabled: 0 -_CompDescription: Non-free (Multiverse) +_CompDescription: Restricted software (Multiverse) +_CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) Suite: dapper MatchName: .* diff --git a/data/software-properties.desktop.in b/data/software-properties.desktop.in index c125b4f7..330fc8bc 100644 --- a/data/software-properties.desktop.in +++ b/data/software-properties.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] -_Name=Software Properties -_GenericName=Software Properties -_Comment=Configure software channels and internet updates +_Name=Software Sources +_GenericName=Software Sources +_Comment=Configure the sources for installable software and updates Exec=gksu /usr/bin/software-properties Icon=software-properties Terminal=false -- cgit v1.2.3 From 2016b797e5796fa7c0f911e040616a7f9ccddebc Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 30 Jun 2006 14:04:54 +0200 Subject: * do not show disabled sources in the additional software list * also collect all child sources --- SoftwareProperties/SoftwareProperties.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index da52b272..7c0e11f6 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -87,6 +87,7 @@ class Distribution: self.source_template = None self.child_sources = [] self.main_sources = [] + self.cdrom_sources = [] self.enabled_comps = [] self.used_media = [] self.source_code_sources = [] @@ -129,20 +130,28 @@ class Distribution: comps = [] source_code = [] for source in sources_list.list: - if source.disabled == False and source.invalid == False and\ + if source.invalid == False and\ source.dist == self.codename and\ source.template.name == self.codename: print "yeah! found a distro repo: %s" % source.line + # cdroms need do be handled differently + if source.uri.startswith("cdrom:"): + self.cdrom_sources.append(source) if source.type == "deb": self.main_sources.append(source) - comps.extend(source.comps) - media.append(source.uri) + if source.disabled == False: + comps.extend(source.comps) + media.append(source.uri) elif source.type == "deb-src": self.source_code_sources.append(source) + print source.type + print len(self.source_code_sources) if source.template in self.source_template.children: print "yeah! child found: %s" % source.template.name if source.type == "deb": self.child_sources.append(source) + elif source.type == "deb-src": + self.source_code_sources.append(source) self.enabled_comps = set(comps) self.used_media = set(media) @@ -342,9 +351,6 @@ class SoftwareProperties(SimpleGladeApp): # FIXME: use inconsistence if there are main sources with not all comps if comp in self.distribution.enabled_comps: checkbox.set_active(True) - # do not allow to disable an enabled main component - if comp == "main": - checkbox.set_property("sensitive", False) # setup the callback and show the checkbutton checkbox.connect("toggled", self.on_checkbutton_comp_toggled, comp) self.vbox_dist_comps.add(checkbox) @@ -405,6 +411,7 @@ class SoftwareProperties(SimpleGladeApp): # FIXME: which one to choose? self.combobox_server.set_active(0) + # Check for source code sources def on_checkbutton_comp_toggled(self, checkbutton, comp): """ @@ -592,10 +599,14 @@ class SoftwareProperties(SimpleGladeApp): self.sourceslist.refresh() self.sourceslist_visible=[] self.distribution.get_sources(self.sourceslist) + # Only show sources that are no binary or source code repos for + # the current distribution, but show cdrom based repos for source in self.sourceslist.list: if not source.invalid and\ - source not in self.distribution.main_sources and\ - source not in self.distribution.child_sources: + ((source not in self.distribution.main_sources and\ + source not in self.distribution.child_sources) or\ + source in self.distribution.cdrom_sources) and\ + source not in self.distribution.source_code_sources: self.sourceslist_visible.append(source) # Sort the sources list -- cgit v1.2.3 From 259ccb59e4ac78074f8af195eeb1ee88f257048e Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 15 Jul 2006 18:11:07 +0200 Subject: * Can now modify the sources list (at the moment only in memory) * A lot of cleanup and minor fixes --- SoftwareProperties/SoftwareProperties.py | 199 +++++++++++++++++++++++++------ data/SoftwareProperties.glade | 49 ++++---- 2 files changed, 188 insertions(+), 60 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 7c0e11f6..c4667aa0 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -21,6 +21,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA +import pdb import sys import apt import apt_pkg @@ -83,6 +84,19 @@ class Distribution: self.description = "" self.release = "" + # get the LSB information + lsb_info = [] + for lsb_option in ["-i", "-c", "-d", "-r"]: + pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option) + lsb_info.append(pipe.read().strip()) + del pipe + (self.id, self.codename, self.description, self.release) = lsb_info + + def get_sources(self, sources_list): + """ + Find the corresponding template, main and child sources + for the distribution + """ # corresponding sources self.source_template = None self.child_sources = [] @@ -90,6 +104,7 @@ class Distribution: self.cdrom_sources = [] self.enabled_comps = [] self.used_media = [] + self.get_source_code = False self.source_code_sources = [] # location of the sources @@ -98,26 +113,13 @@ class Distribution: self.main_server = "" self.nearest_server = "" self.other_servers = [] - - # get the LSB information - lsb_info = [] - for lsb_option in ["-i", "-c", "-d", "-r"]: - pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option) - lsb_info.append(pipe.read().strip()) - del pipe - (self.id, self.codename, self.description, self.release) = lsb_info - def get_sources(self, sources_list): - """ - Find the corresponding template, main and child sources - for the distribution - """ # find the distro template for template in sources_list.matcher.templates: if template.name == self.codename and\ template.distribution == self.id: - print "yeah! found a template for %s" % self.description - print template.description, template.base_uri, template.components + #print "yeah! found a template for %s" % self.description + #print template.description, template.base_uri, template.components self.source_template = template break if self.source_template == None: @@ -132,8 +134,9 @@ class Distribution: for source in sources_list.list: if source.invalid == False and\ source.dist == self.codename and\ + source.template and\ source.template.name == self.codename: - print "yeah! found a distro repo: %s" % source.line + #print "yeah! found a distro repo: %s" % source.line # cdroms need do be handled differently if source.uri.startswith("cdrom:"): self.cdrom_sources.append(source) @@ -144,10 +147,8 @@ class Distribution: media.append(source.uri) elif source.type == "deb-src": self.source_code_sources.append(source) - print source.type - print len(self.source_code_sources) if source.template in self.source_template.children: - print "yeah! child found: %s" % source.template.name + #print "yeah! child found: %s" % source.template.name if source.type == "deb": self.child_sources.append(source) elif source.type == "deb-src": @@ -186,6 +187,24 @@ class Distribution: not re.match(medium, self.nearest_server): self.other_servers.append(medium) + def add_source(self, sources_list, type=None, + uri=None, dist=None, comps=None, comment=""): + if uri == None: + # FIXME: Add support for the server selector + uri = self.main_server + if dist == None: + dist = self.codename + if comps == None: + comps = list(self.enabled_comps) + if type == None: + type = "deb" + if comment == "": + comment == "Added by software-properties" + + sources_list.add(type, uri, dist, comps, comment) + # FIXME: get rid of the ui dependency + if self.get_source_code == True: + sources_list.add("deb-src", uri, dist, comps, comment) class SoftwareProperties(SimpleGladeApp): @@ -203,6 +222,9 @@ class SoftwareProperties(SimpleGladeApp): self.file = file self.distribution = Distribution() + cell = gtk.CellRendererText() + self.combobox_server.pack_start(cell, True) + self.combobox_server.add_attribute(cell, 'text', 0) #self.gnome_program = gnome.init("Software Properties", "0.41") #self.gconfclient = gconf.client_get_default() @@ -352,7 +374,7 @@ class SoftwareProperties(SimpleGladeApp): if comp in self.distribution.enabled_comps: checkbox.set_active(True) # setup the callback and show the checkbutton - checkbox.connect("toggled", self.on_checkbutton_comp_toggled, comp) + checkbox.connect("toggled", self.on_component_toggled, comp) self.vbox_dist_comps.add(checkbox) checkbox.show() @@ -367,20 +389,25 @@ class SoftwareProperties(SimpleGladeApp): # for the child source if len(set(child.comps) - self.distribution.enabled_comps) == 0: checkbox.set_active(True) - elif len(set(child.comps) - self.distribution.enabled_comps) ==\ - len(self.distribution.enabled_comps): - checkbox.set_active(False) else: + checkbox.set_active(False) + if len(self.distribution.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 # setup the callback and show the checkbutton checkbox.connect("toggled", self.on_checkbutton_child_toggled, - template.name) + template) self.vbox_updates.add(checkbox) checkbox.show() + if len(self.distribution.enabled_comps) < 1: + self.vbox_updates.set_sensitive(False) + else: + self.vbox_updates.set_sensitive(True) + # setup the location # FIXME: how to handle uncommented cdroms? if self.distribution.cdrom_available == True: @@ -397,9 +424,6 @@ class SoftwareProperties(SimpleGladeApp): self.combobox_server.set_property("sensitive", False) server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) self.combobox_server.set_model(server_store) - cell = gtk.CellRendererText() - self.combobox_server.pack_start(cell, True) - self.combobox_server.add_attribute(cell, 'text', 0) # load the mirror list in to the combo and select the one of the first # main source server_store.append([_("%s (default)") % self.distribution.main_server, @@ -410,22 +434,127 @@ class SoftwareProperties(SimpleGladeApp): server_store.append(["%s" % server, server]) # FIXME: which one to choose? self.combobox_server.set_active(0) + self.combobox_server.connect("changed", self.on_combobox_server_changed) # Check for source code sources + self.checkbutton_source_code.set_inconsistent(False) + if len(self.distribution.source_code_sources) < 1: + # we don't have any source code sources, so + # uncheck the button + self.checkbutton_source_code.set_active(False) + self.distribution.get_source_code = False + else: + # there are source code sources, so we check the button + self.checkbutton_source_code.set_active(True) + self.distribution.get_source_code = True + # check if there is a corresponding source code source for + # every binary source. if not set the checkbutton to inconsistent + templates = {} + sources = [] + sources.extend(self.distribution.main_sources) + sources.extend(self.distribution.child_sources) + for source in sources: + if templates.has_key(source.template): + templates[source.template] += set(source.comps) + else: + templates[source.template] = set(source.comps) + # add fake http sources for the cdrom, since the sources + # for the cdrom are only available in the internet + for source in self.distribution.cdrom_sources: + if templates.has_key(self.distribution.source_template): + templates[self.distribution.source_template] += set(source.comps) + else: + templates[self.distribution.source_template] += set(source.comps) + for source in self.distribution.source_code_sources: + if not templates.has_key(source.template) or \ + (templates.has_key(source.template) and \ + len(set(templates[source.template]) ^ set(source.comps)) > 0): + self.checkbutton_source_code.set_inconsistent(True) + self.distribution.get_source_code = False + break + self.checkbutton_source_code.connect("toggled", + self.on_checkbutton_source_code_toggled) - def on_checkbutton_comp_toggled(self, checkbutton, comp): + def on_component_toggled(self, checkbutton, comp): """ - Enable or disable a component for the distribution main repository - and its children + Sync the components of all main sources (excluding cdroms), + child sources and source code sources """ - print "Set %s to %s" % (checkbutton.get_active(), comp) - state = checkbutton.get_active() - - def on_checkbutton_child_toggled(self, checkbutton, child): + sources = [] + sources.extend(self.distribution.main_sources) + sources.extend(self.distribution.child_sources) + if checkbutton.get_active() == True: + # check if there is a main source at all + if len(self.distribution.main_sources) < 1: + # create a new main source + self.distribution.add_source(self.sourceslist, comps=[comp]) + # add the comp to all main, child and source code sources + for source in sources: + if comp not in source.comps: + source.comps.append(comp) + if self.distribution.get_source_code == True: + for source in self.distribution.source_code_sources: + if comp not in source.comps: source.comps.append(comp) + else: + for source in sources: + if comp in source.comps: + source.comps.remove(comp) + if len(source.comps) < 1: + self.sourceslist.remove(source) + self.massive_debug_output() + + def massive_debug_output(self): + """ + do not write our changes yet - just print them to std_out + """ + print "START SOURCES.LIST:" + for source in self.sourceslist: + print source.str() + print "END SOURCES.LIST\n" + self.distribution.get_sources(self.sourceslist) + self.distro_to_widgets() + + def on_checkbutton_child_toggled(self, checkbutton, template): """ Enable or disable a child repo of the distribution main repository """ - print "Set %s to %s" % (checkbutton.get_active(), child) + if checkbutton.get_active() == False: + for source in self.distribution.child_sources: + if source.template == template: + self.sourceslist.remove(source) + else: + self.distribution.add_source(self.sourceslist, + uri=template.base_uri, + dist=template.name) + self.massive_debug_output() + + def on_checkbutton_source_code_toggled(self, checkbutton): + """ + Disable or enable the source code for all sources + """ + self.distribution.get_source_code = checkbutton.get_active() + sources = [] + sources.extend(self.distribution.main_sources) + sources.extend(self.distribution.child_sources) + + # remove all exisiting sources + for source in self.distribution.source_code_sources: + self.sourceslist.remove(source) + + if checkbutton.get_active() == True: + for source in sources: + self.sourceslist.add("deb-src", + source.uri, + source.dist, + source.comps, + "Added by software-properties") + for source in self.distribution.cdrom_sources: + self.sourceslist.add("deb-src", + self.distribution.source_template.base_uri, + self.distribution.source_template.name, + source.comps, + "Added by software-properties") + self.massive_debug_output() def open_file(self, file): """Show an confirmation for adding the channels of the specified file""" diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 8f747689..5aa5ee5c 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -69,7 +69,7 @@ True False - 6 + 18 @@ -91,25 +91,6 @@ True - - - - True - True - Source code - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - @@ -172,7 +153,6 @@ - True True CD-ROM/DVD True @@ -189,6 +169,25 @@ + + + True + True + Source code + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + True @@ -199,7 +198,7 @@ True True - Internet: + Download software from the Internet: True GTK_RELIEF_NORMAL True @@ -229,8 +228,8 @@ 0 - False - False + True + True @@ -241,7 +240,7 @@ True - <b>Location</b> + <b>Options</b> False True GTK_JUSTIFY_LEFT -- cgit v1.2.3 From 2e29da15b6d5c0596c1d282b99ad4b5b027ec6fe Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 15 Jul 2006 18:13:17 +0200 Subject: * add missing dummy function on_combobox_server_changed --- SoftwareProperties/SoftwareProperties.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index c4667aa0..28d550eb 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -474,6 +474,8 @@ class SoftwareProperties(SimpleGladeApp): break self.checkbutton_source_code.connect("toggled", self.on_checkbutton_source_code_toggled) + def on_combobox_server_changed(self, combobox): + print "FIXME" def on_component_toggled(self, checkbutton, comp): """ -- cgit v1.2.3 From dc51a1fbcc190ada20439979c0546a459a0edabd Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Wed, 19 Jul 2006 22:38:09 +0200 Subject: * allow to specify a server for all distro sources * use iso-codes to display "Server for COUNTRY" instead of the URL * depend on iso-codes * write the deb-src next to the corresponding binary line * minor code improvements * don't only the enable the comps for a mirror repo if a new one is added - this is just too much magic * try to reuse a disabled matching source if a new is added * bug fixes: - don't use out commented sources for the distribution - add a new source if there is none for an enabled comp or reuse the already existing ones - do not show disabled sources in the list - wrong inconsistent state of the source code button --- SoftwareProperties/SoftwareProperties.py | 150 ++++++++++++++++++++++--------- SoftwareProperties/aptsources.py | 46 ++++++---- debian/control | 2 +- 3 files changed, 138 insertions(+), 60 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 28d550eb..f9fb2c43 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -92,6 +92,21 @@ class Distribution: del pipe (self.id, self.codename, self.description, self.release) = lsb_info + # get a list of country codes and real names + self.countries = {} + try: + f = open("/usr/share/iso-codes/iso_3166.tab", "r") + lines = f.readlines() + for line in lines: + parts = line.split("\t") + self.countries[parts[0].lower()] = parts[1] + except: + print "could not open file '%s'" % file + else: + f.close() + + + def get_sources(self, sources_list): """ Find the corresponding template, main and child sources @@ -101,6 +116,7 @@ class Distribution: self.source_template = None self.child_sources = [] self.main_sources = [] + self.disabled_sources = [] self.cdrom_sources = [] self.enabled_comps = [] self.used_media = [] @@ -112,7 +128,7 @@ class Distribution: self.use_internet = False self.main_server = "" self.nearest_server = "" - self.other_servers = [] + self.used_servers = [] # find the distro template for template in sources_list.matcher.templates: @@ -140,13 +156,16 @@ class Distribution: # cdroms need do be handled differently if source.uri.startswith("cdrom:"): self.cdrom_sources.append(source) - if source.type == "deb": + if source.type == "deb" and source.disabled == False: self.main_sources.append(source) - if source.disabled == False: - comps.extend(source.comps) - media.append(source.uri) - elif source.type == "deb-src": + comps.extend(source.comps) + media.append(source.uri) + elif source.type == "deb" and source.disabled == True: + self.disabled_sources.append(source) + elif source.type.endswith("-src") and source.disabled == False: self.source_code_sources.append(source) + elif source.type.endswith("-src") and source.disabled == True: + self.disabled_sources.append(source) if source.template in self.source_template.children: #print "yeah! child found: %s" % source.template.name if source.type == "deb": @@ -173,8 +192,10 @@ class Distribution: z = locale.find(".") if z == -1: z = len(locale) - country = locale[a+1:z].lower() - self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % country + country_code = locale[a+1:z].lower() + self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \ + country_code + self.country = self.countries[country_code] # other used servers for medium in self.used_media: @@ -183,12 +204,13 @@ class Distribution: else: # seems to be a network source self.use_internet = True - if not re.match(medium, self.main_server) and \ - not re.match(medium, self.nearest_server): - self.other_servers.append(medium) + self.used_servers.append(medium) def add_source(self, sources_list, type=None, uri=None, dist=None, comps=None, comment=""): + """ + Add distribution specific sources + """ if uri == None: # FIXME: Add support for the server selector uri = self.main_server @@ -200,11 +222,13 @@ class Distribution: type = "deb" if comment == "": comment == "Added by software-properties" - - sources_list.add(type, uri, dist, comps, comment) - # FIXME: get rid of the ui dependency - if self.get_source_code == True: - sources_list.add("deb-src", uri, dist, comps, comment) + new_source = sources_list.add(type, uri, dist, comps, comment) + # if source code is enabled add a deb-src line after the new + # source + if self.get_source_code == True and not type.endswith("-src"): + sources_list.add("%s-src" % type, uri, dist, comps, comment, + file=new_source.file, + pos=sources_list.list.index(new_source)+1) class SoftwareProperties(SimpleGladeApp): @@ -225,9 +249,14 @@ class SoftwareProperties(SimpleGladeApp): cell = gtk.CellRendererText() self.combobox_server.pack_start(cell, True) self.combobox_server.add_attribute(cell, 'text', 0) - - #self.gnome_program = gnome.init("Software Properties", "0.41") - #self.gconfclient = gconf.client_get_default() + + # set up the handler id for the callbacks + self.handler_server_changed = self.combobox_server.connect("changed", + self.on_combobox_server_changed) + self.handler_source_code_changed = self.checkbutton_source_code.connect( + "toggled", + self.on_checkbutton_source_code_toggled + ) if parent: self.window_main.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) @@ -415,28 +444,41 @@ class SoftwareProperties(SimpleGladeApp): else: self.checkbutton_cdrom.set_active(False) - # FIXME: needs inconsistence + # Intiate the combobox which allows do specify a server for all + # distro related sources if self.distribution.use_internet == True: self.checkbutton_internet.set_active(True) self.combobox_server.set_property("sensitive", True) else: self.checkbutton_internet.set_active(False) self.combobox_server.set_property("sensitive", False) + self.combobox_server.handler_block(self.handler_server_changed) server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) self.combobox_server.set_model(server_store) - # load the mirror list in to the combo and select the one of the first - # main source - server_store.append([_("%s (default)") % self.distribution.main_server, + server_store.append([_("Main server"), self.distribution.main_server]) - server_store.append([_("%s (nearest)") % self.distribution.nearest_server, - self.distribution.main_server]) - for server in self.distribution.other_servers: - server_store.append(["%s" % server, server]) - # FIXME: which one to choose? - self.combobox_server.set_active(0) - self.combobox_server.connect("changed", self.on_combobox_server_changed) + server_store.append([_("Server for %s") % gettext.dgettext("iso-3166", + self.distribution.country).rstrip(), + self.distribution.nearest_server]) + if len(self.distribution.used_servers) > 0: + for server in self.distribution.used_servers: + if not re.match(server, self.distribution.main_server) and \ + not re.match(server, self.distribution.nearest_server): + server_store.append(["%s" % server, server]) + if len(self.distribution.used_servers) > 1: + server_store.append([_("Custom servers"), None]) + self.combobox_server.set_active(2) + elif self.distribution.used_servers[0] == self.distribution.main_server: + self.combobox_server.set_active(0) + elif self.distribution.used_servers[0] == self.distribution.nearest_server: + self.combobox_server.set_active(1) + else: + self.combobox_server.set_active(0) + + self.combobox_server.handler_unblock(self.handler_server_changed) # Check for source code sources + self.checkbutton_source_code.handler_block(self.handler_source_code_changed) self.checkbutton_source_code.set_inconsistent(False) if len(self.distribution.source_code_sources) < 1: # we don't have any source code sources, so @@ -455,7 +497,8 @@ class SoftwareProperties(SimpleGladeApp): sources.extend(self.distribution.child_sources) for source in sources: if templates.has_key(source.template): - templates[source.template] += set(source.comps) + for comp in source.comps: + templates[source.template].add(comp) else: templates[source.template] = set(source.comps) # add fake http sources for the cdrom, since the sources @@ -468,14 +511,29 @@ class SoftwareProperties(SimpleGladeApp): for source in self.distribution.source_code_sources: if not templates.has_key(source.template) or \ (templates.has_key(source.template) and \ - len(set(templates[source.template]) ^ set(source.comps)) > 0): + len(set(templates[source.template]) ^ set(source.comps)) != 0): self.checkbutton_source_code.set_inconsistent(True) self.distribution.get_source_code = False break - self.checkbutton_source_code.connect("toggled", - self.on_checkbutton_source_code_toggled) + self.checkbutton_source_code.handler_unblock(self.handler_source_code_changed) + def on_combobox_server_changed(self, combobox): - print "FIXME" + """ + Replace the servers used by the main and update sources with + the selected one + """ + server_store = combobox.get_model() + iter = combobox.get_active_iter() + uri_selected = server_store.get_value(iter, 1) + sources = [] + sources.extend(self.distribution.main_sources) + sources.extend(self.distribution.child_sources) + sources.extend(self.distribution.source_code_sources) + for source in sources: + # FIXME: ugly + if not "security.ubuntu.com" in source.uri: + source.uri = uri_selected + self.massive_debug_output() def on_component_toggled(self, checkbutton, comp): """ @@ -489,11 +547,12 @@ class SoftwareProperties(SimpleGladeApp): # check if there is a main source at all if len(self.distribution.main_sources) < 1: # create a new main source - self.distribution.add_source(self.sourceslist, comps=[comp]) - # add the comp to all main, child and source code sources - for source in sources: - if comp not in source.comps: - source.comps.append(comp) + self.distribution.add_source(self.sourceslist, comps=["%s"%comp]) + else: + # add the comp to all main, child and source code sources + for source in sources: + if comp not in source.comps: + source.comps.append(comp) if self.distribution.get_source_code == True: for source in self.distribution.source_code_sources: if comp not in source.comps: source.comps.append(comp) @@ -549,13 +608,17 @@ class SoftwareProperties(SimpleGladeApp): source.uri, source.dist, source.comps, - "Added by software-properties") + "Added by software-properties", + self.sourceslist.list.index(source)+1, + source.file) for source in self.distribution.cdrom_sources: self.sourceslist.add("deb-src", self.distribution.source_template.base_uri, self.distribution.source_template.name, source.comps, - "Added by software-properties") + "Added by software-properties", + self.sourceslist.list.index(source)+1, + source.file) self.massive_debug_output() def open_file(self, file): @@ -735,7 +798,8 @@ class SoftwareProperties(SimpleGladeApp): for source in self.sourceslist.list: if not source.invalid and\ ((source not in self.distribution.main_sources and\ - source not in self.distribution.child_sources) or\ + source not in self.distribution.child_sources and\ + source not in self.distribution.disabled_sources) or\ source in self.distribution.cdrom_sources) and\ source not in self.distribution.source_code_sources: self.sourceslist_visible.append(source) diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index fc08fb12..f96bd959 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -30,6 +30,8 @@ import shutil import time import os.path +import pdb + from UpdateManager.Common.DistInfo import DistInfo @@ -64,12 +66,8 @@ def is_mirror(master_uri, compare_uri): return False def uniq(s): - """ simple (and not efficient) way to return uniq list """ - u = [] - for x in s: - if x not in u: - u.append(x) - return u + """ simple and efficient way to return uniq list """ + return list(set(s)) @@ -232,16 +230,29 @@ class SourcesList: yield entry raise StopIteration - def add(self, type, uri, dist, comps, comment="", pos=-1): - # if there is a repo with the same (type, uri, dist) just add the - # components - for i in self.list: - if i.type == type and is_mirror(uri,i.uri) and i.dist == dist: - comps = uniq(i.comps + comps) - # set to the old position and preserve comment - comment = i.comment - pos = self.list.index(i) - self.list.remove(i) + def add(self, type, uri, dist, comps, comment="", pos=-1, file=None): + """ + Add a new source to the sources.list. + The method will search for existing matching repos and will try to + reuse them as far as possible + """ + for source in self.list: + # if there is a repo with the same (type, uri, dist) just add the + # components + if source.disabled == False and source.invalid == False and \ + source.type == type and uri == source.uri and \ + source.dist == dist: + comps = uniq(source.comps + comps) + source.comps = comps + return source + # if there is a corresponding repo which is disabled, enable it + elif source.disabled == True and source.invalid == False and \ + source.type == type and uri == source.uri and \ + source.dist == dist and \ + len(set(source.comps) & set(comps)) == len(comps): + source.disabled = False + return source + # there isn't any matching source, so create a new line and parse it line = "%s %s %s" % (type,uri,dist) for c in comps: line = line + " " + c; @@ -249,8 +260,11 @@ class SourcesList: line = "%s #%s\n" %(line,comment) line = line + "\n" new_entry = SourceEntry(line) + if file != None: + new_entry.file = file self.matcher.match(new_entry) self.list.insert(pos, new_entry) + return source def remove(self, source_entry): self.list.remove(source_entry) diff --git a/debian/control b/debian/control index a4999f1a..af942223 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.6.2 Package: update-manager Architecture: all -Depends: ${python:Depends}, ${misc:Depends}, python, python-glade2, python-apt (>= 0.6.16.2), synaptic (>= 0.57.8), lsb-release, python-gnupginterface, unattended-upgrades, gksu +Depends: ${python:Depends}, ${misc:Depends}, python, python-glade2, python-apt (>= 0.6.16.2), synaptic (>= 0.57.8), lsb-release, python-gnupginterface, unattended-upgrades, gksu, iso-codes Recommends: python-gnome2 Description: GNOME application that manages apt updates This is the GNOME apt update manager. It checks for updates and lets the user -- cgit v1.2.3 From 880b57ed3239de18b942945aead95d18844c715e Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 21 Jul 2006 15:40:39 +0200 Subject: * move the cdroms of the current distro to its own treeview * add a popcon tab to the ui - only a fake currently * improve wording: replace free by OpenSource as suggested by Corey (still a lot to do) --- SoftwareProperties/SoftwareProperties.py | 118 +++++----- channels/Ubuntu.info.in | 18 +- data/SoftwareProperties.glade | 375 +++++++++++++++++++++++++------ 3 files changed, 378 insertions(+), 133 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index f9fb2c43..ec02edb3 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -124,8 +124,6 @@ class Distribution: self.source_code_sources = [] # location of the sources - self.cdrom_available = False - self.use_internet = False self.main_server = "" self.nearest_server = "" self.used_servers = [] @@ -199,11 +197,8 @@ class Distribution: # other used servers for medium in self.used_media: - if medium.startswith("cdrom:"): - self.cdrom_available = True - else: + if not medium.startswith("cdrom:"): # seems to be a network source - self.use_internet = True self.used_servers.append(medium) def add_source(self, sources_list, type=None, @@ -383,15 +378,16 @@ class SoftwareProperties(SimpleGladeApp): if self.file != None: self.open_file(file) + def distro_to_widgets(self): """ Represent the distro information in the user interface """ # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu - self.label_updates.set_label(_("%s Updates") % self.distribution.id) + self.label_updates.set_label("%s" % (_("%s Updates") %\ + self.distribution.id)) # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu - self.label_dist_software.set_label(_("%s Software") % self.distribution.id) - self.label_dist_name.set_label("%s" % self.distribution.description) + self.label_dist_name.set_label("%s" % self.distribution.description) # Setup the checkbuttons for the components for checkbutton in self.vbox_dist_comps.get_children(): @@ -437,21 +433,8 @@ class SoftwareProperties(SimpleGladeApp): else: self.vbox_updates.set_sensitive(True) - # setup the location - # FIXME: how to handle uncommented cdroms? - if self.distribution.cdrom_available == True: - self.checkbutton_cdrom.set_active(True) - else: - self.checkbutton_cdrom.set_active(False) - # Intiate the combobox which allows do specify a server for all # distro related sources - if self.distribution.use_internet == True: - self.checkbutton_internet.set_active(True) - self.combobox_server.set_property("sensitive", True) - else: - self.checkbutton_internet.set_active(False) - self.combobox_server.set_property("sensitive", False) self.combobox_server.handler_block(self.handler_server_changed) server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) self.combobox_server.set_model(server_store) @@ -503,11 +486,13 @@ class SoftwareProperties(SimpleGladeApp): templates[source.template] = set(source.comps) # add fake http sources for the cdrom, since the sources # for the cdrom are only available in the internet + pdb.set_trace() for source in self.distribution.cdrom_sources: + # FIXME: produces a key error if templates.has_key(self.distribution.source_template): templates[self.distribution.source_template] += set(source.comps) else: - templates[self.distribution.source_template] += set(source.comps) + templates[self.distribution.source_template] = set(source.comps) for source in self.distribution.source_code_sources: if not templates.has_key(source.template) or \ (templates.has_key(source.template) and \ @@ -517,6 +502,11 @@ class SoftwareProperties(SimpleGladeApp): break self.checkbutton_source_code.handler_unblock(self.handler_source_code_changed) + if len(self.cdrom_store) == 0: + self.treeview_cdroms.set_sensitive(False) + else: + self.treeview_cdroms.set_sensitive(True) + def on_combobox_server_changed(self, combobox): """ Replace the servers used by the main and update sources with @@ -533,7 +523,7 @@ class SoftwareProperties(SimpleGladeApp): # FIXME: ugly if not "security.ubuntu.com" in source.uri: source.uri = uri_selected - self.massive_debug_output() + self.modified_sourceslist() def on_component_toggled(self, checkbutton, comp): """ @@ -562,7 +552,7 @@ class SoftwareProperties(SimpleGladeApp): source.comps.remove(comp) if len(source.comps) < 1: self.sourceslist.remove(source) - self.massive_debug_output() + self.modified_sourceslist() def massive_debug_output(self): """ @@ -587,7 +577,7 @@ class SoftwareProperties(SimpleGladeApp): self.distribution.add_source(self.sourceslist, uri=template.base_uri, dist=template.name) - self.massive_debug_output() + self.modified_sourceslist() def on_checkbutton_source_code_toggled(self, checkbutton): """ @@ -619,7 +609,7 @@ class SoftwareProperties(SimpleGladeApp): "Added by software-properties", self.sourceslist.list.index(source)+1, source.file) - self.massive_debug_output() + self.modified_sourceslist() def open_file(self, file): """Show an confirmation for adding the channels of the specified file""" @@ -654,6 +644,12 @@ class SoftwareProperties(SimpleGladeApp): # STORE_SOURCE - the source entry object # STORE_SEPARATOR - if the entry is a separator # STORE_VISIBLE - if the entry is shown or hidden + self.cdrom_store = gtk.ListStore(gobject.TYPE_BOOLEAN, + gobject.TYPE_STRING, + gobject.TYPE_PYOBJECT, + gobject.TYPE_BOOLEAN, + gobject.TYPE_BOOLEAN) + self.treeview_cdroms.set_model(self.cdrom_store) self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, @@ -662,7 +658,6 @@ class SoftwareProperties(SimpleGladeApp): self.treeview_sources.set_model(self.source_store) self.treeview_sources.set_row_separator_func(self.is_separator, STORE_SEPARATOR) - #self.treeview_sources.set_rules_hint(False) cell_desc = gtk.CellRendererText() cell_desc.set_property("xpad", 2) @@ -674,7 +669,24 @@ class SoftwareProperties(SimpleGladeApp): cell_toggle = gtk.CellRendererToggle() cell_toggle.set_property("xpad", 2) cell_toggle.set_property("ypad", 2) - cell_toggle.connect('toggled', self.on_channel_toggled) + cell_toggle.connect('toggled', self.on_channel_toggled, self.cdrom_store) + col_active = gtk.TreeViewColumn(_("Active"), cell_toggle, + active=COLUMN_ACTIVE) + + self.treeview_cdroms.append_column(col_active) + self.treeview_cdroms.append_column(col_desc) + + cell_desc = gtk.CellRendererText() + cell_desc.set_property("xpad", 2) + cell_desc.set_property("ypad", 2) + col_desc = gtk.TreeViewColumn(_("Software Channel"), cell_desc, + markup=COLUMN_DESC) + col_desc.set_max_width(1000) + + cell_toggle = gtk.CellRendererToggle() + cell_toggle.set_property("xpad", 2) + cell_toggle.set_property("ypad", 2) + cell_toggle.connect('toggled', self.on_channel_toggled, self.source_store) col_active = gtk.TreeViewColumn(_("Active"), cell_toggle, active=COLUMN_ACTIVE) @@ -698,11 +710,12 @@ class SoftwareProperties(SimpleGladeApp): self.button_edit.set_sensitive(False) self.button_remove.set_sensitive(False) - def on_channel_toggled(self, cell_toggle, path): + def on_channel_toggled(self, cell_toggle, path, store): """Enable or disable the selected channel""" - iter = self.source_store.get_iter((int(path),)) - source_entry = self.source_store.get_value(iter, STORE_SOURCE) + iter = store.get_iter((int(path),)) + source_entry = store.get_value(iter, STORE_SOURCE) source_entry.disabled = not source_entry.disabled + store.set_value(iter, STORE_ACTIVE, not source_entry.disabled) self.modified_sourceslist() def init_keyslist(self): @@ -726,10 +739,10 @@ class SoftwareProperties(SimpleGladeApp): def modified_sourceslist(self): """The sources list was changed and now needs to be saved and reloaded""" - self.button_revert.set_sensitive(True) - self.sourceslist.check_for_endangered_dists() - self.save_sourceslist() - self.reload_sourceslist() + self.massive_debug_output() + #self.button_revert.set_sensitive(True) + #self.save_sourceslist() + #self.reload_sourceslist() self.modified = True def render_source(self, source): @@ -790,24 +803,27 @@ class SoftwareProperties(SimpleGladeApp): def reload_sourceslist(self): (path_x, path_y) = self.treeview_sources.get_cursor() self.source_store.clear() + self.cdrom_store.clear() self.sourceslist.refresh() self.sourceslist_visible=[] self.distribution.get_sources(self.sourceslist) # Only show sources that are no binary or source code repos for # the current distribution, but show cdrom based repos for source in self.sourceslist.list: - if not source.invalid and\ - ((source not in self.distribution.main_sources and\ - source not in self.distribution.child_sources and\ - source not in self.distribution.disabled_sources) or\ - source in self.distribution.cdrom_sources) and\ - source not in self.distribution.source_code_sources: - self.sourceslist_visible.append(source) + if not source.invalid and\ + (source not in self.distribution.main_sources and\ + source not in self.distribution.child_sources and\ + source not in self.distribution.disabled_sources) and\ + source not in self.distribution.source_code_sources: + self.sourceslist_visible.append(source) + elif not source.invalid and source in self.distribution.cdrom_sources: + contents = self.render_source(source) + self.cdrom_store.append([not source.disabled, contents, + source, False, True]) # Sort the sources list self.sourceslist_visible.sort(key=self.get_comparable) - dist_first = False for source in self.sourceslist_visible: contents = self.render_source(source) @@ -1086,13 +1102,13 @@ class SoftwareProperties(SimpleGladeApp): self.reload_sourceslist() self.modified = True - def on_channel_toggled(self, cell_toggle, path): - """Enable or disable the selected channel""" - iter = self.source_store.get_iter((int(path),)) - source_entry = self.source_store.get_value(iter, LIST_ENTRY_OBJ) - source_entry.disabled = not source_entry.disabled - self.reload_sourceslist() - self.modified = True + # def on_channel_toggled(self, cell_toggle, path, store): + # """Enable or disable the selected channel""" + # iter = store.get_iter((int(path),)) + # source_entry = store.get_value(iter, LIST_ENTRY_OBJ) + # source_entry.disabled = not source_entry.disabled + # self.reload_sourceslist() + # self.modified = True # FIXME: move this into a different file class GtkCdromProgress(apt.progress.CdromProgress, SimpleGladeApp): diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in index f92d8b8b..e01a9221 100644 --- a/channels/Ubuntu.info.in +++ b/channels/Ubuntu.info.in @@ -4,19 +4,19 @@ Suite: dapper RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.04 'Dapper Drake' +_Description: Ubuntu 6.06 'Dapper Drake' Component: main Enabled: 1 _CompDescription: Officially supported -_CompDescriptionLong: Free software that is officially supported by Canonical Ltd. (main) +_CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) Component: universe Enabled: 0 _CompDescription: Community maintained (universe) -_CompDescriptionLong: Free software that is maintained by the community (universe) +_CompDescriptionLong: OpenSource software that is maintained by the community (universe) Component: restricted Enabled: 1 _CompDescription: Non-free drivers -_CompDescriptionLong: Non-free drivers for devices (restricted) +_CompDescriptionLong: Proprietary drivers for devices (restricted) Component: multiverse Enabled: 0 _CompDescription: Restricted software (Multiverse) @@ -24,8 +24,8 @@ _CompDescriptionLong: Software that is restricted by copyright or legal issues ( Suite: dapper MatchName: .* -BaseURI: cdrom:\[Ubuntu.*6.04 -_Description: Cdrom with Ubuntu 6.04 'Dapper Drake' +BaseURI: cdrom:\[Ubuntu.*6.06 +_Description: Cdrom with Ubuntu 6.06 'Dapper Drake' Available: False Component: main Enabled: 1 @@ -39,21 +39,21 @@ ParentSuite: dapper RepositoryType: deb BaseURI: http://security.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -_Description: Ubuntu 6.04 Security Updates +_Description: Important security updates Suite: dapper-updates ParentSuite: dapper RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.04 Updates +_Description: Recommended updates Suite: dapper-backports ParentSuite: dapper RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.04 Backports +_Description: Backported updates Suite: dapper-backports RepositoryType: deb diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 5aa5ee5c..b0ab7144 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -5,8 +5,6 @@ 6 - 620 - 400 Software Sources GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER @@ -72,17 +70,26 @@ 18 - + True False 6 - - + + True + False + 6 - - + + + + + + 0 + True + True + @@ -99,7 +106,7 @@ True - + <b>Downloadable software</b> False True GTK_JUSTIFY_LEFT @@ -127,14 +134,14 @@ - + True 0 0.5 GTK_SHADOW_NONE - + True 0.5 0.5 @@ -146,26 +153,59 @@ 0 - + True False 6 - - True - CD-ROM/DVD - True - GTK_RELIEF_NORMAL - True - False - False - True + + True + False + 12 + + + + True + Download from: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + 0 False - False + True @@ -187,43 +227,89 @@ False + + + + + + + + True + <b>Download options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 - + + 75 True - False - 12 + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT - + + 109 True True - Download software from the Internet: - True - GTK_RELIEF_NORMAL - True - False - False - True + False + True + False + True + False + False + False - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - @@ -238,9 +324,9 @@ - + True - <b>Options</b> + <b>CDROM/DVD</b> False True GTK_JUSTIFY_LEFT @@ -262,7 +348,7 @@ 0 - False + True True @@ -274,7 +360,7 @@ - + True False @@ -345,7 +431,7 @@ - + True <b>Internet Updates</b> False @@ -627,9 +713,9 @@ - + True - + Internet Updates False False GTK_JUSTIFY_LEFT @@ -793,7 +879,7 @@ True - Additional Software + Third Party False False GTK_JUSTIFY_LEFT @@ -857,15 +943,77 @@ 6 - + True - Restore the default keys of your distribution + Import the public key from a trusted software provider True - Restore _Defaults - True GTK_RELIEF_NORMAL True - + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Import Key File + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 0 @@ -875,14 +1023,15 @@ - + True + Restore the default keys of your distribution True - gtk-remove - True + Restore _Defaults + True GTK_RELIEF_NORMAL True - + 0 @@ -893,21 +1042,19 @@ - + True - Import the public key from a trusted software provider True - _Import Key File - True + gtk-remove + True GTK_RELIEF_NORMAL True - + 0 False False - GTK_PACK_END @@ -946,6 +1093,88 @@ tab + + + + 12 + True + False + 6 + + + + True + <i>Please take part in the popularity contest, to improve the user experience of Ubuntu. Therefor the following data will be collected and sent to the Ubuntu project anonymously on a weekly basis: the list of installed software and how often it was used. + +The results are used to improve the support for popular applications and to rank applications in the search results.</i> + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + Submit statistical information to Ubuntu + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + False + True + + + + + + True + Statistics + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + 0 -- cgit v1.2.3 From ea2c5c8a8ea54060b7292775d9e8ceb7085235af Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 21 Jul 2006 17:11:10 +0200 Subject: * rearrange download section in the user interface * fix some bugs because of the cdrom /download sources separation --- SoftwareProperties/SoftwareProperties.py | 31 +++-- SoftwareProperties/aptsources.py | 2 +- data/SoftwareProperties.glade | 204 ++++++++++++------------------- 3 files changed, 102 insertions(+), 135 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index ec02edb3..9bc19cdd 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -118,7 +118,9 @@ class Distribution: self.main_sources = [] self.disabled_sources = [] self.cdrom_sources = [] + self.download_comps = [] self.enabled_comps = [] + self.cdrom_comps = [] self.used_media = [] self.get_source_code = False self.source_code_sources = [] @@ -144,6 +146,8 @@ class Distribution: # find main and child sources media = [] comps = [] + cdrom_comps = [] + enabled_comps = [] source_code = [] for source in sources_list.list: if source.invalid == False and\ @@ -154,7 +158,8 @@ class Distribution: # cdroms need do be handled differently if source.uri.startswith("cdrom:"): self.cdrom_sources.append(source) - if source.type == "deb" and source.disabled == False: + cdrom_comps.extend(source.comps) + elif source.type == "deb" and source.disabled == False: self.main_sources.append(source) comps.extend(source.comps) media.append(source.uri) @@ -170,7 +175,11 @@ class Distribution: self.child_sources.append(source) elif source.type == "deb-src": self.source_code_sources.append(source) - self.enabled_comps = set(comps) + self.download_comps = set(comps) + self.cdrom_comps = set(cdrom_comps) + enabled_comps.extend(comps) + enabled_comps.extend(cdrom_comps) + self.enabled_comps = set(enabled_comps) self.used_media = set(media) self.get_mirrors() @@ -271,8 +280,6 @@ class SoftwareProperties(SimpleGladeApp): self.window_main.show() - # internet update setings - # this maps the key (combo-box-index) to the auto-update-interval value # where (-1) means, no key self.combobox_interval_mapping = { 0 : 1, @@ -384,7 +391,7 @@ class SoftwareProperties(SimpleGladeApp): Represent the distro information in the user interface """ # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu - self.label_updates.set_label("%s" % (_("%s Updates") %\ + self.label_updates.set_label("%s" % (_("%s updates") %\ self.distribution.id)) # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu self.label_dist_name.set_label("%s" % self.distribution.description) @@ -396,7 +403,7 @@ class SoftwareProperties(SimpleGladeApp): checkbox = gtk.CheckButton(label=self.distribution.source_template.components[comp][2]) # check if the comp is enabled # FIXME: use inconsistence if there are main sources with not all comps - if comp in self.distribution.enabled_comps: + if comp in self.distribution.download_comps: checkbox.set_active(True) # setup the callback and show the checkbutton checkbox.connect("toggled", self.on_component_toggled, comp) @@ -486,7 +493,6 @@ class SoftwareProperties(SimpleGladeApp): templates[source.template] = set(source.comps) # add fake http sources for the cdrom, since the sources # for the cdrom are only available in the internet - pdb.set_trace() for source in self.distribution.cdrom_sources: # FIXME: produces a key error if templates.has_key(self.distribution.source_template): @@ -533,6 +539,7 @@ class SoftwareProperties(SimpleGladeApp): sources = [] sources.extend(self.distribution.main_sources) sources.extend(self.distribution.child_sources) + sources.extend(self.distribution.source_code_sources) if checkbutton.get_active() == True: # check if there is a main source at all if len(self.distribution.main_sources) < 1: @@ -547,6 +554,10 @@ class SoftwareProperties(SimpleGladeApp): for source in self.distribution.source_code_sources: if comp not in source.comps: source.comps.append(comp) else: + if comp in self.distribution.cdrom_comps: + sources = [] + sources.extend(self.distribution.main_sources) + for source in sources: if comp in source.comps: source.comps.remove(comp) @@ -562,8 +573,6 @@ class SoftwareProperties(SimpleGladeApp): for source in self.sourceslist: print source.str() print "END SOURCES.LIST\n" - self.distribution.get_sources(self.sourceslist) - self.distro_to_widgets() def on_checkbutton_child_toggled(self, checkbutton, template): """ @@ -712,6 +721,7 @@ class SoftwareProperties(SimpleGladeApp): def on_channel_toggled(self, cell_toggle, path, store): """Enable or disable the selected channel""" + #FIXME cdroms need to disable the comps in the childs and sources iter = store.get_iter((int(path),)) source_entry = store.get_value(iter, STORE_SOURCE) source_entry.disabled = not source_entry.disabled @@ -744,6 +754,8 @@ class SoftwareProperties(SimpleGladeApp): #self.save_sourceslist() #self.reload_sourceslist() self.modified = True + self.distribution.get_sources(self.sourceslist) + self.distro_to_widgets() def render_source(self, source): """Render a nice output to show the source in a treeview""" @@ -812,6 +824,7 @@ class SoftwareProperties(SimpleGladeApp): for source in self.sourceslist.list: if not source.invalid and\ (source not in self.distribution.main_sources and\ + source not in self.distribution.cdrom_sources and\ source not in self.distribution.child_sources and\ source not in self.distribution.disabled_sources) and\ source not in self.distribution.source_code_sources: diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index f96bd959..4e76824d 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -264,7 +264,7 @@ class SourcesList: new_entry.file = file self.matcher.match(new_entry) self.list.insert(pos, new_entry) - return source + return new_entry def remove(self, source_entry): self.list.remove(source_entry) diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index b0ab7144..b541ab65 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -76,13 +76,45 @@ 6 - + True False 6 - + + True + False + 6 + + + + + + + 0 + True + True + + + + + + True + True + Source code + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + @@ -91,109 +123,50 @@ True - - - 0 - True - True - - - - - - - - - - True - <b>Downloadable software</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 - - - - True - False - 6 - - - - True - False - 12 - + True - Download from: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + False + 12 - - - True - False - True + + + True + Download from: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + 0 @@ -204,38 +177,19 @@ 0 - False + True True - - - - True - True - Source code - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - + True - <b>Download options</b> + <b>Downloadable software</b> False True GTK_JUSTIFY_LEFT @@ -433,7 +387,7 @@ True - <b>Internet Updates</b> + <b>Internet updates</b> False True GTK_JUSTIFY_LEFT @@ -679,7 +633,7 @@ True - <b>Automatic Updates</b> + <b>Automatic updates</b> False True GTK_JUSTIFY_LEFT -- cgit v1.2.3 From b0391ead1648a93222ba3e83f718c5659cfbb8f4 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 21 Jul 2006 17:15:42 +0200 Subject: * replace self.distribution by self.distro --- SoftwareProperties/SoftwareProperties.py | 124 +++++++++++++++---------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 9bc19cdd..38b83d32 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -249,7 +249,7 @@ class SoftwareProperties(SimpleGladeApp): self.file = file - self.distribution = Distribution() + self.distro = Distribution() cell = gtk.CellRendererText() self.combobox_server.pack_start(cell, True) self.combobox_server.add_attribute(cell, 'text', 0) @@ -392,18 +392,18 @@ class SoftwareProperties(SimpleGladeApp): """ # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu self.label_updates.set_label("%s" % (_("%s updates") %\ - self.distribution.id)) + self.distro.id)) # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu - self.label_dist_name.set_label("%s" % self.distribution.description) + self.label_dist_name.set_label("%s" % self.distro.description) # Setup the checkbuttons for the components for checkbutton in self.vbox_dist_comps.get_children(): self.vbox_dist_comps.remove(checkbutton) - for comp in self.distribution.source_template.components.keys(): - checkbox = gtk.CheckButton(label=self.distribution.source_template.components[comp][2]) + for comp in self.distro.source_template.components.keys(): + checkbox = gtk.CheckButton(label=self.distro.source_template.components[comp][2]) # check if the comp is enabled # FIXME: use inconsistence if there are main sources with not all comps - if comp in self.distribution.download_comps: + if comp in self.distro.download_comps: checkbox.set_active(True) # setup the callback and show the checkbutton checkbox.connect("toggled", self.on_component_toggled, comp) @@ -413,17 +413,17 @@ class SoftwareProperties(SimpleGladeApp): # Setup the checkbuttons for the child repos / updates for checkbutton in self.vbox_updates.get_children(): self.vbox_updates.remove(checkbutton) - for template in self.distribution.source_template.children: + for template in self.distro.source_template.children: checkbox = gtk.CheckButton(label=template.description) - for child in self.distribution.child_sources: + 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.distribution.enabled_comps) == 0: + if len(set(child.comps) - self.distro.enabled_comps) == 0: checkbox.set_active(True) else: checkbox.set_active(False) - if len(self.distribution.enabled_comps ^ set(child.comps)) > 0: + 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 @@ -435,7 +435,7 @@ class SoftwareProperties(SimpleGladeApp): self.vbox_updates.add(checkbox) checkbox.show() - if len(self.distribution.enabled_comps) < 1: + if len(self.distro.enabled_comps) < 1: self.vbox_updates.set_sensitive(False) else: self.vbox_updates.set_sensitive(True) @@ -446,21 +446,21 @@ class SoftwareProperties(SimpleGladeApp): server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) self.combobox_server.set_model(server_store) server_store.append([_("Main server"), - self.distribution.main_server]) + self.distro.main_server]) server_store.append([_("Server for %s") % gettext.dgettext("iso-3166", - self.distribution.country).rstrip(), - self.distribution.nearest_server]) - if len(self.distribution.used_servers) > 0: - for server in self.distribution.used_servers: - if not re.match(server, self.distribution.main_server) and \ - not re.match(server, self.distribution.nearest_server): + self.distro.country).rstrip(), + self.distro.nearest_server]) + if len(self.distro.used_servers) > 0: + for server in self.distro.used_servers: + if not re.match(server, self.distro.main_server) and \ + not re.match(server, self.distro.nearest_server): server_store.append(["%s" % server, server]) - if len(self.distribution.used_servers) > 1: + if len(self.distro.used_servers) > 1: server_store.append([_("Custom servers"), None]) self.combobox_server.set_active(2) - elif self.distribution.used_servers[0] == self.distribution.main_server: + elif self.distro.used_servers[0] == self.distro.main_server: self.combobox_server.set_active(0) - elif self.distribution.used_servers[0] == self.distribution.nearest_server: + elif self.distro.used_servers[0] == self.distro.nearest_server: self.combobox_server.set_active(1) else: self.combobox_server.set_active(0) @@ -470,21 +470,21 @@ class SoftwareProperties(SimpleGladeApp): # Check for source code sources self.checkbutton_source_code.handler_block(self.handler_source_code_changed) self.checkbutton_source_code.set_inconsistent(False) - if len(self.distribution.source_code_sources) < 1: + if len(self.distro.source_code_sources) < 1: # we don't have any source code sources, so # uncheck the button self.checkbutton_source_code.set_active(False) - self.distribution.get_source_code = False + self.distro.get_source_code = False else: # there are source code sources, so we check the button self.checkbutton_source_code.set_active(True) - self.distribution.get_source_code = True + self.distro.get_source_code = True # check if there is a corresponding source code source for # every binary source. if not set the checkbutton to inconsistent templates = {} sources = [] - sources.extend(self.distribution.main_sources) - sources.extend(self.distribution.child_sources) + sources.extend(self.distro.main_sources) + sources.extend(self.distro.child_sources) for source in sources: if templates.has_key(source.template): for comp in source.comps: @@ -493,18 +493,18 @@ class SoftwareProperties(SimpleGladeApp): templates[source.template] = set(source.comps) # add fake http sources for the cdrom, since the sources # for the cdrom are only available in the internet - for source in self.distribution.cdrom_sources: + for source in self.distro.cdrom_sources: # FIXME: produces a key error - if templates.has_key(self.distribution.source_template): - templates[self.distribution.source_template] += set(source.comps) + if templates.has_key(self.distro.source_template): + templates[self.distro.source_template] += set(source.comps) else: - templates[self.distribution.source_template] = set(source.comps) - for source in self.distribution.source_code_sources: + templates[self.distro.source_template] = set(source.comps) + for source in self.distro.source_code_sources: if not templates.has_key(source.template) or \ (templates.has_key(source.template) and \ len(set(templates[source.template]) ^ set(source.comps)) != 0): self.checkbutton_source_code.set_inconsistent(True) - self.distribution.get_source_code = False + self.distro.get_source_code = False break self.checkbutton_source_code.handler_unblock(self.handler_source_code_changed) @@ -522,9 +522,9 @@ class SoftwareProperties(SimpleGladeApp): iter = combobox.get_active_iter() uri_selected = server_store.get_value(iter, 1) sources = [] - sources.extend(self.distribution.main_sources) - sources.extend(self.distribution.child_sources) - sources.extend(self.distribution.source_code_sources) + sources.extend(self.distro.main_sources) + sources.extend(self.distro.child_sources) + sources.extend(self.distro.source_code_sources) for source in sources: # FIXME: ugly if not "security.ubuntu.com" in source.uri: @@ -537,26 +537,26 @@ class SoftwareProperties(SimpleGladeApp): child sources and source code sources """ sources = [] - sources.extend(self.distribution.main_sources) - sources.extend(self.distribution.child_sources) - sources.extend(self.distribution.source_code_sources) + sources.extend(self.distro.main_sources) + sources.extend(self.distro.child_sources) + sources.extend(self.distro.source_code_sources) if checkbutton.get_active() == True: # check if there is a main source at all - if len(self.distribution.main_sources) < 1: + if len(self.distro.main_sources) < 1: # create a new main source - self.distribution.add_source(self.sourceslist, comps=["%s"%comp]) + self.distro.add_source(self.sourceslist, comps=["%s"%comp]) else: # add the comp to all main, child and source code sources for source in sources: if comp not in source.comps: source.comps.append(comp) - if self.distribution.get_source_code == True: - for source in self.distribution.source_code_sources: + if self.distro.get_source_code == True: + for source in self.distro.source_code_sources: if comp not in source.comps: source.comps.append(comp) else: - if comp in self.distribution.cdrom_comps: + if comp in self.distro.cdrom_comps: sources = [] - sources.extend(self.distribution.main_sources) + sources.extend(self.distro.main_sources) for source in sources: if comp in source.comps: @@ -579,11 +579,11 @@ class SoftwareProperties(SimpleGladeApp): Enable or disable a child repo of the distribution main repository """ if checkbutton.get_active() == False: - for source in self.distribution.child_sources: + for source in self.distro.child_sources: if source.template == template: self.sourceslist.remove(source) else: - self.distribution.add_source(self.sourceslist, + self.distro.add_source(self.sourceslist, uri=template.base_uri, dist=template.name) self.modified_sourceslist() @@ -592,13 +592,13 @@ class SoftwareProperties(SimpleGladeApp): """ Disable or enable the source code for all sources """ - self.distribution.get_source_code = checkbutton.get_active() + self.distro.get_source_code = checkbutton.get_active() sources = [] - sources.extend(self.distribution.main_sources) - sources.extend(self.distribution.child_sources) + sources.extend(self.distro.main_sources) + sources.extend(self.distro.child_sources) # remove all exisiting sources - for source in self.distribution.source_code_sources: + for source in self.distro.source_code_sources: self.sourceslist.remove(source) if checkbutton.get_active() == True: @@ -610,10 +610,10 @@ class SoftwareProperties(SimpleGladeApp): "Added by software-properties", self.sourceslist.list.index(source)+1, source.file) - for source in self.distribution.cdrom_sources: + for source in self.distro.cdrom_sources: self.sourceslist.add("deb-src", - self.distribution.source_template.base_uri, - self.distribution.source_template.name, + self.distro.source_template.base_uri, + self.distro.source_template.name, source.comps, "Added by software-properties", self.sourceslist.list.index(source)+1, @@ -754,7 +754,7 @@ class SoftwareProperties(SimpleGladeApp): #self.save_sourceslist() #self.reload_sourceslist() self.modified = True - self.distribution.get_sources(self.sourceslist) + self.distro.get_sources(self.sourceslist) self.distro_to_widgets() def render_source(self, source): @@ -801,7 +801,7 @@ class SoftwareProperties(SimpleGladeApp): if source.template: has_template = 0 desc = source.template.description - if source.template.distribution == self.distribution: + if source.template.distribution == self.distro: cur_sys = 0 else: desc = "%s %s %s" % (source.uri, source.dist, source.comps) @@ -818,18 +818,18 @@ class SoftwareProperties(SimpleGladeApp): self.cdrom_store.clear() self.sourceslist.refresh() self.sourceslist_visible=[] - self.distribution.get_sources(self.sourceslist) + self.distro.get_sources(self.sourceslist) # Only show sources that are no binary or source code repos for # the current distribution, but show cdrom based repos for source in self.sourceslist.list: if not source.invalid and\ - (source not in self.distribution.main_sources and\ - source not in self.distribution.cdrom_sources and\ - source not in self.distribution.child_sources and\ - source not in self.distribution.disabled_sources) and\ - source not in self.distribution.source_code_sources: + (source not in self.distro.main_sources and\ + source not in self.distro.cdrom_sources and\ + source not in self.distro.child_sources and\ + source not in self.distro.disabled_sources) and\ + source not in self.distro.source_code_sources: self.sourceslist_visible.append(source) - elif not source.invalid and source in self.distribution.cdrom_sources: + elif not source.invalid and source in self.distro.cdrom_sources: contents = self.render_source(source) self.cdrom_store.append([not source.disabled, contents, source, False, True]) -- cgit v1.2.3 From ddb439217cc1c348df47752a0d7942d3841f22a7 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 21 Jul 2006 18:07:21 +0200 Subject: * do add the comps of a disabled cd to enabled_comps * fix the inconsistent state of the source code button if cdroms are used --- SoftwareProperties/SoftwareProperties.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 38b83d32..87a9aaad 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -156,9 +156,13 @@ class Distribution: source.template.name == self.codename: #print "yeah! found a distro repo: %s" % source.line # cdroms need do be handled differently - if source.uri.startswith("cdrom:"): + if source.uri.startswith("cdrom:") and \ + source.disabled == False: self.cdrom_sources.append(source) cdrom_comps.extend(source.comps) + elif source.uri.startswith("cdrom:") and \ + source.disabled == True: + self.cdrom_sources.append(source) elif source.type == "deb" and source.disabled == False: self.main_sources.append(source) comps.extend(source.comps) @@ -493,16 +497,13 @@ class SoftwareProperties(SimpleGladeApp): templates[source.template] = set(source.comps) # add fake http sources for the cdrom, since the sources # for the cdrom are only available in the internet - for source in self.distro.cdrom_sources: - # FIXME: produces a key error - if templates.has_key(self.distro.source_template): - templates[self.distro.source_template] += set(source.comps) - else: - templates[self.distro.source_template] = set(source.comps) + if len(self.distro.cdrom_sources) > 0: + templates[self.distro.source_template] = self.distro.cdrom_comps for source in self.distro.source_code_sources: if not templates.has_key(source.template) or \ - (templates.has_key(source.template) and \ - len(set(templates[source.template]) ^ set(source.comps)) != 0): + (templates.has_key(source.template) and not \ + (len(set(templates[source.template]) ^ set(source.comps)) == 0\ + or (len(set(source.comps) ^ self.distro.enabled_comps) == 0))): self.checkbutton_source_code.set_inconsistent(True) self.distro.get_source_code = False break -- cgit v1.2.3 From 14d80b531b3b1d7e2f13003c9d04cf428b6df1b7 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 21 Jul 2006 19:11:31 +0200 Subject: * WRITE ALL CHANGES TO THE SOURCES.LIST!!! * fix the add, remove and edit buttons on the third party tab * minor fixes and clean ups * wording: channel -> source --- SoftwareProperties/SoftwareProperties.py | 52 +++--- SoftwareProperties/dialog_add.py | 185 ++++--------------- data/SoftwareProperties.glade | 1 - data/SoftwarePropertiesDialogs.glade | 297 +------------------------------ 4 files changed, 65 insertions(+), 470 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 87a9aaad..14e570b9 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -751,12 +751,10 @@ class SoftwareProperties(SimpleGladeApp): def modified_sourceslist(self): """The sources list was changed and now needs to be saved and reloaded""" self.massive_debug_output() - #self.button_revert.set_sensitive(True) - #self.save_sourceslist() - #self.reload_sourceslist() self.modified = True - self.distro.get_sources(self.sourceslist) - self.distro_to_widgets() + #self.button_revert.set_sensitive(True) + self.save_sourceslist() + self.reload_sourceslist() def render_source(self, source): """Render a nice output to show the source in a treeview""" @@ -843,6 +841,13 @@ class SoftwareProperties(SimpleGladeApp): self.source_store.append([not source.disabled, contents, source, False, True]) + + if len(self.source_store) < 1: + self.button_remove.set_sensitive(False) + self.button_edit.set_sensitive(False) + else: + self.treeview_sources.set_cursor(0) + self.distro.get_sources(self.sourceslist) self.distro_to_widgets() def is_separator(self, model, iter, column): @@ -965,20 +970,14 @@ class SoftwareProperties(SimpleGladeApp): #shutil.copy(location, location + ".save") self.sourceslist.backup(".save") self.sourceslist.save() - # show a dialog that a reload of the channel information is required - # only if there is no parent defined - if self.modified == True and \ - self.options.toplevel == None: - d = dialog_cache_outdated.DialogCacheOutdated(self.window_main, - self.datadir) - res = d.run() def on_add_clicked(self, widget): dialog = dialog_add.dialog_add(self.window_main, self.sourceslist, self.datadir) - if dialog.run() == gtk.RESPONSE_OK: - self.reload_sourceslist() - self.modified = True + line = dialog.run() + if line != None: + self.sourceslist.list.append(aptsources.SourceEntry(line)) + self.modified_sourceslist() def on_edit_clicked(self, widget): sel = self.treeview_sources.get_selection() @@ -1024,14 +1023,14 @@ class SoftwareProperties(SimpleGladeApp): self.button_edit.set_sensitive(True) def on_remove_clicked(self, widget): - sel = self.treeview_sources.get_selection() - (model, iter) = sel.get_selected() + model = self.treeview_sources.get_model() + (path, column) = self.treeview_sources.get_cursor() + iter = model.get_iter(path) if iter: source = model.get_value(iter, LIST_ENTRY_OBJ) self.sourceslist.remove(source) - self.reload_sourceslist() - self.modified = True - + self.modified_sourceslist() + def add_key_clicked(self, widget): chooser = gtk.FileChooserDialog(title=_("Import key"), parent=self.window_main, @@ -1066,11 +1065,16 @@ class SoftwareProperties(SimpleGladeApp): self.reload_keyslist() def on_delete_event(self, widget, args): - self.save_sourceslist() - self.quit() - + self.on_close_button(self, widget) + def on_close_button(self, widget): - self.save_sourceslist() + # show a dialog that a reload of the channel information is required + # only if there is no parent defined + if self.modified == True and \ + self.options.toplevel == None: + d = dialog_cache_outdated.DialogCacheOutdated(self.window_main, + self.datadir) + res = d.run() self.quit() def on_help_button(self, widget): diff --git a/SoftwareProperties/dialog_add.py b/SoftwareProperties/dialog_add.py index b5fbe07f..81dd1cb2 100644 --- a/SoftwareProperties/dialog_add.py +++ b/SoftwareProperties/dialog_add.py @@ -6,7 +6,8 @@ # Authors: # Michael Vogt # Michiel Sikkes -# +# Sebastian Heinlein +# # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the @@ -29,167 +30,43 @@ import gtk.glade from gettext import gettext as _ import aptsources -import dialog_edit class dialog_add: - def __init__(self, parent, sourceslist, datadir, source_entry = None): + def __init__(self, parent, sourceslist, datadir): + """ + Initialize the dialog that allows to add a new source entering the + raw apt line + """ self.sourceslist = sourceslist self.parent = parent self.datadir = datadir - self.custom = False - # we have a source_entry that we want to modify - self.source_entry = source_entry - if source_entry: - self.source_entry_index = sourceslist.list.index(source_entry) - else: - self.source_entry_index = None - - # templates - self.templatelist = aptsources.SourceEntryTemplates(datadir) - - # FIXME: simple-glade-app should be able to do all this! - # gtk stuff - self.gladexml = gtk.glade.XML("%s/glade/SoftwarePropertiesDialogs.glade" % datadir) - - self.main = widget = self.gladexml.get_widget("dialog_add") - self.main.set_transient_for(self.parent) - - combo = self.gladexml.get_widget("combobox_what") - self.gladexml.signal_connect("on_combobox_what_changed", self.on_combobox_what_changed, None) - # combox box needs - cell = gtk.CellRendererText() - combo.pack_start(cell, True) - combo.add_attribute(cell, 'text', 0) - self.fill_combo(combo) - if source_entry: - self.main.set_title(_("Edit Channel")) - self.gladexml.get_widget("button_add").set_label("gtk-ok") - self.gladexml.signal_connect("on_button_custom_clicked", - self.on_button_custom_clicked, None) - + self.gladexml = gtk.glade.XML("%s/glade/SoftwarePropertiesDialogs.glade" %\ + datadir) + self.dialog = self.gladexml.get_widget("dialog_add_custom") + self.dialog.set_transient_for(self.parent) + self.entry = self.gladexml.get_widget("entry_source_line") + self.button_add = self.gladexml.get_widget("button_add_source") + self.entry.connect("changed", self.check_line) - def fill_combo(self,combo): - liststore = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_PYOBJECT) - matched_template = None - for item in self.templatelist.templates: - liststore.append((item.description, item)) - if self.source_entry and item.matches(self.source_entry): - matched_template = item - combo.set_model(liststore) - if matched_template: - try: - combo.set_active(self.templatelist.templates.index(matched_template)) - vbox = self.gladexml.get_widget("vbox_comps") - for c in vbox.get_children(): - c.set_active(c.get_data("name") in self.source_entry.comps) - except ValueError: - pass + def run(self): + res = self.dialog.run() + self.dialog.hide() + if res == gtk.RESPONSE_OK: + line = self.entry.get_text() + "\n" else: - combo.set_active(0) - - def on_combobox_what_changed(self, combobox, user): - #print "on_combobox_what_changed" - vbox = self.gladexml.get_widget("vbox_comps") - vbox.foreach(lambda widget,vbox: vbox.remove(widget), vbox) - liststore = combobox.get_model() - a_iter = liststore.iter_nth_child(None, combobox.get_active()) - (name, template) = liststore.get(a_iter, 0,1) - self.selected = template - comps = template.comps - for c in comps: - checkbox = gtk.CheckButton(c.description) - checkbox.set_active(c.on_by_default) - checkbox.set_data("name",c.name) - vbox.pack_start(checkbox) - checkbox.show() + line = None + return line - def on_button_custom_clicked(self, widget, data): - #print "on_button_custom_clicked()" - # this hide here is ugly :/ - self.main.hide() - # check if we are in add or edit-matched mode - if self.source_entry: - # we are in "edit" mode - # get the SourceEntry as it is now (with local changes) - # and display the "old" edit dialog - self.selected_comps = [] - vbox = self.gladexml.get_widget("vbox_comps") - vbox.foreach(self.get_enabled_comps) - source_entry = self._make_source_entry() - # 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 - 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() - if res == gtk.RESPONSE_CANCEL: - # restore original SourceEntry - self.sourceslist.list[self.source_entry_index] = self.source_entry - elif res == gtk.RESPONSE_OK: - # the sourceslist is allready updated, but we'll overwrite it - # in self.run if we're not carefull - self.custom = True + def check_line(self, *args): + """ + Check for a valid apt line and set the sensitiveness of the + button 'add' accordingly + """ + line = self.entry.get_text() + "\n" + source_entry = aptsources.SourceEntry(line) + if source_entry.invalid == True or source_entry.disabled == True: + self.button_add.set_sensitive(False) else: - # we are in "add" mode - dialog = self.gladexml.get_widget("dialog_add_custom") - dialog.set_transient_for(self.parent) - res = dialog.run() - dialog.hide() - entry = self.gladexml.get_widget("entry_source_line") - line = entry.get_text() + "\n" - self.sourceslist.list.append(aptsources.SourceEntry(line)) - self.main.response(res) + self.button_add.set_sensitive(True) - def get_enabled_comps(self, checkbutton): - if checkbutton.get_active(): - self.selected_comps.append(checkbutton.get_data("name")) - - def _make_source_entry(self): - " helper for the 'edit' mode " - # 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 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 - line += "\n" - return aptsources.SourceEntry(line,self.source_entry.file) - - def run(self): - res = self.main.run() - if res == gtk.RESPONSE_OK: - # add repository - 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 - # 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, - self.selected.uri, - self.selected.dist, - self.selected_comps) - self.main.hide() - return res diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index b541ab65..9c63fd52 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -803,7 +803,6 @@ - True True gtk-revert-to-saved True diff --git a/data/SoftwarePropertiesDialogs.glade b/data/SoftwarePropertiesDialogs.glade index 8c5b00c6..b381965b 100644 --- a/data/SoftwarePropertiesDialogs.glade +++ b/data/SoftwarePropertiesDialogs.glade @@ -3,292 +3,6 @@ - - 6 - Add Channel - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - False - True - True - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - _Custom - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - False - 6 - - - - True - <b>Channel</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - <b>Components</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - - - - - - - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - 6 @@ -331,8 +45,9 @@ - + True + False True True True @@ -379,7 +94,7 @@ True - _Add Channel + _Add Source True False GTK_JUSTIFY_LEFT @@ -449,9 +164,9 @@ True True - <big><b>Enter the complete APT line of the channel that you want to add</b></big> + <big><b>Enter the complete APT line of the source that you want to add</b></big> -The APT line includes the type, location and components of a channel, for example <i>"deb http://ftp.debian.org sarge main"</i>. +The APT line includes the type, location and components of a source, for example <i>"deb http://ftp.debian.org sarge main"</i>. False True GTK_JUSTIFY_LEFT @@ -549,7 +264,7 @@ The APT line includes the type, location and components of a channel, for exampl 6 - Edit Channel + Edit Source GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE True -- cgit v1.2.3 From faa8e24031b9dfb788aa51e50770b7f572f18e9d Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 21 Jul 2006 22:53:55 +0200 Subject: * Moved the Distribution class to aptsources * Added a command line option: --enable-component * Added a handler for the toggled popcon checkbutton --- SoftwareProperties/SoftwareProperties.py | 193 +-------------------------- SoftwareProperties/aptsources.py | 219 +++++++++++++++++++++++++++++-- data/SoftwareProperties.glade | 5 +- software-properties | 25 +++- 4 files changed, 233 insertions(+), 209 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 14e570b9..d920b693 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -73,170 +73,6 @@ CONF_MAP = { STORE_VISIBLE ) = range(5) -class Distribution: - def __init__(self): - """" - Container for distribution specific informations - """ - # LSB information - self.id = "" - self.codename = "" - self.description = "" - self.release = "" - - # get the LSB information - lsb_info = [] - for lsb_option in ["-i", "-c", "-d", "-r"]: - pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option) - lsb_info.append(pipe.read().strip()) - del pipe - (self.id, self.codename, self.description, self.release) = lsb_info - - # get a list of country codes and real names - self.countries = {} - try: - f = open("/usr/share/iso-codes/iso_3166.tab", "r") - lines = f.readlines() - for line in lines: - parts = line.split("\t") - self.countries[parts[0].lower()] = parts[1] - except: - print "could not open file '%s'" % file - else: - f.close() - - - - def get_sources(self, sources_list): - """ - Find the corresponding template, main and child sources - for the distribution - """ - # corresponding sources - self.source_template = None - self.child_sources = [] - self.main_sources = [] - self.disabled_sources = [] - self.cdrom_sources = [] - self.download_comps = [] - self.enabled_comps = [] - self.cdrom_comps = [] - self.used_media = [] - self.get_source_code = False - self.source_code_sources = [] - - # location of the sources - self.main_server = "" - self.nearest_server = "" - self.used_servers = [] - - # find the distro template - for template in sources_list.matcher.templates: - if template.name == self.codename and\ - template.distribution == self.id: - #print "yeah! found a template for %s" % self.description - #print template.description, template.base_uri, template.components - self.source_template = template - break - if self.source_template == None: - print "Error: could not find a distribution template" - # FIXME: will go away - only for debugging issues - sys.exit(1) - - # find main and child sources - media = [] - comps = [] - cdrom_comps = [] - enabled_comps = [] - source_code = [] - for source in sources_list.list: - if source.invalid == False and\ - source.dist == self.codename and\ - source.template and\ - source.template.name == self.codename: - #print "yeah! found a distro repo: %s" % source.line - # cdroms need do be handled differently - if source.uri.startswith("cdrom:") and \ - source.disabled == False: - self.cdrom_sources.append(source) - cdrom_comps.extend(source.comps) - elif source.uri.startswith("cdrom:") and \ - source.disabled == True: - self.cdrom_sources.append(source) - elif source.type == "deb" and source.disabled == False: - self.main_sources.append(source) - comps.extend(source.comps) - media.append(source.uri) - elif source.type == "deb" and source.disabled == True: - self.disabled_sources.append(source) - elif source.type.endswith("-src") and source.disabled == False: - self.source_code_sources.append(source) - elif source.type.endswith("-src") and source.disabled == True: - self.disabled_sources.append(source) - if source.template in self.source_template.children: - #print "yeah! child found: %s" % source.template.name - if source.type == "deb": - self.child_sources.append(source) - elif source.type == "deb-src": - self.source_code_sources.append(source) - self.download_comps = set(comps) - self.cdrom_comps = set(cdrom_comps) - enabled_comps.extend(comps) - enabled_comps.extend(cdrom_comps) - self.enabled_comps = set(enabled_comps) - self.used_media = set(media) - - self.get_mirrors() - - def get_mirrors(self): - """ - Provide a set of mirrors where you can get the distribution from - """ - # the main server is stored in the template - self.main_server = self.source_template.base_uri - - # try to guess the nearest mirror from the locale - # FIXME: for debian we need something different - if self.id == "Ubuntu": - locale = os.getenv("LANG", default="en.UK") - a = locale.find("_") - z = locale.find(".") - if z == -1: - z = len(locale) - country_code = locale[a+1:z].lower() - self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \ - country_code - self.country = self.countries[country_code] - - # other used servers - for medium in self.used_media: - if not medium.startswith("cdrom:"): - # seems to be a network source - self.used_servers.append(medium) - - def add_source(self, sources_list, type=None, - uri=None, dist=None, comps=None, comment=""): - """ - Add distribution specific sources - """ - if uri == None: - # FIXME: Add support for the server selector - uri = self.main_server - if dist == None: - dist = self.codename - if comps == None: - comps = list(self.enabled_comps) - if type == None: - type = "deb" - if comment == "": - comment == "Added by software-properties" - new_source = sources_list.add(type, uri, dist, comps, comment) - # if source code is enabled add a deb-src line after the new - # source - if self.get_source_code == True and not type.endswith("-src"): - sources_list.add("%s-src" % type, uri, dist, comps, comment, - file=new_source.file, - pos=sources_list.list.index(new_source)+1) class SoftwareProperties(SimpleGladeApp): @@ -253,7 +89,7 @@ class SoftwareProperties(SimpleGladeApp): self.file = file - self.distro = Distribution() + self.distro = aptsources.Distribution() cell = gtk.CellRendererText() self.combobox_server.pack_start(cell, True) self.combobox_server.add_attribute(cell, 'text', 0) @@ -537,33 +373,10 @@ class SoftwareProperties(SimpleGladeApp): Sync the components of all main sources (excluding cdroms), child sources and source code sources """ - sources = [] - sources.extend(self.distro.main_sources) - sources.extend(self.distro.child_sources) - sources.extend(self.distro.source_code_sources) if checkbutton.get_active() == True: - # check if there is a main source at all - if len(self.distro.main_sources) < 1: - # create a new main source - self.distro.add_source(self.sourceslist, comps=["%s"%comp]) - else: - # add the comp to all main, child and source code sources - for source in sources: - if comp not in source.comps: - source.comps.append(comp) - if self.distro.get_source_code == True: - for source in self.distro.source_code_sources: - if comp not in source.comps: source.comps.append(comp) + self.distro.enable_component(self.sourceslist, comp) else: - if comp in self.distro.cdrom_comps: - sources = [] - sources.extend(self.distro.main_sources) - - for source in sources: - if comp in source.comps: - source.comps.remove(comp) - if len(source.comps) < 1: - self.sourceslist.remove(source) + self.distro.disable_component(self.sourceslist, comp) self.modified_sourceslist() def massive_debug_output(self): diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 4e76824d..7418a7cb 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -339,17 +339,6 @@ class SourcesList: #print self.parents return (parents, used_child_templates) - def check_for_endangered_dists(self): - """set the components of a child source to the ones of the parent channel""" - (parents, used_child_templates) = self.check_for_relations(self.list) - # the magical part - for mother in parents: - for child_template in mother.template.children: - if used_child_templates.has_key(child_template): - for child in used_child_templates[child_template]: - if child.type == mother.type: - child.comps = mother.comps - # templates for the add dialog class SourceEntryTemplate(SourceEntry): def __init__(self,a_type,uri,dist,description,comps): @@ -495,6 +484,214 @@ class SourceEntryMatcher: break return found +class Distribution: + def __init__(self): + """" + Container for distribution specific informations + """ + # LSB information + self.id = "" + self.codename = "" + self.description = "" + self.release = "" + + # get the LSB information + lsb_info = [] + for lsb_option in ["-i", "-c", "-d", "-r"]: + pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option) + lsb_info.append(pipe.read().strip()) + del pipe + (self.id, self.codename, self.description, self.release) = lsb_info + + # get a list of country codes and real names + self.countries = {} + try: + f = open("/usr/share/iso-codes/iso_3166.tab", "r") + lines = f.readlines() + for line in lines: + parts = line.split("\t") + self.countries[parts[0].lower()] = parts[1] + except: + print "could not open file '%s'" % file + else: + f.close() + + def get_sources(self, sources_list): + """ + Find the corresponding template, main and child sources + for the distribution + """ + # corresponding sources + self.source_template = None + self.child_sources = [] + self.main_sources = [] + self.disabled_sources = [] + self.cdrom_sources = [] + self.download_comps = [] + self.enabled_comps = [] + self.cdrom_comps = [] + self.used_media = [] + self.get_source_code = False + self.source_code_sources = [] + + # location of the sources + self.main_server = "" + self.nearest_server = "" + self.used_servers = [] + + # find the distro template + for template in sources_list.matcher.templates: + if template.name == self.codename and\ + template.distribution == self.id: + #print "yeah! found a template for %s" % self.description + #print template.description, template.base_uri, template.components + self.source_template = template + break + if self.source_template == None: + print "Error: could not find a distribution template" + # FIXME: will go away - only for debugging issues + sys.exit(1) + + # find main and child sources + media = [] + comps = [] + cdrom_comps = [] + enabled_comps = [] + source_code = [] + for source in sources_list.list: + if source.invalid == False and\ + source.dist == self.codename and\ + source.template and\ + source.template.name == self.codename: + #print "yeah! found a distro repo: %s" % source.line + # cdroms need do be handled differently + if source.uri.startswith("cdrom:") and \ + source.disabled == False: + self.cdrom_sources.append(source) + cdrom_comps.extend(source.comps) + elif source.uri.startswith("cdrom:") and \ + source.disabled == True: + self.cdrom_sources.append(source) + elif source.type == "deb" and source.disabled == False: + self.main_sources.append(source) + comps.extend(source.comps) + media.append(source.uri) + elif source.type == "deb" and source.disabled == True: + self.disabled_sources.append(source) + elif source.type.endswith("-src") and source.disabled == False: + self.source_code_sources.append(source) + elif source.type.endswith("-src") and source.disabled == True: + self.disabled_sources.append(source) + if source.template in self.source_template.children: + #print "yeah! child found: %s" % source.template.name + if source.type == "deb": + self.child_sources.append(source) + elif source.type == "deb-src": + self.source_code_sources.append(source) + self.download_comps = set(comps) + self.cdrom_comps = set(cdrom_comps) + enabled_comps.extend(comps) + enabled_comps.extend(cdrom_comps) + self.enabled_comps = set(enabled_comps) + self.used_media = set(media) + + self.get_mirrors() + + def get_mirrors(self): + """ + Provide a set of mirrors where you can get the distribution from + """ + # the main server is stored in the template + self.main_server = self.source_template.base_uri + + # try to guess the nearest mirror from the locale + # FIXME: for debian we need something different + if self.id == "Ubuntu": + locale = os.getenv("LANG", default="en.UK") + a = locale.find("_") + z = locale.find(".") + if z == -1: + z = len(locale) + country_code = locale[a+1:z].lower() + self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \ + country_code + self.country = self.countries[country_code] + + # other used servers + for medium in self.used_media: + if not medium.startswith("cdrom:"): + # seems to be a network source + self.used_servers.append(medium) + + def add_source(self, sources_list, type=None, + uri=None, dist=None, comps=None, comment=""): + """ + Add distribution specific sources + """ + if uri == None: + # FIXME: Add support for the server selector + uri = self.main_server + if dist == None: + dist = self.codename + if comps == None: + comps = list(self.enabled_comps) + if type == None: + type = "deb" + if comment == "": + comment == "Added by software-properties" + new_source = sources_list.add(type, uri, dist, comps, comment) + # if source code is enabled add a deb-src line after the new + # source + if self.get_source_code == True and not type.endswith("-src"): + sources_list.add("%s-src" % type, uri, dist, comps, comment, + file=new_source.file, + pos=sources_list.list.index(new_source)+1) + + def enable_component(self, sourceslist, comp): + """ + Disable a component in all main, child and source code sources + (excluding cdrom based sources) + + sourceslist: an aptsource.sources_list + comp: the component that should be enabled + """ + sources = [] + sources.extend(self.main_sources) + sources.extend(self.child_sources) + sources.extend(self.source_code_sources) + # check if there is a main source at all + if len(self.main_sources) < 1: + # create a new main source + self.add_source(sourceslist, comps=["%s"%comp]) + else: + # add the comp to all main, child and source code sources + for source in sources: + if comp not in source.comps: + source.comps.append(comp) + if self.get_source_code == True: + for source in self.source_code_sources: + if comp not in source.comps: source.comps.append(comp) + + def disable_component(self, sourceslist, comp): + """ + Disable a component in all main, child and source code sources + (excluding cdrom based sources) + """ + sources = [] + sources.extend(self.main_sources) + sources.extend(self.child_sources) + sources.extend(self.source_code_sources) + if comp in self.cdrom_comps: + sources = [] + sources.extend(self.main_sources) + + for source in sources: + if comp in source.comps: + source.comps.remove(comp) + if len(source.comps) < 1: + sourceslist.remove(source) + + # some simple tests if __name__ == "__main__": apt_pkg.InitConfig() diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 9c63fd52..08ffd743 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -1052,7 +1052,7 @@ 12 True False - 6 + 12 @@ -1085,13 +1085,14 @@ The results are used to improve the support for popular applications and to rank True True - Submit statistical information to Ubuntu + Submit statistical information True GTK_RELIEF_NORMAL True False False True + 0 diff --git a/software-properties b/software-properties index f21a5b52..6c38d073 100644 --- a/software-properties +++ b/software-properties @@ -34,6 +34,8 @@ import sys from optparse import OptionParser +import SoftwareProperties.aptsources as aptsources + #sys.path.append("@prefix@/share/update-manager/python") from SoftwareProperties import SoftwareProperties @@ -51,14 +53,18 @@ if __name__ == "__main__": action="store", type="string", dest="toplevel", help="Set x-window-id of the toplevel parent for the "\ "dialog (usefull for embedding)") + parser.add_option("-e", "--enable-component", + action="store", type="string", dest="enable_component", + help="Enable the specified component of the distro's "\ + "repositories") (options, args) = parser.parse_args() # Check for root permissions if os.geteuid() != 0: - dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, + dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, _("You need to be root to run this program") ) - dialog.set_default_response(gtk.RESPONSE_OK) + dialog.set_default_response(gtk.RESPONSE_CLOSE) dialog.run() dialog.destroy() sys.exit(1) @@ -74,7 +80,14 @@ if __name__ == "__main__": #data_dir="/tmp/xxx/share/update-manager/" file = None if len(args) > 0: - file = args[0] - app = SoftwareProperties.SoftwareProperties(data_dir, options, file) - app.run() - sys.exit(app.modified) + file = args[0] + if options.enable_component: + sourceslist = aptsources.SourcesList() + distro = aptsources.Distribution() + distro.get_sources(sourceslist) + distro.enable_component(sourceslist, options.enable_component) + sourceslist.save() + else: + app = SoftwareProperties.SoftwareProperties(data_dir, options, file) + app.run() + sys.exit(app.modified) -- cgit v1.2.3 From f5acaf7e44c59fd542e7dc40549a519a08a39a8a Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Fri, 21 Jul 2006 23:13:48 +0200 Subject: * moved all glade and channels files into subdirectories of data * do not install obsolete files to update-manager/channels --- channels/Debian.info.in | 57 -- channels/Makefile | 14 - channels/Makefile.am | 11 - channels/README.channels | 47 - channels/Ubuntu.info.in | 209 ---- data/SoftwareProperties.glade | 1183 ---------------------- data/SoftwarePropertiesDialogs.glade | 898 ----------------- data/UpdateManager.glade | 1455 ---------------------------- data/channels/Debian.info | 57 ++ data/channels/Debian.info.in | 57 ++ data/channels/Makefile | 14 + data/channels/Makefile.am | 11 + data/channels/README.channels | 47 + data/channels/Ubuntu.info | 209 ++++ data/channels/Ubuntu.info.in | 209 ++++ data/dialog_add_channels.glade | 180 ---- data/glade/SoftwareProperties.glade | 1183 ++++++++++++++++++++++ data/glade/SoftwarePropertiesDialogs.glade | 898 +++++++++++++++++ data/glade/UpdateManager.glade | 1455 ++++++++++++++++++++++++++++ data/glade/dialog_add_channels.glade | 180 ++++ setup.py | 11 +- 21 files changed, 4326 insertions(+), 4059 deletions(-) delete mode 100644 channels/Debian.info.in delete mode 100644 channels/Makefile delete mode 100644 channels/Makefile.am delete mode 100644 channels/README.channels delete mode 100644 channels/Ubuntu.info.in delete mode 100644 data/SoftwareProperties.glade delete mode 100644 data/SoftwarePropertiesDialogs.glade delete mode 100644 data/UpdateManager.glade create mode 100644 data/channels/Debian.info create mode 100644 data/channels/Debian.info.in create mode 100644 data/channels/Makefile create mode 100644 data/channels/Makefile.am create mode 100644 data/channels/README.channels create mode 100644 data/channels/Ubuntu.info create mode 100644 data/channels/Ubuntu.info.in delete mode 100644 data/dialog_add_channels.glade create mode 100644 data/glade/SoftwareProperties.glade create mode 100644 data/glade/SoftwarePropertiesDialogs.glade create mode 100644 data/glade/UpdateManager.glade create mode 100644 data/glade/dialog_add_channels.glade diff --git a/channels/Debian.info.in b/channels/Debian.info.in deleted file mode 100644 index ea2d1e53..00000000 --- a/channels/Debian.info.in +++ /dev/null @@ -1,57 +0,0 @@ -_ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog - -Suite: sarge -RepositoryType: deb -_BaseURI: http://http.us.debian.org/debian/ -_Description: Debian 3.1 "Sarge" -Component: main -Enabled: 1 -_CompDescription: Officially supported -Component: contrib -Enabled: 0 -_CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -_CompDescription: Non-DFSG-compatible Software - -Suite: sarge/updates -RepositoryType: deb -_BaseURI: http://security.debian.org/ -_Description: Debian 3.1 "Sarge" Security Updates -Component: main -Enabled: 1 -_CompDescription: Officially supported -Component: contrib -Enabled: 0 -_CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -_CompDescription: Non-DFSG-compatible Software - -Suite: etch -RepositoryType: deb -_BaseURI: http://http.us.debian.org/debian/ -_Description: Debian "Etch" (testing) -Component: main -Enabled: 1 -_CompDescription: Officially supported -Component: contrib -Enabled: 0 -_CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -_CompDescription: Non-DFSG-compatible Software - -Suite: sid -RepositoryType: deb -_BaseURI: http://http.us.debian.org/debian/ -_Description: Debian "Sid" (unstable) -Component: main -Enabled: 1 -_CompDescription: Officially supported -Component: contrib -Enabled: 0 -_CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -_CompDescription: Non-DFSG-compatible Software diff --git a/channels/Makefile b/channels/Makefile deleted file mode 100644 index 3901f9cc..00000000 --- a/channels/Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -DOMAIN=update-manager -INFO_IN_FILES := $(wildcard *.info.in) -INFO_FILES := $(patsubst %.info.in,%.info,$(wildcard *.info.in)) - -all: $(INFO_FILES) - -%.info: %.info.in ../po/$(DOMAIN).pot - sed 's/^_//g' < $< > $@ - intltool-extract --type=gettext/rfc822deb $< - #intltool-merge -d ../po $< $@ - -clean: - rm -f $(INFO_FILES) $(wildcard *.h) \ No newline at end of file diff --git a/channels/Makefile.am b/channels/Makefile.am deleted file mode 100644 index c9d63742..00000000 --- a/channels/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -%.info: %.info.in - sed 's/^_//g' < $< > $@ - $(INTLTOOL_EXTRACT) --type=gettext/rfc822deb $< - -datadir=$(prefix)/share/update-manager -dinfodir = $(datadir)/dists -dinfo_DATA = Debian.info Ubuntu.info - -EXTRA_DIST= $(dinfo_DATA) - -CLEANFILES = $(dinfo_DATA) $(dinfo_DATA:.info=.info.in.h) diff --git a/channels/README.channels b/channels/README.channels deleted file mode 100644 index 6bc76872..00000000 --- a/channels/README.channels +++ /dev/null @@ -1,47 +0,0 @@ -Channel Definition ------------------- - -The .info files allow to specify a set of default channels that is available -in the dialog "add channel". The .info file whose name corresponds to the -LSB release name is used, e.g. 'Ubuntu.info' on a Ubuntu system. - -Furthermore all .info files are used to render the channels presented in the -sources list more user friendly. - - -Tags ----- - -Suite: the name of the dist used in the repository - -MatchSuite: mainly used for cdroms. defaults to Suite - -ParentSuite: the channel only appears as a component of the parent suite in - the add dialog - the components/sections of the suite correspond to the ones of - the parent suite. specified components of the suite itself - are ignored - -Available: determs the availabilty of the suite in the add dialog. - defaults to False - -RepositoryType: does the repository contain binary or source packages - -BaseURI: the base URI of the repository - -MatchURI: used for identifing mirrors - -Description: description of the suite. the translation is done through - gettext at runtime - -Component: a component/section of the suite (ignored if ParentSuite is - set) - -Enabled: activate the component by default (ignored if ParentSuite is - set) - -CompDescription: humand readable description of the component/section - (ignored if ParentSuite is set). the translation is done - through gettext at runtime - - diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in deleted file mode 100644 index e01a9221..00000000 --- a/channels/Ubuntu.info.in +++ /dev/null @@ -1,209 +0,0 @@ -_ChangelogURI: http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/changelog - -Suite: dapper -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.06 'Dapper Drake' -Component: main -Enabled: 1 -_CompDescription: Officially supported -_CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) -Component: universe -Enabled: 0 -_CompDescription: Community maintained (universe) -_CompDescriptionLong: OpenSource software that is maintained by the community (universe) -Component: restricted -Enabled: 1 -_CompDescription: Non-free drivers -_CompDescriptionLong: Proprietary drivers for devices (restricted) -Component: multiverse -Enabled: 0 -_CompDescription: Restricted software (Multiverse) -_CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) - -Suite: dapper -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*6.06 -_Description: Cdrom with Ubuntu 6.06 'Dapper Drake' -Available: False -Component: main -Enabled: 1 -_CompDescription: Oficially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright - -Suite: dapper-security -ParentSuite: dapper -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -_Description: Important security updates - -Suite: dapper-updates -ParentSuite: dapper -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Recommended updates - -Suite: dapper-backports -ParentSuite: dapper -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Backported updates - -Suite: dapper-backports -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 5.10 'Breezy Badger' -Component: main -Enabled: 1 -_CompDescription: Officially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright -Component: universe -Enabled: 0 -_CompDescription: Community maintained (Universe) -Component: multiverse -Enabled: 0 -_CompDescription: Non-free (Multiverse) - -Suite: breezy -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*5.10 -_Description: Cdrom with Ubuntu 5.10 'Breezy Badger' -Available: False -Component: main -Enabled: 1 -_CompDescription: Oficially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright - -Suite: breezy-security -ParentSuite: breezy -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -_Description: Ubuntu 5.10 Security Updates - -Suite: breezy-updates -ParentSuite: breezy -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 5.10 Updates - -Suite: breezy-backports -ParentSuite: breezy -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 5.10 Backports - -Suite: hoary -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 5.04 'Hoary Hedgehog' -Component: main -Enabled: 1 -_CompDescription: Oficially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright -Component: universe -Enabled: 0 -_CompDescription: Community maintained (Universe) -Component: multiverse -Enabled: 0 -_CompDescription: Non-free (Multiverse) - -Suite: hoary -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*5.04 -_Description: Cdrom with Ubuntu 5.04 'Hoary Hedgehog' -Available: False -Component: main -Enabled: 1 -_CompDescription: Oficially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright - -Suite: hoary-security -ParentSuite: hoary -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -_Description: Ubuntu 5.04 Security Updates - -Suite: hoary-updates -ParentSuite: hoary -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 5.04 Updates - -Suite: hoary-backports -ParentSuite: hoary -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 5.04 Backports - -Suite: warty -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 4.10 'Warty Warthog' -Component: main -Enabled: 1 -_CompDescription: Oficially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright -Component: universe -Enabled: 0 -_CompDescription: Community maintained (Universe) -Component: multiverse -Enabled: 0 -_CompDescription: Non-free (Multiverse) - -Suite: warty -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*4.10 -_Description: Cdrom with Ubuntu 4.10 'Warty Warthog' -Available: False -Component: main -Enabled: 1 -_CompDescription: Oficially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright - -Suite: warty-security -ParentSuite: warty -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -_Description: Ubuntu 4.10 Security Updates - -Suite: warty-updates -ParentSuite: warty -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 4.10 Updates - -Suite: warty-backports -ParentSuite: warty -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 4.10 Backports diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade deleted file mode 100644 index 08ffd743..00000000 --- a/data/SoftwareProperties.glade +++ /dev/null @@ -1,1183 +0,0 @@ - - - - - - - 6 - Software Sources - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - - True - False - 0 - - - - 6 - True - True - True - True - GTK_POS_TOP - False - False - - - - 12 - True - False - 18 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 - - - - True - False - 18 - - - - True - False - 6 - - - - True - False - 6 - - - - True - False - 6 - - - - - - - 0 - True - True - - - - - - True - True - Source code - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 12 - - - - True - Download from: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - - - True - <b>Downloadable software</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 - - - - True - False - 6 - - - - 75 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - 109 - True - True - False - True - False - True - False - False - False - - - - - 0 - True - True - - - - - - - - - - True - <b>CDROM/DVD</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - False - True - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 18 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 - - - - True - False - 6 - - - - - - - - - - - - - - - - - - - - True - <b>Internet updates</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - _Check for updates automatically: - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - True - - - - - - True - - False - True - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - True - _Download updates automatically, but do not install them - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - - True - Only security updates from the official Ubuntu servers will be installed automatically - True - _Install security updates without confirmation - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - False - 6 - - - - True - True - D_elete downloaded software files: - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - True - - - - - - True - - False - True - - - - 0 - True - True - - - - - 0 - False - True - - - - - - - - - - True - <b>Automatic updates</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - False - True - - - - - - True - Internet Updates - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - True - False - True - False - False - False - - - - - - - 0 - True - True - - - - - - True - False - 18 - - - - True - False - 6 - - - - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - True - - - - - - True - True - True - gtk-edit - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - True - - - - - - True - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - True - - - - - 0 - True - True - - - - - - True - gtk-revert-to-saved - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - 0 - False - True - - - - - False - True - - - - - - True - Third Party - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - True - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - Import the public key from a trusted software provider - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Import Key File - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - True - Restore the default keys of your distribution - True - Restore _Defaults - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - GTK_PACK_END - - - - - - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - 0 - False - True - - - - - False - True - - - - - - True - Authentication - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - <i>Please take part in the popularity contest, to improve the user experience of Ubuntu. Therefor the following data will be collected and sent to the Ubuntu project anonymously on a weekly basis: the list of installed software and how often it was used. - -The results are used to improve the support for popular applications and to rank applications in the search results.</i> - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Submit statistical information - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - False - True - - - - - - True - Statistics - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - 6 - True - GTK_BUTTONBOX_EDGE - 0 - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - - - - - - - diff --git a/data/SoftwarePropertiesDialogs.glade b/data/SoftwarePropertiesDialogs.glade deleted file mode 100644 index b381965b..00000000 --- a/data/SoftwarePropertiesDialogs.glade +++ /dev/null @@ -1,898 +0,0 @@ - - - - - - - 6 - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - False - True - True - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - False - True - True - True - True - GTK_RELIEF_NORMAL - True - -5 - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Add Source - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - gtk-dialog-question - 6 - 0.5 - 0 - 0 - 0 - - - 0 - False - True - - - - - - True - False - 12 - - - - True - True - <big><b>Enter the complete APT line of the source that you want to add</b></big> - -The APT line includes the type, location and components of a source, for example <i>"deb http://ftp.debian.org sarge main"</i>. - False - True - GTK_JUSTIFY_LEFT - True - True - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 10 - - - - True - APT line: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - True - - - 0 - True - True - - - - - 0 - False - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - 6 - Edit Source - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - 400 - True - False - True - True - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - 7 - 2 - False - 6 - 12 - - - - True - <b>Type:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - <b>URI:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - <b>Distribution:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - <b>Components:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - fill - - - - - - - True - True - True - True - 0 - - True - * - True - - - - 1 - 2 - 3 - 4 - - - - - - - True - True - True - True - 0 - - True - * - True - - - - 1 - 2 - 5 - 6 - - - - - - - True - Binary -Source - False - True - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - <b>Comment:</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 6 - 7 - fill - - - - - - - True - True - True - True - 0 - - True - * - True - - - - 1 - 2 - 6 - 7 - - - - - - - True - True - True - True - 0 - - True - * - True - - - - 1 - 2 - 4 - 5 - - - - - - 0 - True - True - - - - - - - - 6 - Scanning CD-ROM - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 350 - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 0 - False - False - - - - - - - - - 0 - True - True - - - - - - - - 6 - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - True - True - GTK_RELIEF_NORMAL - True - -10 - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-refresh - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Reload - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - gtk-dialog-info - 6 - 0 - 0 - 0 - 0 - - - 0 - False - True - - - - - - True - True - <b><big>The channel information is out-of-date</big></b> - -You have to reload the channel information to install software and updates from newly added or changed channels. - -You need a working internet connection to continue. - False - True - GTK_JUSTIFY_LEFT - True - True - 0 - 0 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade deleted file mode 100644 index 1221e78c..00000000 --- a/data/UpdateManager.glade +++ /dev/null @@ -1,1455 +0,0 @@ - - - - - - - Software Updates - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 600 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 6 - True - False - 6 - - - - 6 - True - False - 12 - - - - True - False - 12 - - - - - 0 - False - False - - - - - - True - False - 6 - - - - True - <big><b>Keep your system up-to-date</b></big> - True - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Software updates correct errors, eliminate security vulnerabilities and provide new features. - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - True - - - - - - 0 - 0.5 - GTK_SHADOW_IN - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 0 - 0 - - - - 6 - True - False - 6 - - - - True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - Upgrade to the latest version of Ubuntu - True - U_pgrade - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - - - - - 0 - False - True - - - - - - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - True - False - True - False - False - False - - updates - - - - - - - 0 - True - True - - - - - - True - False - 12 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - True - 6 - - - - True - Check the software channels for new updates - True - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-refresh - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Chec_k - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - True - - - - - - True - True - True - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-apply - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Install Updates - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - True - - - - - 0 - False - True - - - - - 0 - False - True - - - - - 0 - True - True - - - - - - True - True - False - 6 - - - - - True - False - 6 - - - - True - True - True - False - GTK_POS_TOP - False - False - - - - 6 - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - False - 6 - 0 - 0 - 6 - 6 - 0 - - - changes - - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_END - 0 - - - - True - True - GTK_RELIEF_NORMAL - True - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-cancel - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Cancel _Download - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - - 0 - False - False - - - - - False - True - - - - - - True - Changes - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 6 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - False - 6 - 0 - 0 - 6 - 6 - 0 - - - Description - - - - - - False - True - - - - - - True - Description - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - Description - - - - tab - - - - - 0 - True - True - - - - - - - - True - Changes and description of the update - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - 0 - True - True - - - - - - 6 - True - False - 12 - - - - True - True - True - gtk-help - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_END - 6 - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - - - 6 - Release Notes - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - True - 600 - 500 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 6 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - _Upgrade - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - - - - 0 - True - True - - - - - - - - 6 - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - True - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 6 - - - - 6 - True - False - 12 - - - - True - - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 0 - True - False - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - False - 6 - - - - True - False - 6 - - - - 200 - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - False - False - False - False - - - - - 0 - True - True - - - - - - - - True - Show progress of single files - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_END - 0 - - - - 5 - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - True - - - - - - - - 6 - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - True - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - GTK_RELIEF_NORMAL - True - -8 - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-refresh - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Check - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 11 - - - - True - gtk-dialog-info - 6 - 0 - 0 - 0 - 0 - - - 0 - False - True - - - - - - True - False - 12 - - - - True - True - <b><big>You must check for updates manually</big></b> - -Your system does not check for updates automatically. You can configure this behavior in "System" -> "Administration" -> "Software Properties". - False - True - GTK_JUSTIFY_LEFT - True - True - 0 - 0 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - _Hide this information in the future - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - 6 - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - True - False - False - True - True - True - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - 6 - True - False - 12 - - - - True - <big><b>Examining your system</b></big> - -Software updates correct errors, eliminate security vulnerabilities and provide new features. - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 0 - False - False - - - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - - - diff --git a/data/channels/Debian.info b/data/channels/Debian.info new file mode 100644 index 00000000..3958607a --- /dev/null +++ b/data/channels/Debian.info @@ -0,0 +1,57 @@ +ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog + +Suite: sarge +RepositoryType: deb +BaseURI: http://http.us.debian.org/debian/ +Description: Debian 3.1 "Sarge" +Component: main +Enabled: 1 +CompDescription: Officially supported +Component: contrib +Enabled: 0 +CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +CompDescription: Non-DFSG-compatible Software + +Suite: sarge/updates +RepositoryType: deb +BaseURI: http://security.debian.org/ +Description: Debian 3.1 "Sarge" Security Updates +Component: main +Enabled: 1 +CompDescription: Officially supported +Component: contrib +Enabled: 0 +CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +CompDescription: Non-DFSG-compatible Software + +Suite: etch +RepositoryType: deb +BaseURI: http://http.us.debian.org/debian/ +Description: Debian "Etch" (testing) +Component: main +Enabled: 1 +CompDescription: Officially supported +Component: contrib +Enabled: 0 +CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +CompDescription: Non-DFSG-compatible Software + +Suite: sid +RepositoryType: deb +BaseURI: http://http.us.debian.org/debian/ +Description: Debian "Sid" (unstable) +Component: main +Enabled: 1 +CompDescription: Officially supported +Component: contrib +Enabled: 0 +CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +CompDescription: Non-DFSG-compatible Software diff --git a/data/channels/Debian.info.in b/data/channels/Debian.info.in new file mode 100644 index 00000000..ea2d1e53 --- /dev/null +++ b/data/channels/Debian.info.in @@ -0,0 +1,57 @@ +_ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog + +Suite: sarge +RepositoryType: deb +_BaseURI: http://http.us.debian.org/debian/ +_Description: Debian 3.1 "Sarge" +Component: main +Enabled: 1 +_CompDescription: Officially supported +Component: contrib +Enabled: 0 +_CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +_CompDescription: Non-DFSG-compatible Software + +Suite: sarge/updates +RepositoryType: deb +_BaseURI: http://security.debian.org/ +_Description: Debian 3.1 "Sarge" Security Updates +Component: main +Enabled: 1 +_CompDescription: Officially supported +Component: contrib +Enabled: 0 +_CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +_CompDescription: Non-DFSG-compatible Software + +Suite: etch +RepositoryType: deb +_BaseURI: http://http.us.debian.org/debian/ +_Description: Debian "Etch" (testing) +Component: main +Enabled: 1 +_CompDescription: Officially supported +Component: contrib +Enabled: 0 +_CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +_CompDescription: Non-DFSG-compatible Software + +Suite: sid +RepositoryType: deb +_BaseURI: http://http.us.debian.org/debian/ +_Description: Debian "Sid" (unstable) +Component: main +Enabled: 1 +_CompDescription: Officially supported +Component: contrib +Enabled: 0 +_CompDescription: DFSG-compatible Software with Non-Free Dependencies +Component: non-free +Enabled: 0 +_CompDescription: Non-DFSG-compatible Software diff --git a/data/channels/Makefile b/data/channels/Makefile new file mode 100644 index 00000000..3901f9cc --- /dev/null +++ b/data/channels/Makefile @@ -0,0 +1,14 @@ + +DOMAIN=update-manager +INFO_IN_FILES := $(wildcard *.info.in) +INFO_FILES := $(patsubst %.info.in,%.info,$(wildcard *.info.in)) + +all: $(INFO_FILES) + +%.info: %.info.in ../po/$(DOMAIN).pot + sed 's/^_//g' < $< > $@ + intltool-extract --type=gettext/rfc822deb $< + #intltool-merge -d ../po $< $@ + +clean: + rm -f $(INFO_FILES) $(wildcard *.h) \ No newline at end of file diff --git a/data/channels/Makefile.am b/data/channels/Makefile.am new file mode 100644 index 00000000..c9d63742 --- /dev/null +++ b/data/channels/Makefile.am @@ -0,0 +1,11 @@ +%.info: %.info.in + sed 's/^_//g' < $< > $@ + $(INTLTOOL_EXTRACT) --type=gettext/rfc822deb $< + +datadir=$(prefix)/share/update-manager +dinfodir = $(datadir)/dists +dinfo_DATA = Debian.info Ubuntu.info + +EXTRA_DIST= $(dinfo_DATA) + +CLEANFILES = $(dinfo_DATA) $(dinfo_DATA:.info=.info.in.h) diff --git a/data/channels/README.channels b/data/channels/README.channels new file mode 100644 index 00000000..6bc76872 --- /dev/null +++ b/data/channels/README.channels @@ -0,0 +1,47 @@ +Channel Definition +------------------ + +The .info files allow to specify a set of default channels that is available +in the dialog "add channel". The .info file whose name corresponds to the +LSB release name is used, e.g. 'Ubuntu.info' on a Ubuntu system. + +Furthermore all .info files are used to render the channels presented in the +sources list more user friendly. + + +Tags +---- + +Suite: the name of the dist used in the repository + +MatchSuite: mainly used for cdroms. defaults to Suite + +ParentSuite: the channel only appears as a component of the parent suite in + the add dialog + the components/sections of the suite correspond to the ones of + the parent suite. specified components of the suite itself + are ignored + +Available: determs the availabilty of the suite in the add dialog. + defaults to False + +RepositoryType: does the repository contain binary or source packages + +BaseURI: the base URI of the repository + +MatchURI: used for identifing mirrors + +Description: description of the suite. the translation is done through + gettext at runtime + +Component: a component/section of the suite (ignored if ParentSuite is + set) + +Enabled: activate the component by default (ignored if ParentSuite is + set) + +CompDescription: humand readable description of the component/section + (ignored if ParentSuite is set). the translation is done + through gettext at runtime + + diff --git a/data/channels/Ubuntu.info b/data/channels/Ubuntu.info new file mode 100644 index 00000000..28fe85b3 --- /dev/null +++ b/data/channels/Ubuntu.info @@ -0,0 +1,209 @@ +ChangelogURI: http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/changelog + +Suite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 6.04 'Dapper Drake' +Component: main +Enabled: 1 +CompDescription: Officially supported +CompDescriptionLong: Free software that is officially supported by Canonical Ltd. (main) +Component: universe +Enabled: 0 +CompDescription: Community maintained (universe) +CompDescriptionLong: Free software that is maintained by the community (universe) +Component: restricted +Enabled: 1 +CompDescription: Non-free drivers +CompDescriptionLong: Non-free drivers for devices (restricted) +Component: multiverse +Enabled: 0 +CompDescription: Restricted software (Multiverse) +CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) + +Suite: dapper +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*6.04 +Description: Cdrom with Ubuntu 6.04 'Dapper Drake' +Available: False +Component: main +Enabled: 1 +CompDescription: Oficially supported +Component: restricted +Enabled: 1 +CompDescription: Restricted copyright + +Suite: dapper-security +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +Description: Ubuntu 6.04 Security Updates + +Suite: dapper-updates +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 6.04 Updates + +Suite: dapper-backports +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 6.04 Backports + +Suite: dapper-backports +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 5.10 'Breezy Badger' +Component: main +Enabled: 1 +CompDescription: Officially supported +Component: restricted +Enabled: 1 +CompDescription: Restricted copyright +Component: universe +Enabled: 0 +CompDescription: Community maintained (Universe) +Component: multiverse +Enabled: 0 +CompDescription: Non-free (Multiverse) + +Suite: breezy +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*5.10 +Description: Cdrom with Ubuntu 5.10 'Breezy Badger' +Available: False +Component: main +Enabled: 1 +CompDescription: Oficially supported +Component: restricted +Enabled: 1 +CompDescription: Restricted copyright + +Suite: breezy-security +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +Description: Ubuntu 5.10 Security Updates + +Suite: breezy-updates +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 5.10 Updates + +Suite: breezy-backports +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 5.10 Backports + +Suite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 5.04 'Hoary Hedgehog' +Component: main +Enabled: 1 +CompDescription: Oficially supported +Component: restricted +Enabled: 1 +CompDescription: Restricted copyright +Component: universe +Enabled: 0 +CompDescription: Community maintained (Universe) +Component: multiverse +Enabled: 0 +CompDescription: Non-free (Multiverse) + +Suite: hoary +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*5.04 +Description: Cdrom with Ubuntu 5.04 'Hoary Hedgehog' +Available: False +Component: main +Enabled: 1 +CompDescription: Oficially supported +Component: restricted +Enabled: 1 +CompDescription: Restricted copyright + +Suite: hoary-security +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +Description: Ubuntu 5.04 Security Updates + +Suite: hoary-updates +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 5.04 Updates + +Suite: hoary-backports +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 5.04 Backports + +Suite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 4.10 'Warty Warthog' +Component: main +Enabled: 1 +CompDescription: Oficially supported +Component: restricted +Enabled: 1 +CompDescription: Restricted copyright +Component: universe +Enabled: 0 +CompDescription: Community maintained (Universe) +Component: multiverse +Enabled: 0 +CompDescription: Non-free (Multiverse) + +Suite: warty +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*4.10 +Description: Cdrom with Ubuntu 4.10 'Warty Warthog' +Available: False +Component: main +Enabled: 1 +CompDescription: Oficially supported +Component: restricted +Enabled: 1 +CompDescription: Restricted copyright + +Suite: warty-security +ParentSuite: warty +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +Description: Ubuntu 4.10 Security Updates + +Suite: warty-updates +ParentSuite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 4.10 Updates + +Suite: warty-backports +ParentSuite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +Description: Ubuntu 4.10 Backports diff --git a/data/channels/Ubuntu.info.in b/data/channels/Ubuntu.info.in new file mode 100644 index 00000000..e01a9221 --- /dev/null +++ b/data/channels/Ubuntu.info.in @@ -0,0 +1,209 @@ +_ChangelogURI: http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/changelog + +Suite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 6.06 'Dapper Drake' +Component: main +Enabled: 1 +_CompDescription: Officially supported +_CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) +Component: universe +Enabled: 0 +_CompDescription: Community maintained (universe) +_CompDescriptionLong: OpenSource software that is maintained by the community (universe) +Component: restricted +Enabled: 1 +_CompDescription: Non-free drivers +_CompDescriptionLong: Proprietary drivers for devices (restricted) +Component: multiverse +Enabled: 0 +_CompDescription: Restricted software (Multiverse) +_CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) + +Suite: dapper +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*6.06 +_Description: Cdrom with Ubuntu 6.06 'Dapper Drake' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: dapper-security +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Important security updates + +Suite: dapper-updates +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Recommended updates + +Suite: dapper-backports +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Backported updates + +Suite: dapper-backports +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.10 'Breezy Badger' +Component: main +Enabled: 1 +_CompDescription: Officially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright +Component: universe +Enabled: 0 +_CompDescription: Community maintained (Universe) +Component: multiverse +Enabled: 0 +_CompDescription: Non-free (Multiverse) + +Suite: breezy +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*5.10 +_Description: Cdrom with Ubuntu 5.10 'Breezy Badger' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: breezy-security +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Ubuntu 5.10 Security Updates + +Suite: breezy-updates +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.10 Updates + +Suite: breezy-backports +ParentSuite: breezy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.10 Backports + +Suite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.04 'Hoary Hedgehog' +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright +Component: universe +Enabled: 0 +_CompDescription: Community maintained (Universe) +Component: multiverse +Enabled: 0 +_CompDescription: Non-free (Multiverse) + +Suite: hoary +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*5.04 +_Description: Cdrom with Ubuntu 5.04 'Hoary Hedgehog' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: hoary-security +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Ubuntu 5.04 Security Updates + +Suite: hoary-updates +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.04 Updates + +Suite: hoary-backports +ParentSuite: hoary +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 5.04 Backports + +Suite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 4.10 'Warty Warthog' +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright +Component: universe +Enabled: 0 +_CompDescription: Community maintained (Universe) +Component: multiverse +Enabled: 0 +_CompDescription: Non-free (Multiverse) + +Suite: warty +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*4.10 +_Description: Cdrom with Ubuntu 4.10 'Warty Warthog' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: warty-security +ParentSuite: warty +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Ubuntu 4.10 Security Updates + +Suite: warty-updates +ParentSuite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 4.10 Updates + +Suite: warty-backports +ParentSuite: warty +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 4.10 Backports diff --git a/data/dialog_add_channels.glade b/data/dialog_add_channels.glade deleted file mode 100644 index a0e00a53..00000000 --- a/data/dialog_add_channels.glade +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - 6 - Add Software Channel - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - GTK_RELIEF_NORMAL - True - -5 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - gtk-dialog-question - 6 - 0 - 0 - 0 - 0 - - - 0 - False - True - - - - - - True - False - 12 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - True - False - True - False - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - diff --git a/data/glade/SoftwareProperties.glade b/data/glade/SoftwareProperties.glade new file mode 100644 index 00000000..08ffd743 --- /dev/null +++ b/data/glade/SoftwareProperties.glade @@ -0,0 +1,1183 @@ + + + + + + + 6 + Software Sources + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + + True + False + 0 + + + + 6 + True + True + True + True + GTK_POS_TOP + False + False + + + + 12 + True + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 18 + + + + True + False + 6 + + + + True + False + 6 + + + + True + False + 6 + + + + + + + 0 + True + True + + + + + + True + True + Source code + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + False + 12 + + + + True + Download from: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + + + True + <b>Downloadable software</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + 75 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + 109 + True + True + False + True + False + True + False + False + False + + + + + 0 + True + True + + + + + + + + + + True + <b>CDROM/DVD</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + False + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 18 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + + + + + + + + + + + + + + + + + True + <b>Internet updates</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + _Check for updates automatically: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + True + + + + + + True + + False + True + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + True + _Download updates automatically, but do not install them + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + Only security updates from the official Ubuntu servers will be installed automatically + True + _Install security updates without confirmation + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + False + 6 + + + + True + True + D_elete downloaded software files: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + True + + + + + + True + + False + True + + + + 0 + True + True + + + + + 0 + False + True + + + + + + + + + + True + <b>Automatic updates</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + False + True + + + + + + True + Internet Updates + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + False + False + False + + + + + + + 0 + True + True + + + + + + True + False + 18 + + + + True + False + 6 + + + + True + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + True + + + + + + True + True + True + gtk-edit + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + True + + + + + + True + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + gtk-revert-to-saved + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + True + + + + + False + True + + + + + + True + Third Party + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + Import the public key from a trusted software provider + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Import Key File + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Restore the default keys of your distribution + True + Restore _Defaults + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + GTK_PACK_END + + + + + + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + 0 + False + True + + + + + False + True + + + + + + True + Authentication + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + <i>Please take part in the popularity contest, to improve the user experience of Ubuntu. Therefor the following data will be collected and sent to the Ubuntu project anonymously on a weekly basis: the list of installed software and how often it was used. + +The results are used to improve the support for popular applications and to rank applications in the search results.</i> + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + Submit statistical information + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + False + True + + + + + + True + Statistics + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + 6 + True + GTK_BUTTONBOX_EDGE + 0 + + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + True + + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + + + + + + + diff --git a/data/glade/SoftwarePropertiesDialogs.glade b/data/glade/SoftwarePropertiesDialogs.glade new file mode 100644 index 00000000..b381965b --- /dev/null +++ b/data/glade/SoftwarePropertiesDialogs.glade @@ -0,0 +1,898 @@ + + + + + + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + True + True + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + False + True + True + True + True + GTK_RELIEF_NORMAL + True + -5 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Add Source + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + gtk-dialog-question + 6 + 0.5 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 12 + + + + True + True + <big><b>Enter the complete APT line of the source that you want to add</b></big> + +The APT line includes the type, location and components of a source, for example <i>"deb http://ftp.debian.org sarge main"</i>. + False + True + GTK_JUSTIFY_LEFT + True + True + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 10 + + + + True + APT line: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + True + + + 0 + True + True + + + + + 0 + False + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + 6 + Edit Source + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + 400 + True + False + True + True + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + 7 + 2 + False + 6 + 12 + + + + True + <b>Type:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + <b>URI:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + <b>Distribution:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + <b>Components:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + True + True + True + 0 + + True + * + True + + + + 1 + 2 + 3 + 4 + + + + + + + True + True + True + True + 0 + + True + * + True + + + + 1 + 2 + 5 + 6 + + + + + + + True + Binary +Source + False + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + <b>Comment:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 6 + 7 + fill + + + + + + + True + True + True + True + 0 + + True + * + True + + + + 1 + 2 + 6 + 7 + + + + + + + True + True + True + True + 0 + + True + * + True + + + + 1 + 2 + 4 + 5 + + + + + + 0 + True + True + + + + + + + + 6 + Scanning CD-ROM + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 350 + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + + + + + + + + + 0 + True + True + + + + + + + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + True + True + GTK_RELIEF_NORMAL + True + -10 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-refresh + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Reload + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + gtk-dialog-info + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + True + <b><big>The channel information is out-of-date</big></b> + +You have to reload the channel information to install software and updates from newly added or changed channels. + +You need a working internet connection to continue. + False + True + GTK_JUSTIFY_LEFT + True + True + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + + diff --git a/data/glade/UpdateManager.glade b/data/glade/UpdateManager.glade new file mode 100644 index 00000000..1221e78c --- /dev/null +++ b/data/glade/UpdateManager.glade @@ -0,0 +1,1455 @@ + + + + + + + Software Updates + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 600 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 6 + True + False + 6 + + + + 6 + True + False + 12 + + + + True + False + 12 + + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + <big><b>Keep your system up-to-date</b></big> + True + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Software updates correct errors, eliminate security vulnerabilities and provide new features. + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + 0 + 0.5 + GTK_SHADOW_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + 6 + True + False + 6 + + + + True + + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + Upgrade to the latest version of Ubuntu + True + U_pgrade + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + + + + 0 + False + True + + + + + + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + False + False + False + + updates + + + + + + + 0 + True + True + + + + + + True + False + 12 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + True + 6 + + + + True + Check the software channels for new updates + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-refresh + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Chec_k + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + True + + + + + + True + True + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-apply + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Install Updates + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + True + + + + + 0 + False + True + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + True + False + 6 + + + + + True + False + 6 + + + + True + True + True + False + GTK_POS_TOP + False + False + + + + 6 + True + False + 6 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + False + 6 + 0 + 0 + 6 + 6 + 0 + + + changes + + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_END + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-cancel + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Cancel _Download + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + False + + + + + False + True + + + + + + True + Changes + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + False + 6 + 0 + 0 + 6 + 6 + 0 + + + Description + + + + + + False + True + + + + + + True + Description + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + Description + + + + tab + + + + + 0 + True + True + + + + + + + + True + Changes and description of the update + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + 6 + True + False + 12 + + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_END + 6 + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + + + 6 + Release Notes + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + True + 600 + 500 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 6 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + _Upgrade + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + + + + 0 + True + True + + + + + + + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + True + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 6 + + + + 6 + True + False + 12 + + + + True + + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + True + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 6 + + + + 200 + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + False + False + False + False + + + + + 0 + True + True + + + + + + + + True + Show progress of single files + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + GTK_BUTTONBOX_END + 0 + + + + 5 + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + + 0 + False + True + + + + + + + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + True + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + GTK_RELIEF_NORMAL + True + -8 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-refresh + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Check + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 11 + + + + True + gtk-dialog-info + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 12 + + + + True + True + <b><big>You must check for updates manually</big></b> + +Your system does not check for updates automatically. You can configure this behavior in "System" -> "Administration" -> "Software Properties". + False + True + GTK_JUSTIFY_LEFT + True + True + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + _Hide this information in the future + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + True + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + + + + 6 + True + False + 12 + + + + True + <big><b>Examining your system</b></big> + +Software updates correct errors, eliminate security vulnerabilities and provide new features. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + + diff --git a/data/glade/dialog_add_channels.glade b/data/glade/dialog_add_channels.glade new file mode 100644 index 00000000..a0e00a53 --- /dev/null +++ b/data/glade/dialog_add_channels.glade @@ -0,0 +1,180 @@ + + + + + + + 6 + Add Software Channel + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + GTK_RELIEF_NORMAL + True + -5 + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + gtk-dialog-question + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 12 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + diff --git a/setup.py b/setup.py index 798fea0e..be346881 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ os.system("cd po; make update-po") # do the same for the desktop files os.system("cd data; make") # and channels -os.system("cd channels; make") +os.system("cd data/channels; make") setup(name='update-manager', version='0.42.2', @@ -60,10 +60,13 @@ setup(name='update-manager', ], data_files=[ ('share/update-manager/glade', - glob.glob("data/*.glade") + glob.glob("data/glade/*.glade") + ), + ('share/doc/update-manager', + glob.glob("data/channels/README.channels") ), ('share/update-manager/channels', - glob.glob("channels/*") + glob.glob("data/channels/*.info") ), ('share/applications', ["data/update-manager.desktop", @@ -74,5 +77,3 @@ setup(name='update-manager', ), ] + I18NFILES + HELPFILES + ICONS, ) - - -- cgit v1.2.3 From 461a996561636856d91627a67c7e432bf03543e5 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 22 Jul 2006 12:26:41 +0200 Subject: * introduce a default_server that can be reused by adding sources --- SoftwareProperties/SoftwareProperties.py | 1 + SoftwareProperties/aptsources.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index d920b693..f9af3a58 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -366,6 +366,7 @@ class SoftwareProperties(SimpleGladeApp): # FIXME: ugly if not "security.ubuntu.com" in source.uri: source.uri = uri_selected + self.distro.ddefault_server = uri_selected self.modified_sourceslist() def on_component_toggled(self, checkbutton, comp): diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 7418a7cb..c111e4ff 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -535,6 +535,7 @@ class Distribution: self.source_code_sources = [] # location of the sources + self.default_server = "" self.main_server = "" self.nearest_server = "" self.used_servers = [] @@ -623,6 +624,11 @@ class Distribution: # seems to be a network source self.used_servers.append(medium) + if len(self.main_sources) == 0: + self.default_server = self.main_server + else: + self.default_server = self.main_sources[0].uri + def add_source(self, sources_list, type=None, uri=None, dist=None, comps=None, comment=""): """ @@ -630,7 +636,7 @@ class Distribution: """ if uri == None: # FIXME: Add support for the server selector - uri = self.main_server + uri = self.default_server if dist == None: dist = self.codename if comps == None: -- cgit v1.2.3 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(-) 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 From d5e1d9349540d5d1c6f63b2f482b5b9ea6a68836 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 22 Jul 2006 16:57:22 +0200 Subject: * Backported the add dialog for drag and drop and mime handling * Removed references to the obsolete edit_predefined dialog --- SoftwareProperties/SoftwareProperties.py | 32 ++--- SoftwareProperties/dialog_add_sources_list.py | 133 ++++++++++++++++++ data/glade/SoftwarePropertiesDialogs.glade | 188 ++++++++++++++++++++++++++ 3 files changed, 333 insertions(+), 20 deletions(-) create mode 100644 SoftwareProperties/dialog_add_sources_list.py diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 60a0208a..73544205 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -42,8 +42,7 @@ import aptsources import dialog_add import dialog_edit import dialog_cache_outdated -#import dialog_edit_predefined -#import dialog_sources_list +import dialog_add_sources_list from dialog_apt_key import apt_key from utils import * @@ -225,7 +224,6 @@ class SoftwareProperties(SimpleGladeApp): if self.file != None: self.open_file(file) - def distro_to_widgets(self): """ Represent the distro information in the user interface @@ -442,16 +440,15 @@ class SoftwareProperties(SimpleGladeApp): def open_file(self, file): """Show an confirmation for adding the channels of the specified file""" - #dialog = dialog_sources_list.AddSourcesList(self.window_main, - # self.sourceslist, - # self.render_source, - # self.get_comparable, - # self.datadir, - # file) - #res = dialog.run() - #if res == gtk.RESPONSE_OK: - # self.modified_sourceslist() - print "droped a sources.list" + dialog = dialog_add_sources_list.AddSourcesList(self.window_main, + self.sourceslist, + self.render_source, + self.get_comparable, + self.datadir, + file) + res = dialog.run() + if res == gtk.RESPONSE_OK: + self.modified_sourceslist() def on_sources_drag_data_received(self, widget, context, x, y, selection, target_type, timestamp): @@ -804,13 +801,8 @@ class SoftwareProperties(SimpleGladeApp): if not iter: return source_entry = model.get_value(iter, LIST_ENTRY_OBJ) - if source_entry.template == None: - dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist, - source_entry, self.datadir) - else: - dialog = dialog_edit_predefined.dialog_edit_predefined(self.window_main, - self.sourceslist, - source_entry, self.datadir) + dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist, + source_entry, self.datadir) if dialog.run() == gtk.RESPONSE_OK: self.modified_sourceslist() diff --git a/SoftwareProperties/dialog_add_sources_list.py b/SoftwareProperties/dialog_add_sources_list.py new file mode 100644 index 00000000..cf8ddd95 --- /dev/null +++ b/SoftwareProperties/dialog_add_sources_list.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python +import pygtk +import gtk +import gtk.glade +import gobject +import os +from optparse import OptionParser +from aptsources import SourcesList, SourceEntryMatcher +from gettext import gettext as _ +import gettext +import urllib +from utils import * + +class AddSourcesList: + def __init__(self, parent, sourceslist, source_renderer, + get_comparable, datadir, file): + print file + self.parent = parent + self.source_renderer = source_renderer + self.sources_old = sourceslist + self.get_comparable = get_comparable + self.file = self.format_uri(file) + self.glade = gtk.glade.XML(os.path.join(datadir, + "glade/SoftwarePropertiesDialogs.glade")) + self.glade.signal_autoconnect(self) + self.dialog = self.glade.get_widget("dialog_sources_list") + self.label = self.glade.get_widget("label_sources") + self.button_add = self.glade.get_widget("button_add") + self.button_cancel = self.glade.get_widget("button_cancel") + self.treeview = self.glade.get_widget("treeview_sources") + self.button_close = self.glade.get_widget("button_close") + self.scrolled = self.glade.get_widget("scrolled_window") + self.image = self.glade.get_widget("image_sources_list") + + self.dialog.realize() + if self.parent != None: + self.dialog.set_transient_for(parent) + else: + self.dialog.set_title(_("Add Software Channels")) + self.dialog.window.set_functions(gtk.gdk.FUNC_MOVE) + + # Setup the treeview + self.store = gtk.ListStore(gobject.TYPE_STRING) + self.treeview.set_model(self.store) + cell = gtk.CellRendererText() + cell.set_property("xpad", 2) + cell.set_property("ypad", 2) + column = gtk.TreeViewColumn("Software Channel", cell, markup=0) + column.set_max_width(500) + self.treeview.append_column(column) + + # Parse the source.list file + try: + self.sources = SingleSourcesList(self.file) + except: + self.error() + return + + # show the found channels or an error message + if len(self.sources.list) > 0: + self.button_close.hide() + counter = 0 + + for source in self.sources.list: + if source.invalid or source.disabled: + continue + self.sources.matcher.match(source) + # sort the list + self.sources.list.sort(key=self.get_comparable) + + for source in self.sources.list: + if source.invalid or source.disabled: + continue + counter = counter +1 + line = self.source_renderer(source) + self.store.append([line]) + if counter == 0: + self.error() + return + + header = gettext.ngettext("Add the following software channel?", + "Add the following software channels?", + counter) + body = _("You can install software from a channel. Use "\ + "trusted channels, only.") + self.label.set_markup("%s\n\n%s" % (header, body)) + self.button_add.set_use_underline(True) + self.button_add.set_label(gettext.ngettext("_Add Channel", + "_Add Channels", + counter)) + else: + self.error() + return + + def error(self): + self.button_add.hide() + self.button_cancel.hide() + self.scrolled.hide() + self.button_close.show() + self.image.set_from_stock(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG) + header = _("Could not add any software channels") + body = _("The file '%s' does not contain any valid " + "software channels." % self.file) + self.label.set_markup("%s\n\n%s" % (header, body)) + + def run(self): + res = self.dialog.run() + if res == gtk.RESPONSE_OK: + for source in self.sources: + self.sources_old.add(source.type, + source.uri, + source.dist, + source.comps, + source.comment) + self.dialog.destroy() + return res + + def format_uri(self, uri): + path = urllib.url2pathname(uri) # escape special chars + path = path.strip('\r\n\x00') # remove \r\n and NULL + if path.startswith('file:\\\\\\'): # windows + path = path[8:] # 8 is len('file:///') + elif path.startswith('file://'): #nautilus, rox + path = path[7:] # 7 is len('file://') + elif path.startswith('file:'): # xffm + path = path[5:] # 5 is len('file:') + return path + +class SingleSourcesList(SourcesList): + def __init__(self, file): + self.matcher = SourceEntryMatcher() + self.list = [] + self.load(file) diff --git a/data/glade/SoftwarePropertiesDialogs.glade b/data/glade/SoftwarePropertiesDialogs.glade index b381965b..e95d31e7 100644 --- a/data/glade/SoftwarePropertiesDialogs.glade +++ b/data/glade/SoftwarePropertiesDialogs.glade @@ -895,4 +895,192 @@ You need a working internet connection to continue. + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + GTK_RELIEF_NORMAL + True + -5 + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + gtk-dialog-question + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 12 + + + + True + + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 200 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + -- cgit v1.2.3 From 16c3025952c0828ed474acb724b05f04df12fa30 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 22 Jul 2006 18:19:57 +0200 Subject: * allow to replace the current sources by the ones from a file --- SoftwareProperties/SoftwareProperties.py | 16 +++++++-- SoftwareProperties/dialog_add_sources_list.py | 52 ++++++++++++--------------- data/glade/SoftwarePropertiesDialogs.glade | 34 +++++++----------- 3 files changed, 47 insertions(+), 55 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 73544205..f7a40821 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -62,6 +62,8 @@ CONF_MAP = { COLUMN_DESC ) = range(2) +RESPONSE_REPLACE = 1 +RESPONSE_ADD = 2 # columns of the source_store ( @@ -446,9 +448,17 @@ class SoftwareProperties(SimpleGladeApp): self.get_comparable, self.datadir, file) - res = dialog.run() - if res == gtk.RESPONSE_OK: - self.modified_sourceslist() + (res, new_sources) = dialog.run() + if res == RESPONSE_REPLACE: + self.sourceslist.list = [] + if res in (RESPONSE_ADD, RESPONSE_REPLACE): + for source in new_sources: + self.sourceslist.add(source.type, + source.uri, + source.dist, + source.comps, + source.comment) + self.modified_sourceslist() def on_sources_drag_data_received(self, widget, context, x, y, selection, target_type, timestamp): diff --git a/SoftwareProperties/dialog_add_sources_list.py b/SoftwareProperties/dialog_add_sources_list.py index cf8ddd95..b0a868b1 100644 --- a/SoftwareProperties/dialog_add_sources_list.py +++ b/SoftwareProperties/dialog_add_sources_list.py @@ -17,18 +17,18 @@ class AddSourcesList: print file self.parent = parent self.source_renderer = source_renderer - self.sources_old = sourceslist + self.sourceslist = sourceslist self.get_comparable = get_comparable self.file = self.format_uri(file) self.glade = gtk.glade.XML(os.path.join(datadir, "glade/SoftwarePropertiesDialogs.glade")) self.glade.signal_autoconnect(self) - self.dialog = self.glade.get_widget("dialog_sources_list") + self.dialog = self.glade.get_widget("dialog_add_sources_list") self.label = self.glade.get_widget("label_sources") self.button_add = self.glade.get_widget("button_add") self.button_cancel = self.glade.get_widget("button_cancel") + self.button_replace = self.glade.get_widget("button_replace") self.treeview = self.glade.get_widget("treeview_sources") - self.button_close = self.glade.get_widget("button_close") self.scrolled = self.glade.get_widget("scrolled_window") self.image = self.glade.get_widget("image_sources_list") @@ -51,24 +51,23 @@ class AddSourcesList: # Parse the source.list file try: - self.sources = SingleSourcesList(self.file) + self.new_sources = SingleSourcesList(self.file) except: self.error() return # show the found channels or an error message - if len(self.sources.list) > 0: - self.button_close.hide() + if len(self.new_sources.list) > 0: counter = 0 - for source in self.sources.list: + for source in self.new_sources.list: if source.invalid or source.disabled: continue - self.sources.matcher.match(source) + self.new_sources.matcher.match(source) # sort the list - self.sources.list.sort(key=self.get_comparable) + self.new_sources.list.sort(key=self.get_comparable) - for source in self.sources.list: + for source in self.new_sources.list: if source.invalid or source.disabled: continue counter = counter +1 @@ -78,42 +77,35 @@ class AddSourcesList: self.error() return - header = gettext.ngettext("Add the following software channel?", - "Add the following software channels?", + header = gettext.ngettext("Install software additionally or " + "only from this source?", + "Install software additionally or " + "only from these sources?", counter) - body = _("You can install software from a channel. Use "\ - "trusted channels, only.") + body = _("You can either add the following sources or replace your " + "current sources by them. Only install software from " + "trusted sources.") self.label.set_markup("%s\n\n%s" % (header, body)) - self.button_add.set_use_underline(True) - self.button_add.set_label(gettext.ngettext("_Add Channel", - "_Add Channels", - counter)) else: self.error() return def error(self): self.button_add.hide() - self.button_cancel.hide() + self.button_cancel.set_use_stock(True) + self.button_cancel.set_label("gtk-close") + self.button_replace.hide() self.scrolled.hide() - self.button_close.show() self.image.set_from_stock(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG) - header = _("Could not add any software channels") + header = _("There are no sources to install software from") body = _("The file '%s' does not contain any valid " - "software channels." % self.file) + "software sources." % self.file) self.label.set_markup("%s\n\n%s" % (header, body)) def run(self): res = self.dialog.run() - if res == gtk.RESPONSE_OK: - for source in self.sources: - self.sources_old.add(source.type, - source.uri, - source.dist, - source.comps, - source.comment) self.dialog.destroy() - return res + return res, self.new_sources def format_uri(self, uri): path = urllib.url2pathname(uri) # escape special chars diff --git a/data/glade/SoftwarePropertiesDialogs.glade b/data/glade/SoftwarePropertiesDialogs.glade index e95d31e7..b4bf6180 100644 --- a/data/glade/SoftwarePropertiesDialogs.glade +++ b/data/glade/SoftwarePropertiesDialogs.glade @@ -895,7 +895,7 @@ You need a working internet connection to continue. - + 6 GTK_WINDOW_TOPLEVEL @@ -924,51 +924,41 @@ You need a working internet connection to continue. GTK_BUTTONBOX_END - + True True True - gtk-cancel - True + _Replace + True GTK_RELIEF_NORMAL True - -6 + 1 - + True True True + gtk-cancel + True GTK_RELIEF_NORMAL True - -5 - - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - + -6 - + True True True - gtk-close + gtk-add True GTK_RELIEF_NORMAL True - -7 + 2 -- cgit v1.2.3 From 4e6c88a25b555e6be432e44ca6c4d2dfeb8dbfa8 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 22 Jul 2006 18:41:40 +0200 Subject: * add the mime handler for sources.list * fix the translation for the moved files --- data/mime/apt.xml.in | 8 ++++++++ po/POTFILES.in | 11 ++++++----- setup.py | 6 ++++++ 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 data/mime/apt.xml.in diff --git a/data/mime/apt.xml.in b/data/mime/apt.xml.in new file mode 100644 index 00000000..6861cde9 --- /dev/null +++ b/data/mime/apt.xml.in @@ -0,0 +1,8 @@ + + + + + Software sources list + + + diff --git a/po/POTFILES.in b/po/POTFILES.in index c74e2d16..b383e84c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -12,13 +12,14 @@ UpdateManager/fakegconf.py UpdateManager/ReleaseNotesViewer.py UpdateManager/GtkProgress.py UpdateManager/UpdateManager.py -data/UpdateManager.glade -data/SoftwareProperties.glade -data/SoftwarePropertiesDialogs.glade +data/mime/apt.xml.in +data/glade/UpdateManager.glade +data/glade/SoftwareProperties.glade +data/glade/SoftwarePropertiesDialogs.glade data/update-manager.desktop.in data/update-manager.schemas.in data/software-properties.desktop.in -[type: gettext/rfc822deb] channels/Ubuntu.info.in -[type: gettext/rfc822deb] channels/Debian.info.in +[type: gettext/rfc822deb] data/channels/Ubuntu.info.in +[type: gettext/rfc822deb] data/channels/Debian.info.in [type: python] update-manager [type: python] software-properties diff --git a/setup.py b/setup.py index be346881..b2d0ad56 100755 --- a/setup.py +++ b/setup.py @@ -36,6 +36,8 @@ for size in glob.glob("data/icons/*"): print ICONS +os.system("intltool-merge -d po data/mime/apt.xml.in"\ + " build/apt.xml") os.system("intltool-merge -d po data/update-manager.schemas.in"\ " build/update-manager.schemas") @@ -75,5 +77,9 @@ setup(name='update-manager', ('share/gconf/schemas', glob.glob("build/*.schemas") ), + ('share/mime/packages', + ["build/apt.xml"] + ) + ] + I18NFILES + HELPFILES + ICONS, ) -- cgit v1.2.3 From dec3df53719f801bff6e72d3fbf95c42919aa38e Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 22 Jul 2006 18:48:11 +0200 Subject: * Add mime type to the desktop file of the software sources --- data/software-properties.desktop.in | 1 + 1 file changed, 1 insertion(+) diff --git a/data/software-properties.desktop.in b/data/software-properties.desktop.in index 330fc8bc..acd01211 100644 --- a/data/software-properties.desktop.in +++ b/data/software-properties.desktop.in @@ -9,5 +9,6 @@ X-MultipleArgs=false Type=Application Encoding=UTF-8 Categories=Application;System;Settings; +MimeType=text/x-apt-sources-list X-KDE-SubstituteUID=true X-Ubuntu-Gettext-Domain=update-manager -- cgit v1.2.3 From b06882213c5326028a43a6c5fc2ce7662f4c9da7 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Sat, 22 Jul 2006 19:05:20 +0200 Subject: * Create the source/channel templates during build time --- data/channels/Debian.info | 57 ------------- data/channels/Ubuntu.info | 209 ---------------------------------------------- setup.py | 6 +- 3 files changed, 5 insertions(+), 267 deletions(-) delete mode 100644 data/channels/Debian.info delete mode 100644 data/channels/Ubuntu.info diff --git a/data/channels/Debian.info b/data/channels/Debian.info deleted file mode 100644 index 3958607a..00000000 --- a/data/channels/Debian.info +++ /dev/null @@ -1,57 +0,0 @@ -ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog - -Suite: sarge -RepositoryType: deb -BaseURI: http://http.us.debian.org/debian/ -Description: Debian 3.1 "Sarge" -Component: main -Enabled: 1 -CompDescription: Officially supported -Component: contrib -Enabled: 0 -CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -CompDescription: Non-DFSG-compatible Software - -Suite: sarge/updates -RepositoryType: deb -BaseURI: http://security.debian.org/ -Description: Debian 3.1 "Sarge" Security Updates -Component: main -Enabled: 1 -CompDescription: Officially supported -Component: contrib -Enabled: 0 -CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -CompDescription: Non-DFSG-compatible Software - -Suite: etch -RepositoryType: deb -BaseURI: http://http.us.debian.org/debian/ -Description: Debian "Etch" (testing) -Component: main -Enabled: 1 -CompDescription: Officially supported -Component: contrib -Enabled: 0 -CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -CompDescription: Non-DFSG-compatible Software - -Suite: sid -RepositoryType: deb -BaseURI: http://http.us.debian.org/debian/ -Description: Debian "Sid" (unstable) -Component: main -Enabled: 1 -CompDescription: Officially supported -Component: contrib -Enabled: 0 -CompDescription: DFSG-compatible Software with Non-Free Dependencies -Component: non-free -Enabled: 0 -CompDescription: Non-DFSG-compatible Software diff --git a/data/channels/Ubuntu.info b/data/channels/Ubuntu.info deleted file mode 100644 index 28fe85b3..00000000 --- a/data/channels/Ubuntu.info +++ /dev/null @@ -1,209 +0,0 @@ -ChangelogURI: http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/changelog - -Suite: dapper -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 6.04 'Dapper Drake' -Component: main -Enabled: 1 -CompDescription: Officially supported -CompDescriptionLong: Free software that is officially supported by Canonical Ltd. (main) -Component: universe -Enabled: 0 -CompDescription: Community maintained (universe) -CompDescriptionLong: Free software that is maintained by the community (universe) -Component: restricted -Enabled: 1 -CompDescription: Non-free drivers -CompDescriptionLong: Non-free drivers for devices (restricted) -Component: multiverse -Enabled: 0 -CompDescription: Restricted software (Multiverse) -CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) - -Suite: dapper -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*6.04 -Description: Cdrom with Ubuntu 6.04 'Dapper Drake' -Available: False -Component: main -Enabled: 1 -CompDescription: Oficially supported -Component: restricted -Enabled: 1 -CompDescription: Restricted copyright - -Suite: dapper-security -ParentSuite: dapper -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -Description: Ubuntu 6.04 Security Updates - -Suite: dapper-updates -ParentSuite: dapper -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 6.04 Updates - -Suite: dapper-backports -ParentSuite: dapper -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 6.04 Backports - -Suite: dapper-backports -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 5.10 'Breezy Badger' -Component: main -Enabled: 1 -CompDescription: Officially supported -Component: restricted -Enabled: 1 -CompDescription: Restricted copyright -Component: universe -Enabled: 0 -CompDescription: Community maintained (Universe) -Component: multiverse -Enabled: 0 -CompDescription: Non-free (Multiverse) - -Suite: breezy -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*5.10 -Description: Cdrom with Ubuntu 5.10 'Breezy Badger' -Available: False -Component: main -Enabled: 1 -CompDescription: Oficially supported -Component: restricted -Enabled: 1 -CompDescription: Restricted copyright - -Suite: breezy-security -ParentSuite: breezy -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -Description: Ubuntu 5.10 Security Updates - -Suite: breezy-updates -ParentSuite: breezy -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 5.10 Updates - -Suite: breezy-backports -ParentSuite: breezy -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 5.10 Backports - -Suite: hoary -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 5.04 'Hoary Hedgehog' -Component: main -Enabled: 1 -CompDescription: Oficially supported -Component: restricted -Enabled: 1 -CompDescription: Restricted copyright -Component: universe -Enabled: 0 -CompDescription: Community maintained (Universe) -Component: multiverse -Enabled: 0 -CompDescription: Non-free (Multiverse) - -Suite: hoary -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*5.04 -Description: Cdrom with Ubuntu 5.04 'Hoary Hedgehog' -Available: False -Component: main -Enabled: 1 -CompDescription: Oficially supported -Component: restricted -Enabled: 1 -CompDescription: Restricted copyright - -Suite: hoary-security -ParentSuite: hoary -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -Description: Ubuntu 5.04 Security Updates - -Suite: hoary-updates -ParentSuite: hoary -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 5.04 Updates - -Suite: hoary-backports -ParentSuite: hoary -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 5.04 Backports - -Suite: warty -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 4.10 'Warty Warthog' -Component: main -Enabled: 1 -CompDescription: Oficially supported -Component: restricted -Enabled: 1 -CompDescription: Restricted copyright -Component: universe -Enabled: 0 -CompDescription: Community maintained (Universe) -Component: multiverse -Enabled: 0 -CompDescription: Non-free (Multiverse) - -Suite: warty -MatchName: .* -BaseURI: cdrom:\[Ubuntu.*4.10 -Description: Cdrom with Ubuntu 4.10 'Warty Warthog' -Available: False -Component: main -Enabled: 1 -CompDescription: Oficially supported -Component: restricted -Enabled: 1 -CompDescription: Restricted copyright - -Suite: warty-security -ParentSuite: warty -RepositoryType: deb -BaseURI: http://security.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com -Description: Ubuntu 4.10 Security Updates - -Suite: warty-updates -ParentSuite: warty -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 4.10 Updates - -Suite: warty-backports -ParentSuite: warty -RepositoryType: deb -BaseURI: http://archive.ubuntu.com/ubuntu/ -MatchURI: archive.ubuntu.com/ubuntu/ -Description: Ubuntu 4.10 Backports diff --git a/setup.py b/setup.py index b2d0ad56..12c96ec3 100755 --- a/setup.py +++ b/setup.py @@ -36,6 +36,10 @@ for size in glob.glob("data/icons/*"): print ICONS +for template in glob.glob("data/channels/*.info.in"): + os.system("intltool-merge -d po data/channels/%s" + " build/%s" % (os.path.basename(template), + os.path.basename(template)[:-3])) os.system("intltool-merge -d po data/mime/apt.xml.in"\ " build/apt.xml") os.system("intltool-merge -d po data/update-manager.schemas.in"\ @@ -68,7 +72,7 @@ setup(name='update-manager', glob.glob("data/channels/README.channels") ), ('share/update-manager/channels', - glob.glob("data/channels/*.info") + glob.glob("build/*.info") ), ('share/applications', ["data/update-manager.desktop", -- cgit v1.2.3 From b58deaf04c187b16a0c97878e90810401efda16c Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Mon, 24 Jul 2006 23:56:30 +0200 Subject: * Add support for Edgy --- data/channels/Ubuntu.info.in | 59 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/data/channels/Ubuntu.info.in b/data/channels/Ubuntu.info.in index e01a9221..b3fcff7d 100644 --- a/data/channels/Ubuntu.info.in +++ b/data/channels/Ubuntu.info.in @@ -1,10 +1,65 @@ _ChangelogURI: http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/changelog +Suite: edgy +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Ubuntu 6.10 'Edgy Eft' +Component: main +Enabled: 1 +_CompDescription: Officially supported +_CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main) +Component: universe +Enabled: 0 +_CompDescription: Community maintained (universe) +_CompDescriptionLong: OpenSource software that is maintained by the community (universe) +Component: restricted +Enabled: 1 +_CompDescription: Non-free drivers +_CompDescriptionLong: Proprietary drivers for devices (restricted) +Component: multiverse +Enabled: 0 +_CompDescription: Restricted software (Multiverse) +_CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) + +Suite: edgy +MatchName: .* +BaseURI: cdrom:\[Ubuntu.*6.10 +_Description: Cdrom with Ubuntu 6.10 'Edgy Eft' +Available: False +Component: main +Enabled: 1 +_CompDescription: Oficially supported +Component: restricted +Enabled: 1 +_CompDescription: Restricted copyright + +Suite: edgy-security +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://security.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com +_Description: Important security updates + +Suite: edgy-updates +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Recommended updates + +Suite: edgy-backports +ParentSuite: dapper +RepositoryType: deb +BaseURI: http://archive.ubuntu.com/ubuntu/ +MatchURI: archive.ubuntu.com/ubuntu/ +_Description: Backported updates + Suite: dapper RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ -_Description: Ubuntu 6.06 'Dapper Drake' +_Description: Ubuntu 6.06 LTS 'Dapper Drake' Component: main Enabled: 1 _CompDescription: Officially supported @@ -25,7 +80,7 @@ _CompDescriptionLong: Software that is restricted by copyright or legal issues ( Suite: dapper MatchName: .* BaseURI: cdrom:\[Ubuntu.*6.06 -_Description: Cdrom with Ubuntu 6.06 'Dapper Drake' +_Description: Cdrom with Ubuntu 6.06 LTS 'Dapper Drake' Available: False Component: main Enabled: 1 -- cgit v1.2.3 From fdec0c43d748097f6c32fab86d29a617d021fccc Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Tue, 25 Jul 2006 21:20:45 +0200 Subject: * fix also child repos for edgy --- data/channels/Ubuntu.info.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/channels/Ubuntu.info.in b/data/channels/Ubuntu.info.in index b3fcff7d..bac13754 100644 --- a/data/channels/Ubuntu.info.in +++ b/data/channels/Ubuntu.info.in @@ -35,21 +35,21 @@ Enabled: 1 _CompDescription: Restricted copyright Suite: edgy-security -ParentSuite: dapper +ParentSuite: edgy RepositoryType: deb BaseURI: http://security.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com _Description: Important security updates Suite: edgy-updates -ParentSuite: dapper +ParentSuite: edgy RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ _Description: Recommended updates Suite: edgy-backports -ParentSuite: dapper +ParentSuite: edgy RepositoryType: deb BaseURI: http://archive.ubuntu.com/ubuntu/ MatchURI: archive.ubuntu.com/ubuntu/ -- cgit v1.2.3 From c2a2f69a9a9ee1f45290b15e76f6098c4b28bd98 Mon Sep 17 00:00:00 2001 From: "glatzor@ubuntu.com" <> Date: Thu, 27 Jul 2006 16:32:27 +0200 Subject: * Fix the building of the sources templates --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 12c96ec3..7ea56440 100755 --- a/setup.py +++ b/setup.py @@ -37,8 +37,8 @@ print ICONS for template in glob.glob("data/channels/*.info.in"): - os.system("intltool-merge -d po data/channels/%s" - " build/%s" % (os.path.basename(template), + os.system("sed s/^_// data/channels/%s" + " > build/%s" % (os.path.basename(template), os.path.basename(template)[:-3])) os.system("intltool-merge -d po data/mime/apt.xml.in"\ " build/apt.xml") -- cgit v1.2.3 From 54d5696fa964d3cc7a79a1ba0ed4083d9701de1e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Jul 2006 17:20:33 +0200 Subject: * data/glade/SoftwareProperties.glade: - changed the text for Popcon participation * SoftwareProperties/SoftwareProperties.py: - support popcon pariticipation --- SoftwareProperties/SoftwareProperties.py | 22 ++++++++++++++++++++++ data/glade/SoftwareProperties.glade | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index f7a40821..07170fa6 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -440,6 +440,27 @@ class SoftwareProperties(SimpleGladeApp): source.file) self.modified_sourceslist() + def on_checkbutton_popcon_toggled(self, widget): + """ The user clicked on the popcon paritipcation button """ + popcon = "/etc/popularity-contest.conf" + if widget.get_active(): + new_value = "yes" + else: + new_value = "no" + if os.path.exists(popcon): + # read it + lines = open(popcon).read().split("\n") + for line in lines: + try: + (key,value) = line.split("=") + if key == "PARTICIPATE": + lines[lines.index(line)] = 'PARTICIPATE=\"%s"' % new_value + except ValueError: + continue + # write it + open(popcon,"w").write("\n".join(lines)) + + def open_file(self, file): """Show an confirmation for adding the channels of the specified file""" dialog = dialog_add_sources_list.AddSourcesList(self.window_main, @@ -1003,3 +1024,4 @@ class GtkCdromProgress(apt.progress.CdromProgress, SimpleGladeApp): return True return False + diff --git a/data/glade/SoftwareProperties.glade b/data/glade/SoftwareProperties.glade index 08ffd743..98bf65bc 100644 --- a/data/glade/SoftwareProperties.glade +++ b/data/glade/SoftwareProperties.glade @@ -1057,7 +1057,7 @@ True - <i>Please take part in the popularity contest, to improve the user experience of Ubuntu. Therefor the following data will be collected and sent to the Ubuntu project anonymously on a weekly basis: the list of installed software and how often it was used. + <i>To improve the user experience of Ubuntu please take part in the popularity contest. If you do so the list of installed software and how often it was used will be collected and sent anonymously to the Ubuntu project on a weekly basis. The results are used to improve the support for popular applications and to rank applications in the search results.</i> False -- cgit v1.2.3