summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--TODO3
-rw-r--r--ranger/container/bookmarks.py3
-rw-r--r--ranger/gui/widgets/browserview.py25
3 files changed, 30 insertions, 1 deletions
diff --git a/TODO b/TODO
index ccef8c6e..2b996543 100644
--- a/TODO
+++ b/TODO
@@ -19,9 +19,10 @@ General
    (X) #12  09/12/27  jump through the list in a specific order
    (X) #14  09/12/29  make filelists inherit from pagers
    (X) #15  09/12/29  better way of running processes!!~
-   ( ) #16  10/01/01  list of bookmarks
+   (X) #16  10/01/01  list of bookmarks
 
 
 Bugs
 
    ( ) #17  10/01/01  why do bookmarks disappear sometimes?
+   ( ) #18  10/01/01  fix notify widget (by adding a LogView?)
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index b16180a0..2d58c1d8 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -65,6 +65,9 @@ class Bookmarks(object):
 		self["`"] = value
 		self["'"] = value
 		if self.autosave: self.save()
+	
+	def __iter__(self):
+		return iter(self.dct.items())
 
 	def __getitem__(self, key):
 		"""Get the bookmark associated with the key"""
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index ffca34c6..488b7cfd 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -9,6 +9,7 @@ class BrowserView(Widget, DisplayableContainer):
 	preview = True
 	preview_available = True
 	stretch_ratios = None
+	need_clear = False
 
 	def __init__(self, win, ratios, preview = True):
 		DisplayableContainer.__init__(self, win)
@@ -42,6 +43,30 @@ class BrowserView(Widget, DisplayableContainer):
 
 		self.pager = Pager(self.win, embedded=True)
 		self.add_child(self.pager)
+
+	def draw(self):
+		if str(self.env.keybuffer) in ("`", "'"):
+			self._draw_bookmarks()
+		else:
+			if self.need_clear:
+				self.win.erase()
+				self.need_redraw = True
+				self.need_clear = False
+			DisplayableContainer.draw(self)
+	
+	def _draw_bookmarks(self):
+		self.need_clear = True
+
+		def generator():
+			return zip(range(self.hei), self.fm.bookmarks)
+
+		maxlen = max(len(item[1].path) for i, item in generator())
+		maxlen = min(maxlen + 5, self.wid)
+
+		for line, items in generator():
+			key, mark = items
+			string = " " + key + ": " + mark.path
+			self.addstr(line, 0, string.ljust(maxlen))
 	
 	def resize(self, y, x, hei, wid):
 		"""Resize all the columns according to the given ratio"""
'author hut <hut@lavabit.com> 2010-01-05 03:00:46 +0100 committer hut <hut@lavabit.com> 2010-01-05 03:00:46 +0100 help: implemented help framework, started writing' href='/akspecs/ranger/commit/TODO?h=v1.9.0b5&id=4b826595915c221f12a4ebe187e990cc7a08f7f2'>4b826595 ^
757e1f55 ^
277ecc9e ^
9983328c ^
33cb688a ^
a1274aba ^
b42eb058 ^
b13518af ^
316ff5a9 ^
fc486c60 ^
b4934e42 ^
2c1d2db0 ^
291ca616 ^
50845f37 ^
039c03ef ^
af6658b3 ^
efe2d7a3 ^
f0df3fa5 ^
a986e2bd ^

3fe38754 ^

6a8d5d23 ^
aad61455 ^
7a268c8b ^

efdc7b16 ^
636f69d3 ^
d3c262a9 ^
e02d47ed ^

4be8b401 ^



d955e3f0 ^
75013dc7 ^
67bb838c ^
a808a661 ^
bba8d293 ^
2a64495f ^
5e449699 ^
8895b130 ^

7b04e507 ^
87db0130 ^
dd4a4145 ^
8f2f1767 ^
db1721dd ^
aea5cf92 ^
b624bd94 ^
69d1220f ^
6099d9a3 ^
9207e83c ^
f7db061b ^
6099d9a3 ^
5a8b6059 ^
6f43de0a ^




fca1fc4f ^
f70ee6b2 ^
0db4c9b2 ^
b2d63ef5 ^
6908d0cc ^
d994d0d6 ^
01c89bb5 ^
c776804d ^
dab4db44 ^
cc4210ff ^
34c131ef ^
66c5bb93 ^
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