1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 from elisa.core import common
19 from elisa.core import player
20 from elisa.core.input_event import *
21
22 plugin_registry = common.application.plugin_registry
23 ListController = plugin_registry.get_component_class('raval:list_controller')
24
25 -class ContextController(ListController):
26 """
27 DOCME
28 """
29
30 supported_models = ('raval:context_model',)
31
32 - def focused_changed(self, old_focused, new_focused):
33 if new_focused:
34 self.current_index = 0
35 else:
36 self.current_index = -1
37
38 - def previous_item(self, step=1):
39 if self.current_index == 0:
40 self.parent.focus()
41 else:
42 super(ContextController, self).previous_item(step=step)
43
61
62 - def fire_activate_action(self, index, origin):
63 if index > -1 and len(self.model) > 0:
64 model = self.model[index]
65 action = model.activate_action
66 if callable(action):
67 action(self, origin)
68