Changeset 383:ab6b9dc0e28d

Show
Ignore:
Timestamp:
04/23/07 11:01:00 (21 months ago)
Author:
aafshar
Message:

terminal for directory context menu

Location:
pida/services
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pida/services/commander/commander.py

    r345 r383  
    111111        ) 
    112112 
     113        self.create_action( 
     114            'terminal-for-dir', 
     115            TYPE_NORMAL, 
     116            'Shell in directory', 
     117            'Open a shell prompt in the directory', 
     118            'terminal', 
     119            self.on_terminal_for_dir, 
     120            '', 
     121        ) 
     122 
    113123    def execute_shell(self, action): 
    114124        self.svc.cmd('execute_shell') 
     
    118128        self.svc.cmd('execute_shell', cwd=cwd) 
    119129 
     130    def on_terminal_for_dir(self, action): 
     131        cwd = action.contexts_kw['dir_name'] 
     132        self.svc.cmd('execute_shell', cwd=cwd) 
     133         
     134 
    120135 
    121136class CommanderCommandsConfig(CommandsConfig): 
     
    133148        self.subscribe_foreign_feature('contexts', 'file-menu', 
    134149            (self.svc.get_action_group(), 'commander-file-menu.xml')) 
     150        self.subscribe_foreign_feature('contexts', 'dir-menu', 
     151            (self.svc.get_action_group(), 'commander-dir-menu.xml')) 
    135152 
    136153class TerminalView(PidaView): 
  • pida/services/commander/uidef/commander-dir-menu.xml

    r382 r383  
    44<separator/> 
    55<placeholder name="2"> 
    6 <menuitem action="terminal-for-file" name="terminal-for-file"/> 
     6<menuitem action="terminal-for-dir" name="terminal-for-dir"/> 
    77</placeholder> 
    88<separator/> 
  • pida/services/filemanager/uidef/filemanager-dir-menu.xml

    r382 r383  
    11<ui> 
    22<popup> 
    3 <placeholder name="1"/> 
    4 <separator/> 
    5 <placeholder name="2"> 
     3<placeholder name="1"> 
    64<menuitem action="browse-for-dir" name="browse-for-dir"/> 
    75</placeholder> 
     6<separator/> 
     7<placeholder name="2"/> 
    88<separator/> 
    99<placeholder name="3"/>