summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.gui.widgets.pager.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/pydoc/ranger.gui.widgets.pager.html')
0 files changed, 0 insertions, 0 deletions
7:35:56 +0100 committer hut <hut@lavabit.com> 2010-01-08 17:35:56 +0100 added license information' href='/akspecs/ranger/commit/ranger/gui/defaultui.py?id=b4c2c703f9acdf39cbd47407ed51a7e7c807ba7d'>b4c2c703 ^
0cfc59d6 ^
eaaeed3d ^





9506fb8e ^
1159f9ec ^
9506fb8e ^
49ae0dd1 ^
a6791aee ^
d88232a3 ^
a6791aee ^
9506fb8e ^
8db3c4b1 ^
bf391538 ^
3c041abb ^

8db3c4b1 ^
e6dfc442 ^
a6791aee ^
b5393406 ^


ddf828fb ^
a6791aee ^
8db3c4b1 ^
a6791aee ^


c1033553 ^
a6791aee ^
c1033553 ^

a6791aee ^
06aefcf5 ^
42fd3690 ^
a6791aee ^
06aefcf5 ^
d88232a3 ^

1159f9ec ^
49ae0dd1 ^
9506fb8e ^
6f43de0a ^


d88232a3 ^
cfdbb9d6 ^

ea87d005 ^
6f43de0a ^

e6dfc442 ^
06aefcf5 ^
5715beca ^

491a5312 ^
06aefcf5 ^

8db3c4b1 ^
ea87d005 ^
06aefcf5 ^
5715beca ^

491a5312 ^
06aefcf5 ^

8db3c4b1 ^
5715beca ^
06aefcf5 ^

8db3c4b1 ^

06aefcf5 ^

8db3c4b1 ^
ea87d005 ^
c525589d ^

e7733577 ^
e6dfc442 ^

cfdbb9d6 ^
e6dfc442 ^


cfdbb9d6 ^
5715beca ^
e6dfc442 ^
b5393406 ^
4e9450f9 ^



8db3c4b1 ^
b5393406 ^

ea87d005 ^
e07cfa31 ^

ddf828fb ^
b5393406 ^

8db3c4b1 ^
b5393406 ^
ddf828fb ^
e6dfc442 ^
8db3c4b1 ^

ea87d005 ^
9a78b644 ^




a396b3a0 ^

6f43de0a ^
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
                                                                 
 



                                                                      
 






                                                                       
 
                            





                                                      
 
                    
                        
                                                              
                                    
                                                  
                                             
 
                                         
                                                                                 

                                                                 
                                            
 
                                            


                                                  
 
                                       
                                                                           


                                           
                                                
                                            

                                            
                                  
                                            
                                          
                                          
 

                                        
                                    
                                        
 


                                                    
                                                

                                                   
 

                                                  
 
                              

                                                   
                                  

                                          
                                           
 
                             

                                                    
                                 

                                         
                                            
                                 

                                      

                                         

                                       
                                          
 

                                                                               
                                              

                                                                  
                                                   


                                            
                                          
                                  
 
                                



                                            
                                            

                                            
 

                                                           
 

                                             
                                           
                                             
 
                                   

                                                                 
 




                                                                             

                                  
                                       
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from ranger.gui.ui import UI
from ranger.gui.widgets.browserview import BrowserView
from ranger.gui.widgets.titlebar import TitleBar
from ranger.gui.widgets.console import Console
from ranger.gui.widgets.statusbar import StatusBar
from ranger.gui.widgets.taskview import TaskView
from ranger.gui.widgets.pager import Pager

class DefaultUI(UI):
	def setup(self):
		"""Build up the UI by initializing widgets."""
		# Create a title bar
		self.titlebar = TitleBar(self.win)
		self.add_child(self.titlebar)

		# Create the browser view
		self.browser = BrowserView(self.win, self.settings.column_ratios)
		self.settings.signal_bind('setopt.column_ratios',
				self.browser.change_ratios)
		self.add_child(self.browser)

		# Create the process manager
		self.taskview = TaskView(self.win)
		self.taskview.visible = False
		self.add_child(self.taskview)

		# Create the status bar
		self.status = StatusBar(self.win, self.browser.main_column)
		self.add_child(self.status)

		# Create the console
		self.console = Console(self.win)
		self.add_child(self.console)
		self.console.visible = False

		# Create the pager
		self.pager = Pager(self.win)
		self.pager.visible = False
		self.add_child(self.pager)

	def update_size(self):
		"""resize all widgets"""
		UI.update_size(self)
		y, x = self.env.termsize

		self.browser.resize(1, 0, y - 2, x)
		self.taskview.resize(1, 0, y - 2, x)
		self.pager.resize(1, 0, y - 2, x)
		self.titlebar.resize(0, 0, 1, x)
		self.status.resize(y - 1, 0, 1, x)
		self.console.resize(y - 1, 0, 1, x)

	def notify(self, *a, **k):
		return self.status.notify(*a, **k)

	def close_pager(self):
		if self.console.visible:
			self.console.focused = True
		self.pager.close()
		self.pager.visible = False
		self.pager.focused = False
		self.browser.visible = True

	def open_pager(self):
		if self.console.focused:
			self.console.focused = False
		self.pager.open()
		self.pager.visible = True
		self.pager.focused = True
		self.browser.visible = False
		return self.pager

	def open_embedded_pager(self):
		self.browser.open_pager()
		return self.browser.pager

	def close_embedded_pager(self):
		self.browser.close_pager()

	def open_console(self, string='', prompt=None, position=None):
		if self.console.open(string, prompt=prompt, position=position):
			self.status.msg = None
			self.console.on_close = self.close_console
			self.console.visible = True
			self.status.visible = False

	def close_console(self):
		self.console.visible = False
		self.status.visible = True
		self.close_pager()

	def open_taskview(self):
		self.pager.close()
		self.pager.visible = False
		self.pager.focused = False
		self.console.visible = False
		self.browser.visible = False
		self.taskview.visible = True
		self.taskview.focused = True

	def redraw_main_column(self):
		self.browser.main_column.need_redraw = True

	def close_taskview(self):
		self.taskview.visible = False
		self.browser.visible = True
		self.taskview.focused = False

	def scroll(self, relative):
		if self.browser and self.browser.main_column:
			self.browser.main_column.scroll(relative)

	def throbber(self, string='.', remove=False):
		if remove:
			self.titlebar.throbber = type(self.titlebar).throbber
		else:
			self.titlebar.throbber = string

	def hint(self, text=None):
		self.status.hint = text