summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-03-20 11:16:50 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-03-20 11:16:50 +0100
commit78f281065fb9bbd8a36b52b457397b3e886abcc7 (patch)
tree6bee9758f1742be4ce97cec7f4ae605bbe877cc8
parent56fa71590be9df25acc234df153412ef68a30ae2 (diff)
parent8cfb54ced335aa488ca3cfad00dad434617fb62a (diff)
downloadpython-apt-78f281065fb9bbd8a36b52b457397b3e886abcc7.tar.gz
* fix the missing toggle buttons in software-properties
-rw-r--r--SoftwareProperties/SoftwareProperties.py21
-rw-r--r--UpdateManager/UpdateManager.py23
-rw-r--r--data/SoftwarePropertiesDialogs.glade66
-rw-r--r--data/UpdateManager.glade278
-rwxr-xr-xsetup.py4
5 files changed, 251 insertions, 141 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 41da0b32..4902e44d 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -190,6 +190,11 @@ class SoftwareProperties(SimpleGladeApp):
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.append_column(toggle_col)
self.treeview_sources.append_column(source_col)
self.sourceslist = aptsources.SourcesList()
@@ -207,7 +212,7 @@ class SoftwareProperties(SimpleGladeApp):
def reload_sourceslist(self):
self.source_store.clear()
for source in self.sourceslist.list:
- if source.invalid or source.disabled:
+ if source.invalid:
continue
(a_type, dist, comps) = self.matcher.match(source)
@@ -217,6 +222,13 @@ class SoftwareProperties(SimpleGladeApp):
contents +="<big><b>%s </b></big> (%s) <small>\n%s</small>" % (dist,a_type, comps)
self.source_store.append([contents, not source.disabled, source])
+ if len(self.source_store) < 1:
+ self.button_remove.set_sensitive(False)
+ self.button_edit.set_sensitive(False)
+ else:
+ self.button_remove.set_sensitive(True)
+ self.button_edit.set_sensitive(True)
+ self.treeview_sources.set_cursor(0)
def reload_keyslist(self):
self.keys_store.clear()
@@ -445,6 +457,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
# FIXME: move this into a different file
class GtkCdromProgress(apt.progress.CdromProgress, SimpleGladeApp):
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index 07634d87..27e6b7bb 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -346,14 +346,28 @@ class UpdateManager(SimpleGladeApp):
iter = model.get_iter(path)
# set descr
- long_desc = model.get_value(iter, 5)
+ long_desc = model.get_value(iter, LIST_LONG_DESCR)
if long_desc == None:
return
+ # Skip the first line - it's a duplicate of the summary
+ i = long_desc.find("\n")
+ long_desc = long_desc[i+1:]
+ # do some regular expression magic on the description
+ # Add a newline before each bullet
+ p = re.compile(r'^(\s|\t)*(\*|0|-)',re.MULTILINE)
+ long_desc = p.sub('\n*', long_desc)
+ # replace all newlines by spaces
+ p = re.compile(r'\n', re.MULTILINE)
+ long_desc = p.sub(" ", long_desc)
+ # replace all multiple spaces by newlines
+ p = re.compile(r'\s\s+', re.MULTILINE)
+ long_desc = p.sub("\n", long_desc)
+
desc_buffer = self.textview_descr.get_buffer()
desc_buffer.set_text(utf8(long_desc))
# now do the changelog
- name = model.get_value(iter, 2)
+ name = model.get_value(iter, LIST_NAME)
if name == None:
return
@@ -405,7 +419,7 @@ class UpdateManager(SimpleGladeApp):
self.update_count()
def update_count(self):
- if len(self.packages) == 0:
+ if self.list.num_updates == 0:
text_header= "<big><b>"+_("Your system is up-to-date")+"</b></big>"
text_download = ""
self.expander_details.set_sensitive(False)
@@ -609,7 +623,8 @@ class UpdateManager(SimpleGladeApp):
contents = "<big><b>%s</b></big>\n<small>%s\n\n" % (name, summary)
contents = contents + _("New version: %s (Size: %s)") % (pkg.candidateVersion,apt.SizeToStr(pkg.packageSize)) + "</small>"
- iter = self.store.append([True, contents, pkg.name, pkg.summary, pkg.candidateVersion, pkg.description, pkg])
+ iter = self.store.append([True, contents, pkg.name, pkg.summary,
+ pkg.candidateVersion, pkg.description, pkg])
self.add_update(pkg)
i = i + 1
diff --git a/data/SoftwarePropertiesDialogs.glade b/data/SoftwarePropertiesDialogs.glade
index d17f7ce5..a4d7ff41 100644
--- a/data/SoftwarePropertiesDialogs.glade
+++ b/data/SoftwarePropertiesDialogs.glade
@@ -1021,11 +1021,73 @@ Source</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
- <property name="label" translatable="yes">_Reload</property>
- <property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-10</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox37">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="stock">gtk-refresh</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label71">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Reload</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade
index 1e2d05b3..ac7a0345 100644
--- a/data/UpdateManager.glade
+++ b/data/UpdateManager.glade
@@ -275,83 +275,177 @@
</child>
<child>
- <widget class="GtkButton" id="button_install">
+ <widget class="GtkHBox" id="hbox19">
<property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="on_button_install_clicked" last_modification_time="Fri, 18 Feb 2005 22:38:03 GMT"/>
+ <property name="homogeneous">True</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkAlignment" id="alignment4">
+ <widget class="GtkButton" id="button1">
<property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
+ <property name="tooltip" translatable="yes">Check for available updates</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="on_button_reload_clicked" last_modification_time="Mon, 16 Jan 2006 20:40:51 GMT"/>
<child>
- <widget class="GtkHBox" id="hbox11">
+ <widget class="GtkAlignment" id="alignment8">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
<child>
- <widget class="GtkImage" id="image9">
+ <widget class="GtkHBox" id="hbox18">
<property name="visible">True</property>
- <property name="stock">gtk-apply</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image14">
+ <property name="visible">True</property>
+ <property name="stock">gtk-refresh</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label29">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Check</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button_install">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <signal name="clicked" handler="on_button_install_clicked" last_modification_time="Fri, 18 Feb 2005 22:38:03 GMT"/>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
<child>
- <widget class="GtkLabel" id="label16">
+ <widget class="GtkHBox" id="hbox11">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Install Updates</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image9">
+ <property name="visible">True</property>
+ <property name="stock">gtk-apply</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Install Updates</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
</widget>
</child>
</widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
</packing>
</child>
</widget>
@@ -689,82 +783,6 @@
<property name="spacing">6</property>
<child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Reload the latest information about updates</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="on_button_reload_clicked" last_modification_time="Mon, 16 Jan 2006 20:40:51 GMT"/>
-
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">0</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox14">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image10">
- <property name="visible">True</property>
- <property name="stock">gtk-refresh</property>
- <property name="icon_size">4</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Reload</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
<widget class="GtkButton" id="button_cancel">
<property name="visible">True</property>
<property name="can_default">True</property>
@@ -1176,7 +1194,7 @@
<child>
<widget class="GtkLabel" id="label28">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Reload</property>
+ <property name="label" translatable="yes">_Check</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1259,7 +1277,7 @@
<widget class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;You need to manually reload the latest information about updates&lt;/big&gt;&lt;/b&gt;
+ <property name="label" translatable="yes">&lt;b&gt;&lt;big&gt;You must check for updates manually&lt;/big&gt;&lt;/b&gt;
Your system does not check for updates automatically. You can configure this behavior in &quot;System&quot; -&gt; &quot;Administration&quot; -&gt; &quot;Software Properties&quot;.</property>
<property name="use_underline">False</property>
diff --git a/setup.py b/setup.py
index 873f5de4..a5916dfa 100755
--- a/setup.py
+++ b/setup.py
@@ -63,10 +63,6 @@ setup(name='update-manager',
),
('share/pixmaps',
["data/update-manager.png"]
- ),
- ('share/mime/packages',
- ["data/mime/apt.xml"]
- )
] + I18NFILES + HELPFILES,
)