summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKlinke600 <steffen.fuerst@gmx.de>2014-10-01 00:28:42 +0200
committerKlinkenstecker <klinkenstecker@gmx.de>2014-10-01 01:50:58 +0200
commite2bf284de6e446d0cb9b353dd222d996ab238663 (patch)
treef46fe4369e7bf6b96c10fb9bb15fee3b3bd32840
parent93654aa049863d2ef5534dbde09bd17cafd55584 (diff)
downloadranger-e2bf284de6e446d0cb9b353dd222d996ab238663.tar.gz
New show_selection_in_titlebar setting
-rw-r--r--ranger/config/rc.conf3
-rw-r--r--ranger/container/settings.py1
-rw-r--r--ranger/gui/widgets/titlebar.py3
3 files changed, 6 insertions, 1 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 9e886e19..644706e8 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -166,6 +166,9 @@ set cd_bookmarks true
 # disable this feature.
 set preview_max_size 0
 
+# Add the highlighted file to the path in the titlebar
+set show_selection_in_titlebar true
+
 # ===================================================================
 # == Local Options
 # ===================================================================
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index 90b6f7ce..0d8b6906 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -39,6 +39,7 @@ ALLOWED_SETTINGS = {
     'scroll_offset': int,
     'shorten_title': int,
     'show_cursor': bool,  # TODO: not working?
+    'show_selection_in_titlebar': bool,
     'show_hidden_bookmarks': bool,
     'show_hidden': bool,
     'sort_case_insensitive': bool,
diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py
index 38a99a92..fa10a744 100644
--- a/ranger/gui/widgets/titlebar.py
+++ b/ranger/gui/widgets/titlebar.py
@@ -115,7 +115,8 @@ class TitleBar(Widget):
             bar.add(path.basename, clr, directory=path)
             bar.add('/', clr, fixed=True, directory=path)
 
-        if self.fm.thisfile is not None:
+        if self.fm.thisfile is not None and \
+                self.settings.show_selection_in_titlebar:
             bar.add(self.fm.thisfile.basename, 'file')
 
     def _get_right_part(self, bar):
lt'>
ce87c19e ^
b96af395 ^
f192d655 ^
ee72abae ^
b96af395 ^
f192d655 ^
760f683f ^
b96af395 ^
77d5b5d6 ^
4a48bedc ^
b96af395 ^

9458918f ^
5b22547b ^
b96af395 ^
08f4628e ^
b96af395 ^

f192d655 ^
b96af395 ^
f192d655 ^
1ead3562 ^
77d5b5d6 ^
760f683f ^
b96af395 ^
192d59d3 ^

ce87c19e ^

b96af395 ^
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

                                                                
                                                   
                                          
             
             
         
                  
   
                                  
                      
                                                  
                             
 
                         
                 
        
   
            
 
 
                                                           
                                             
             
             

                                      
                                            
                 
                                                  
                                  

        
   
 
 
          
             
                                                                  
                                                                  

                                                

                           
 
# example program: communicating between routines using channels

def producer sink:&:sink:char -> sink:&:sink:char [
  # produce characters 1 to 5 on a channel
  local-scope
  load-inputs
  # n = 0
  n:char <- copy 0
  {
    done?:bool <- lesser-than n, 5
    break-unless done?
    # other threads might get between these prints
    $print [produce: ], n, [ 
]
    sink <- write sink, n
    n <- add n, 1
    loop
  }
  close sink
]

def consumer source:&:source:char -> source:&:source:char [
  # consume and print integers from a channel
  local-scope
  load-inputs
  {
    # read an integer from the channel
    n:char, eof?:bool, source <- read source
    break-if eof?
    # other threads might get between these prints
    $print [consume: ], n:char, [ 
]
    loop
  }
]

def main [
  local-scope
  source:&:source:char, sink:&:sink:char <- new-channel 3/capacity
  # create two background 'routines' that communicate by a channel
  routine1:num <- start-running producer, sink
  routine2:num <- start-running consumer, source
  wait-for-routine routine1
  wait-for-routine routine2
]