From 71c81ff14f1be1f02f70216aa9a3a0b0e663bb52 Mon Sep 17 00:00:00 2001 From: Emanuel Guevel Date: Sat, 2 Feb 2013 00:31:00 +0100 Subject: Add 'preview_images' setting --- ranger/container/settingobject.py | 1 + ranger/core/actions.py | 4 ++-- ranger/gui/widgets/browsercolumn.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ranger/container/settingobject.py b/ranger/container/settingobject.py index 431d26e3..7d715f38 100644 --- a/ranger/container/settingobject.py +++ b/ranger/container/settingobject.py @@ -26,6 +26,7 @@ ALLOWED_SETTINGS = { 'mouse_enabled': bool, 'padding_right': bool, 'preview_directories': bool, + 'preview_images': bool, 'preview_files': bool, 'preview_script': (str, type(None)), 'save_console_history': bool, diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 2300aa96..80db1aa5 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -777,7 +777,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): return pager = self.ui.open_embedded_pager() - if self.thisfile.is_image(): + if self.settings.preview_images and self.thisfile.is_image(): pager.set_image(self.thisfile.realpath) else: pager.set_source(self.thisfile.get_preview_source(pager.wid, pager.hei)) @@ -796,7 +796,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): pager = self.ui.browser.pager path = file.realpath - if file.is_image(): + if self.settings.preview_images and file.is_image(): pager.set_image(path) return None diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 94c71929..02c2a5f0 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -168,7 +168,7 @@ class BrowserColumn(Pager): Pager.close(self) return - if self.target.is_image(): + if self.fm.settings.preview_images and self.target.is_image(): self.set_image(self.target.realpath) Pager.draw(self) else: -- cgit 1.4.1-2-gfad0