Changeset 299:515efdd7028c

Show
Ignore:
Timestamp:
04/19/07 00:51:05 (21 months ago)
Author:
aafshar
Message:

added file manager action to file context

Location:
pida/services/filemanager
Files:
1 added
1 modified

Legend:

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

    r293 r299  
    221221        self.create_feature("file-manager") 
    222222 
     223    def subscribe_foreign_features(self): 
     224        self.subscribe_foreign_feature('contexts', 'file-menu', 
     225            (self.svc.get_action_group(), 'filemanager-file-menu.xml')) 
     226 
    223227 
    224228class FileManagerOptionsConfig(OptionsConfig): 
     
    252256                'Hides files that match the regex') 
    253257 
     258class FileManagerActionsConfig(ActionsConfig): 
     259 
     260    def create_actions(self): 
     261        self.create_action( 
     262            'browse-for-file', 
     263            TYPE_NORMAL, 
     264            'Browse the file directory', 
     265            'Browse the parent directory of this file', 
     266            'file-manager', 
     267            self.on_browse_for_file, 
     268        ) 
     269 
     270    def on_browse_for_file(self, action): 
     271        new_path = path.dirname(action.contexts_kw['file_name']) 
     272        self.svc.cmd('browse', new_path=new_path) 
    254273 
    255274 
     
    262281    events_config = FilemanagerEvents 
    263282    commands_config = FilemanagerCommandsConfig 
     283    actions_config = FileManagerActionsConfig 
    264284 
    265285    def pre_start(self):