summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglatzor@ubuntu.com <>2006-06-29 02:47:36 +0200
committerglatzor@ubuntu.com <>2006-06-29 02:47:36 +0200
commit9d01fe4b4e6c370f76e83f500554cd7dd0512093 (patch)
tree68a09dcf58903e4b29d717397d6ce609088de368
parent7c0fdd7a719a1127a838a33bc9415fa4800c453b (diff)
downloadpython-apt-9d01fe4b4e6c370f76e83f500554cd7dd0512093.tar.gz
* Extract the components and the child repos (updates) of the currently
used distribution from the templates
-rw-r--r--SoftwareProperties/SoftwareProperties.py60
-rw-r--r--data/SoftwareProperties.glade19
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("<b>%s</b>" % 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 @@
<property name="border_width">6</property>
<property name="width_request">620</property>
<property name="height_request">400</property>
- <property name="title" translatable="yes">Software Sources</property>
+ <property name="title" translatable="yes">Software Repositories</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER</property>
<property name="modal">False</property>
@@ -76,7 +76,22 @@
</child>
<child>
- <placeholder/>
+ <widget class="GtkCheckButton" id="checkbutton_source_code">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Source code</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
</child>
</widget>
</child>