Changeset 299:515efdd7028c
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r293
|
r299
|
|
| 221 | 221 | self.create_feature("file-manager") |
| 222 | 222 | |
| | 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 | |
| 223 | 227 | |
| 224 | 228 | class FileManagerOptionsConfig(OptionsConfig): |
| … |
… |
|
| 252 | 256 | 'Hides files that match the regex') |
| 253 | 257 | |
| | 258 | class 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) |
| 254 | 273 | |
| 255 | 274 | |
| … |
… |
|
| 262 | 281 | events_config = FilemanagerEvents |
| 263 | 282 | commands_config = FilemanagerCommandsConfig |
| | 283 | actions_config = FileManagerActionsConfig |
| 264 | 284 | |
| 265 | 285 | def pre_start(self): |