From a79e4fc80ef854844e560e5b547d1398ab149360 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 29 Nov 2005 17:31:21 +0100 Subject: * make the software preferences work again completely --- SoftwareProperties/SoftwareProperties.py | 10 +++++++--- SoftwareProperties/__init__.py | 1 + SoftwareProperties/aptsources.py | 6 ++++-- SoftwareProperties/dialog_edit.py | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) (limited to 'SoftwareProperties') diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 86586cc1..5c6e8fef 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -29,6 +29,7 @@ import apt_pkg import gobject import shutil import gettext +import os #sys.path.append("@prefix/share/update-manager/python") @@ -101,9 +102,12 @@ class SoftwareProperties(SimpleGladeApp): self.treeview1.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) + self.treeview1.append_column(source_col) self.sourceslist = aptsources.SourcesList() @@ -123,13 +127,13 @@ class SoftwareProperties(SimpleGladeApp): for source in self.sourceslist.list: if source.invalid or source.disabled: continue - (a_type, dists, comps) = self.matcher.match(source) + (a_type, dist, comps) = self.matcher.match(source) contents = "" if source.comment != "": contents += "%s\n\n" % (source.comment) - contents += "%s (%s)" % (dists, a_type) - + contents +="%s (%s) \n%s" % (dist,a_type, comps) + self.source_store.append([contents, not source.disabled, source]) def reload_keyslist(self): diff --git a/SoftwareProperties/__init__.py b/SoftwareProperties/__init__.py index e69de29b..1e6834bd 100644 --- a/SoftwareProperties/__init__.py +++ b/SoftwareProperties/__init__.py @@ -0,0 +1 @@ +from SoftwareProperties import SoftwareProperties diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 640a70b4..aa3cbb5a 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -27,12 +27,12 @@ import re import apt_pkg import glob -from DistInfo import DistInfo +from UpdateManager.Common.DistInfo import DistInfo # actual source.list entries class SourceEntry: - def __init__(self, line,file): + def __init__(self, line,file=None): self.invalid = False self.disabled = False self.type = "" @@ -41,6 +41,8 @@ class SourceEntry: self.comps = [] self.comment = "" self.line = line + if file == None: + file = apt_pkg.Config.FindDir("Dir::Etc")+apt_pkg.Config.Find("Dir::Etc::sourcelist") self.file = file self.parse(line) diff --git a/SoftwareProperties/dialog_edit.py b/SoftwareProperties/dialog_edit.py index 32e6ac0c..87cc9799 100644 --- a/SoftwareProperties/dialog_edit.py +++ b/SoftwareProperties/dialog_edit.py @@ -38,7 +38,7 @@ class dialog_edit: if os.path.exists("../data/SoftwarePropertiesDialogs.glade"): self.gladexml = gtk.glade.XML("../data/SoftwarePropertiesDialogs.glade") else: - self.gladexml = gtk.glade.XML("%s/SoftwarePropertiesDialogs.glade" % datadir) + self.gladexml = gtk.glade.XML("%s/glade/SoftwarePropertiesDialogs.glade" % datadir) self.main = self.gladexml.get_widget("dialog_edit") self.main.set_transient_for(parent) -- cgit v1.2.3