summaryrefslogtreecommitdiff
path: root/portato/gui/views.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-12-05 12:54:37 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-12-05 12:54:37 +0100
commit2c79a7fc6ea5995ecdc7e3f8c83fe410586d9f6e (patch)
tree36c16fbd2eb0b93d235e6ca71e4bc1146f098d96 /portato/gui/views.py
parent7c2d796eda8a63fb81d36410d45f0b0d4678d86f (diff)
downloadportato-2c79a7fc6ea5995ecdc7e3f8c83fe410586d9f6e.tar.gz
portato-2c79a7fc6ea5995ecdc7e3f8c83fe410586d9f6e.tar.bz2
portato-2c79a7fc6ea5995ecdc7e3f8c83fe410586d9f6e.zip
Make the dependency list lazy
Diffstat (limited to 'portato/gui/views.py')
-rw-r--r--portato/gui/views.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/portato/gui/views.py b/portato/gui/views.py
index 85a06c8..26a8a89 100644
--- a/portato/gui/views.py
+++ b/portato/gui/views.py
@@ -46,6 +46,20 @@ class LazyView (object):
def _get_content (self):
raise NotImplementedError
+class LazyStoreView (gtk.TreeView, LazyView):
+ def __init__ (self, update_fn):
+ gtk.TreeView.__init__(self)
+ LazyView.__init__(self)
+
+ self.update_fn = update_fn
+
+ def cb_mapped (self, *args):
+ if self.updated and self.pkg:
+ self.set_model(self.update_fn(self.pkg))
+ self.updated = False
+
+ return False
+
class ListView (gtk.TextView, LazyView):
def __init__ (self, content_fn):