comparison pyink/comp_dock.py @ 1309:f2b1b22f7cbc

Make comp_dock editable
author Thinker K.F. Li <thinker@codemud.net>
date Thu, 20 Jan 2011 10:54:27 +0800
parents 49775feefbcf
children 85d04ba11146
comparison
equal deleted inserted replaced
1308:49775feefbcf 1309:f2b1b22f7cbc
21 builder.add_from_file(fname) 21 builder.add_from_file(fname)
22 builder.connect_signals(self) 22 builder.connect_signals(self)
23 dock_top = builder.get_object('component_dock_top') 23 dock_top = builder.get_object('component_dock_top')
24 components_model = builder.get_object('components_model') 24 components_model = builder.get_object('components_model')
25 timelines_model = builder.get_object('timelines_model') 25 timelines_model = builder.get_object('timelines_model')
26 components_treeview = builder.get_object('treeview_components')
27 timelines_treeview = builder.get_object('treeview_timelines')
26 28
27 dock_top_parent = dock_top.get_parent() 29 dock_top_parent = dock_top.get_parent()
28 dock_top_parent.remove(dock_top) 30 dock_top_parent.remove(dock_top)
29 31
30 self._domview_ui = domview_ui 32 self._domview_ui = domview_ui
34 self._desktop = None 36 self._desktop = None
35 self._dock_item = None 37 self._dock_item = None
36 38
37 self._components_model = components_model 39 self._components_model = components_model
38 self._timelines_model = timelines_model 40 self._timelines_model = timelines_model
41 self._components_treeview = components_treeview
42 self._timelines_treeview = timelines_treeview
43
44 self._cur_component = -1
45 self._cur_timeline = -1
39 pass 46 pass
40 47
41 def install_dock(self, desktop): 48 def install_dock(self, desktop):
42 self._desktop = desktop 49 self._desktop = desktop
43 50
57 def refresh(self): 64 def refresh(self):
58 components_model = self._components_model 65 components_model = self._components_model
59 components_model.clear() 66 components_model.clear()
60 67
61 for comp_name in self._domview_ui.all_comp_names(): 68 for comp_name in self._domview_ui.all_comp_names():
62 components_model.append((comp_name,)) 69 components_model.append((comp_name, True))
63 pass 70 pass
64 71
65 timelines_model = self._timelines_model 72 timelines_model = self._timelines_model
66 timelines_model.clear() 73 timelines_model.clear()
67 74
68 for timeline_name in self._domview_ui.all_timeline_names(): 75 for timeline_name in self._domview_ui.all_timeline_names():
69 timelines_model.append((timeline_name,)) 76 timelines_model.append((timeline_name, True))
70 pass 77 pass
71 pass 78 pass
72 79
73 def on_add_comp_clicked(self, *args): 80 def on_add_comp_clicked(self, *args):
74 print args 81 print args
80 87
81 def on_treeview_components_cursor_changed(self, *args): 88 def on_treeview_components_cursor_changed(self, *args):
82 print args 89 print args
83 pass 90 pass
84 91
92 def on_cellrenderer_comp_edited(self, renderer, path,
93 new_text, *args):
94 print '%s - %s' % (path, new_text)
95 pass
96
85 def on_add_timeline_clicked(self, *args): 97 def on_add_timeline_clicked(self, *args):
86 print args 98 print args
87 pass 99 pass
88 100
89 def on_remove_timeline_clicked(self, *args): 101 def on_remove_timeline_clicked(self, *args):
91 pass 103 pass
92 104
93 def on_treeview_timelines_cursor_changed(self, *args): 105 def on_treeview_timelines_cursor_changed(self, *args):
94 print args 106 print args
95 pass 107 pass
108
109 def on_cellrenderer_timelines_edited(self, renderer, path,
110 new_text, *args):
111 print '%s - %s' % (path, new_text)
112 pass
96 pass 113 pass