summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Heinlein <sebastian.heinlein@web.de>2006-02-26 09:26:33 +0100
committerSebastian Heinlein <sebastian.heinlein@web.de>2006-02-26 09:26:33 +0100
commit9184e9d648fb8ff3f8a437817cb67d5cf17e2010 (patch)
treeb55607935b49b5653b65ea573dfa9245f6453f3a
parent9f1f9070d249457871a92d52eb3817c73e6fe0ac (diff)
downloadpython-apt-9184e9d648fb8ff3f8a437817cb67d5cf17e2010.tar.gz
* Use the dist name from lsbrelease in the add channel dialog
-rw-r--r--SoftwareProperties/aptsources.py4
-rw-r--r--SoftwareProperties/dialog_add.py6
-rw-r--r--UpdateManager/Common/DistInfo.py5
-rw-r--r--data/SoftwarePropertiesDialogs.glade6
4 files changed, 16 insertions, 5 deletions
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 397ebb38..532600fd 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -450,7 +450,7 @@ class SourcesList:
# templates for the add dialog
class SourceEntryTemplate(SourceEntry):
- def __init__(self,a_type,uri,dist,description,comps):
+ def __init__(self, a_type, uri, dist, description, comps):
self.comps = []
self.comps_descriptions = []
self.type = a_type
@@ -472,6 +472,8 @@ class SourceEntryTemplates:
dinfo = DistInfo (base_dir=datadir+"channels/")
+ self.dist = dinfo.dist
+
for suite in dinfo.suites:
comps = []
for comp in suite.components:
diff --git a/SoftwareProperties/dialog_add.py b/SoftwareProperties/dialog_add.py
index effd9f24..8ccd2080 100644
--- a/SoftwareProperties/dialog_add.py
+++ b/SoftwareProperties/dialog_add.py
@@ -26,6 +26,7 @@ import os
import gobject
import gtk
import gtk.glade
+from gettext import gettext as _
import aptsources
@@ -52,6 +53,11 @@ class dialog_add:
self.combo.pack_start(cell, True)
self.combo.add_attribute(cell, 'text', 0)
self.fill_combo(self.combo)
+ self.label_dist = self.gladexml.get_widget("label_dist")
+ if self.templatelist.dist != "":
+ # TRANSLATORS: %s is the distribution name, eg. Ubuntu or Debian
+ self.label_dist.set_markup("<b>%s</b>" % \
+ _("%s channels" % self.templatelist.dist))
# Setup the custom channel widgets
self.entry = self.gladexml.get_widget("entry_source_line")
diff --git a/UpdateManager/Common/DistInfo.py b/UpdateManager/Common/DistInfo.py
index df244a51..102b981c 100644
--- a/UpdateManager/Common/DistInfo.py
+++ b/UpdateManager/Common/DistInfo.py
@@ -22,6 +22,7 @@
import os
import gettext
+from os import getenv
import ConfigParser
_ = gettext.gettext
@@ -51,6 +52,8 @@ class DistInfo:
pipe.close()
del pipe
+ self.dist = dist
+
dist_fname = "%s/%s.info" % (base_dir, dist)
dist_file = open (dist_fname)
if not dist_file:
@@ -100,7 +103,7 @@ class DistInfo:
if __name__ == "__main__":
- d = DistInfo ("Debian", "../distribution-data")
+ d = DistInfo ("Debian", "../../channels")
print d.changelogs_uri
for suite in d.suites:
print suite.name
diff --git a/data/SoftwarePropertiesDialogs.glade b/data/SoftwarePropertiesDialogs.glade
index 3e4be82f..175d152b 100644
--- a/data/SoftwarePropertiesDialogs.glade
+++ b/data/SoftwarePropertiesDialogs.glade
@@ -92,9 +92,9 @@
<signal name="toggled" handler="on_radiobutton_official_toggled" last_modification_time="Thu, 23 Feb 2006 10:03:57 GMT"/>
<child>
- <widget class="GtkLabel" id="label71">
+ <widget class="GtkLabel" id="label_dist">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Official Ubuntu Channel&lt;/b&gt;</property>
+ <property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -247,7 +247,7 @@
<child>
<widget class="GtkLabel" id="label70">
<property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Custom Channel&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Custom channel&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>