diff options
author | Frederic Back <fredericback@gmail.com> | 2006-10-04 11:18:03 +0000 |
---|---|---|
committer | Frederic Back <fredericback@gmail.com> | 2006-10-04 11:18:03 +0000 |
commit | 5df72aab9a1064a1b008c58d5adaf11abe85fcbb (patch) | |
tree | d6b1760e3286410c8b531937e5eb37309ab6b4e0 /src/fringlib/fringwalker.py | |
parent | e92d2f96954066db80eba10f4dfc877756321d00 (diff) |
* Changed parent button size to SMALL_TOOLBAR
* Added progress bar
* The progress signal now also emits the path getting parsed
* Path in status bar is now relative to current path (shorter)
git-svn-id: file:///home/lennart/svn/public/fring/trunk@65 d0d2c35f-0a1e-0410-abeb-dabff30a67ee
Diffstat (limited to 'src/fringlib/fringwalker.py')
-rw-r--r-- | src/fringlib/fringwalker.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/fringlib/fringwalker.py b/src/fringlib/fringwalker.py index 1bf5c68..d328627 100644 --- a/src/fringlib/fringwalker.py +++ b/src/fringlib/fringwalker.py @@ -15,7 +15,8 @@ class FringWalker( gobject.GObject ): 'list-changed': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,)), 'finished': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,)), 'manually-stopped': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, () ), - 'progress': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT,gobject.TYPE_INT)), + 'progress': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, + (gobject.TYPE_INT,gobject.TYPE_INT,gobject.TYPE_STRING)), } def __init__(self, sumlistcollection): @@ -35,11 +36,11 @@ class FringWalker( gobject.GObject ): self.thread.stopsignal = True self.thread = None - def _progress_fn(self, walkthread, c, l, r): + def _progress_fn(self, walkthread, c, l, r, currentlyScanning): # only emit if called from the current request if walkthread == self.thread: gtk.gdk.threads_enter() - self.emit("progress", c, l) + self.emit("progress", c, l, currentlyScanning) self.emit("list-changed", r) gtk.gdk.threads_leave() @@ -94,6 +95,7 @@ class WalkThread( threading.Thread ): """ Parse the root directory """ self.result = SumList(self.__uri_tail(self.uri), None, 0) + self.master._progress_fn(self, 0, 1, self.result, self.uri) # write some debug information starttime = time.time() @@ -116,20 +118,20 @@ class WalkThread( threading.Thread ): # emit an intermediate version to fill up the screen while waiting self.result.sort() self.master.collection.set_sumlist(unicode(self.uri),self.result) - self.master._progress_fn(self, 0, len(subdirectories), self.result) # walk the subdirectories c = 0 for directory in subdirectories: c += 1 - self.result.append_child( self.build_tree_gnomevfs(self.uri.append_path(directory)) ) + sub = self.build_tree_gnomevfs(self.uri.append_path(directory)) + self.result.append_child( sub ) if self.stopsignal: return self.result.sort() self.master.collection.set_sumlist(unicode(self.uri),self.result) - self.master._progress_fn(self, c, len(subdirectories), self.result) + self.master._progress_fn(self, c, len(subdirectories), self.result, sub.name) # emit final signal self.master._finished_fn(self,self.result) |