summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-20 02:26:11 +0100
committerhut <hut@lavabit.com>2009-12-20 02:26:11 +0100
commit365ba9c5caa929d4e3a5afee008a2d4a6d85e386 (patch)
tree3b915a97436179c0d6491dda307191284443eaf7 /ranger
parent7d9ae552154dc4f0214a80cbd1e0fd17efba1e6c (diff)
downloadranger-365ba9c5caa929d4e3a5afee008a2d4a6d85e386.tar.gz
Added option for autoloading previews.
If it is false, you have to enter the directory once to see a preview
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/options.py2
-rw-r--r--ranger/gui/widgets/filelist.py16
-rw-r--r--ranger/shared/settings.py2
3 files changed, 13 insertions, 7 deletions
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index 3bd4ad02..d466b5dc 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -10,4 +10,4 @@ scroll_offset = 2
 directories_first = True
 preview_files = False
 max_history_size = 20
-
+auto_load_preview = True
diff --git a/ranger/gui/widgets/filelist.py b/ranger/gui/widgets/filelist.py
index f5b69e26..1e5c748d 100644
--- a/ranger/gui/widgets/filelist.py
+++ b/ranger/gui/widgets/filelist.py
@@ -111,11 +111,17 @@ class FileList(Widget):
 		self.target.use()
 
 		if not self.target.content_loaded:
-			self.color(base_color)
-			self.win.addnstr(self.y, self.x, "...", self.wid)
-			self.color_reset()
-			self.postpone_drawing = True
-			return
+			if self.settings.auto_load_preview:
+				self.color(base_color)
+				self.win.addnstr(self.y, self.x, "...", self.wid)
+				self.color_reset()
+				self.postpone_drawing = True
+				return
+			else:
+				self.color(base_color, 'error')
+				self.win.addnstr(self.y, self.x, "not loaded", self.wid)
+				self.color_reset()
+				return
 
 		self.target.load_content_if_outdated()
 		self.target.sort_if_outdated()
diff --git a/ranger/shared/settings.py b/ranger/shared/settings.py
index 46dc77e8..5541b191 100644
--- a/ranger/shared/settings.py
+++ b/ranger/shared/settings.py
@@ -1,7 +1,7 @@
 ALLOWED_SETTINGS = """
 show_hidden scroll_offset directories_first
 preview_files max_history_size colorscheme
-collapse_preview
+collapse_preview auto_load_preview
 apps keys
 """.split()