summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-07 16:14:13 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-07 16:14:13 +0200
commit4b091d41293155442ce315bbe93a88fc1f5d16c6 (patch)
treec15a5c02f10865c14bdeffe5b9524633785f04be
parent0fc23b591dfd1615910e58f063f8cfbebe2c8fc4 (diff)
parente1ed65110380161f42eb0e3090197efeee012446 (diff)
downloadpython-apt-4b091d41293155442ce315bbe93a88fc1f5d16c6.tar.gz
* merged with glatzor
-rw-r--r--SoftwareProperties/SoftwareProperties.py5
-rw-r--r--UpdateManager/UpdateManager.py48
-rw-r--r--debian/changelog6
3 files changed, 55 insertions, 4 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 18e5d260..8ae98b55 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -720,11 +720,10 @@ class SoftwareProperties(SimpleGladeApp):
self.source_store.append([not source.disabled, contents,
source, False, True])
- if len(self.source_store) < 1:
+ (path_x, path_y) = self.treeview_sources.get_cursor()
+ if len(self.source_store) < 1 or path_x <0:
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()
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index 51e67115..5bdea61a 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -363,7 +363,8 @@ class UpdateManager(SimpleGladeApp):
self.treeview_update.append_column(column_install)
column_install.set_visible(True)
self.treeview_update.append_column(column)
- self.treeview_update.set_search_column(LIST_NAME)
+ self.treeview_update.set_search_column(LIST_NAME)
+ self.treeview_update.connect("button-press-event", self.show_context_menu)
# proxy stuff
@@ -543,6 +544,51 @@ class UpdateManager(SimpleGladeApp):
changes = self.cache.all_changes[name]
self.set_changes_buffer(changes_buffer, changes[0], name, changes[1])
+ def show_context_menu(self, widget, event):
+ """
+ Show a context menu if a right click was performed on an update entry
+ """
+ if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
+ menu = gtk.Menu()
+ item_select_none = gtk.MenuItem(_("Select _None"))
+ item_select_none.connect("activate", self.select_none_updgrades)
+ menu.add(item_select_none)
+ if self.list.num_updates == 0 or len(self.packages) == 0:
+ item_select_none.set_property("sensitive", False)
+ item_select_all = gtk.MenuItem(_("Select _All"))
+ item_select_all.connect("activate", self.select_all_updgrades)
+ menu.add(item_select_all)
+ if self.list.num_updates == len(self.packages) or\
+ self.list.num_updates == 0:
+ item_select_all.set_property("sensitive", False)
+ menu.popup(None, None, None, 0, event.time)
+ menu.show_all()
+ return True
+
+ def select_all_updgrades(self, widget):
+ """
+ Select all updates
+ """
+ iter = self.store.get_iter_first()
+ while iter != None:
+ pkg = self.store.get_value(iter, LIST_PKG)
+ if pkg != None:
+ self.store.set_value(iter, LIST_INSTALL, True)
+ self.add_update(pkg)
+ iter = self.store.iter_next(iter)
+
+ def select_none_updgrades(self, widget):
+ """
+ Select none updates
+ """
+ iter = self.store.get_iter_first()
+ while iter != None:
+ pkg = self.store.get_value(iter, LIST_PKG)
+ if pkg != None:
+ self.store.set_value(iter, LIST_INSTALL, False)
+ self.remove_update(pkg)
+ iter = self.store.iter_next(iter)
+
def remove_update(self, pkg):
name = pkg.name
if name in self.packages:
diff --git a/debian/changelog b/debian/changelog
index d2794afc..8b155497 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+update-manager (0.44.3) edgy; urgency=low
+
+ * added select all/unselect all (thanks to Sebastian Heinlein)
+
+ --
+
update-manager (0.44.2) edgy; urgency=low
* wording fixes