summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/loader.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index aebd6efe..8309cd33 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -271,6 +271,9 @@ def safeDecode(string):
 
 
 class Loader(FileManagerAware):
+    """
+    The Manager of 'Loadable' objects, referenced as fm.loader
+    """
     seconds_of_work_time = 0.03
     throbber_chars = r'/-\|'
     throbber_paused = '#'
@@ -305,6 +308,7 @@ class Loader(FileManagerAware):
             self.queue.append(obj)
         else:
             self.queue.appendleft(obj)
+        self.fm.signal_emit("loader.before", loadable=obj, fm=self.fm)
         if self.paused:
             obj.pause()
         else:
@@ -341,6 +345,7 @@ class Loader(FileManagerAware):
                 item = self.queue[index]
             if hasattr(item, 'unload'):
                 item.unload()
+            self.fm.signal_emit("loader.destroy", loadable=item, fm=self.fm)
             item.destroy()
             del self.queue[index]
             if item.progressbar_supported:
@@ -408,6 +413,7 @@ class Loader(FileManagerAware):
     def _remove_current_process(self, item):
         item.load_generator = None
         self.queue.remove(item)
+        self.fm.signal_emit("loader.after", loadable=item, fm=self.fm)
         if item.progressbar_supported:
             self.fm.ui.status.request_redraw()