about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorEmanuel Guevel <guevel.emanuel@gmail.com>2013-02-02 00:31:00 +0100
committerEmanuel Guevel <guevel.emanuel@gmail.com>2013-02-02 01:02:47 +0100
commit71c81ff14f1be1f02f70216aa9a3a0b0e663bb52 (patch)
tree181e8f08729db26ff471e45b310293c28fade12a
parent3e9db3e70fc0093a486cfca0db7306054d45d8f1 (diff)
downloadranger-71c81ff14f1be1f02f70216aa9a3a0b0e663bb52.tar.gz
Add 'preview_images' setting
-rw-r--r--ranger/container/settingobject.py1
-rw-r--r--ranger/core/actions.py4
-rw-r--r--ranger/gui/widgets/browsercolumn.py2
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150