From 4ad63314b68bd9beac43ad33ba161583ae8f4644 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 16 Mar 2008 13:19:50 +0000 Subject: [PATCH] Watch directories for changes. --- rox/shell/directory.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rox/shell/directory.py b/rox/shell/directory.py index 617bd71..cb0bfd6 100644 --- a/rox/shell/directory.py +++ b/rox/shell/directory.py @@ -29,6 +29,13 @@ class DirModel: self.file = file self.model = gtk.ListStore(str, gtk.gdk.Pixbuf, object) self.model.set_sort_column_id(DirModel.NAME, gtk.SORT_ASCENDING) + + self.monitor = self.file.monitor_directory(0) + self.monitor.connect('changed', self.contents_changed) + + self.build_contents() + + def contents_changed(self, monitor, dir_file, other_file, event_type): self.build_contents() def build_contents(self): -- 2.11.4.GIT