annotate pyink/comp_dock.py @ 1310:85d04ba11146

Support adding new components
author Thinker K.F. Li <thinker@codemud.net>
date Thu, 20 Jan 2011 12:44:37 +0800
parents f2b1b22f7cbc
children e6bb9d00341f
rev   line source
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
1 import gtk
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
2 import os
1304
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
3 import data_monitor
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
4
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
5
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
6 ## \brief User interface for management components and their timelines.
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
7 #
1304
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
8 class comp_dock(object):
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
9 __metaclass__ = data_monitor.data_monitor
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
10 __data_monitor_prefix__ = 'on_'
1304
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
11
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
12 def __init__(self, domview_ui, fname=None):
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
13 super(comp_dock, self).__init__()
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
14
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
15 if not fname:
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
16 dirname = os.path.dirname(__file__)
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
17 fname = os.path.join(dirname, 'component_dock.glade')
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
18 pass
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
19
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
20 builder = gtk.Builder()
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
21 builder.add_from_file(fname)
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
22 builder.connect_signals(self)
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
23 dock_top = builder.get_object('component_dock_top')
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
24 components_model = builder.get_object('components_model')
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
25 timelines_model = builder.get_object('timelines_model')
1309
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
26 components_treeview = builder.get_object('treeview_components')
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
27 timelines_treeview = builder.get_object('treeview_timelines')
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
28
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
29 dock_top_parent = dock_top.get_parent()
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
30 dock_top_parent.remove(dock_top)
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
31
1304
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
32 self._domview_ui = domview_ui
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
33 self._locker = domview_ui
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
34 self._builder = builder
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
35 self._dock_top = dock_top
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
36 self._desktop = None
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
37 self._dock_item = None
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
38
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
39 self._components_model = components_model
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
40 self._timelines_model = timelines_model
1309
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
41 self._components_treeview = components_treeview
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
42 self._timelines_treeview = timelines_treeview
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
43
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
44 self._cur_component = -1
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
45 self._cur_timeline = -1
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
46 pass
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
47
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
48 def install_dock(self, desktop):
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
49 self._desktop = desktop
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
50
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
51 dock = desktop.getDock()
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
52 item = dock.new_item('component_dock',
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
53 'Component and timeline manager',
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
54 'feBlend-icon', dock.ITEM_ST_DOCKED_STATE)
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
55 item_vbox = item.get_vbox()
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
56 self._dock_item = item
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
57
1304
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
58 item_vbox.pack_start(self._dock_top)
94e6594dea59 Make comp_dock being instantiated by domview_ui
Thinker K.F. Li <thinker@codemud.net>
parents: 1303
diff changeset
59 self._dock_top.show()
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
60 pass
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
61
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
62 ## \brief Refresh content of component list and timeline list.
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
63 #
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
64 def refresh(self):
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
65 components_model = self._components_model
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
66 components_model.clear()
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
67
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
68 for comp_name in self._domview_ui.all_comp_names():
1309
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
69 components_model.append((comp_name, True))
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
70 pass
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
71
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
72 timelines_model = self._timelines_model
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
73 timelines_model.clear()
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
74
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
75 for timeline_name in self._domview_ui.all_timeline_names():
1309
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
76 timelines_model.append((timeline_name, True))
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
77 pass
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
78 pass
1310
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
79
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
80 def _current_component(self):
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
81 treeview = self._components_treeview
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
82 path, col = treeview.get_cursor()
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
83
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
84 model = self._components_model
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
85 itr = model.get_iter(path)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
86 name = model.get_value(itr, 0)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
87 return name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
88
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
89 def _current_timeline(self):
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
90 treeview = self._timelines_treeview
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
91 path, col = treeview.get_cursor()
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
92
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
93 model = self._timelines_model
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
94 itr = model.get_iter(path)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
95 name = model.get_value(itr, 0)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
96 return name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
97
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
98 def _add_component(self):
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
99 def _make_component_name():
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
100 comp_name = 'New Component'
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
101 idx = 0
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
102 while comp_name in self._domview_ui.all_comp_names():
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
103 comp_name = 'New Component %d' % (idx)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
104 idx = idx + 1
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
105 pass
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
106 return comp_name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
107
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
108 comp_name = _make_component_name()
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
109 print comp_name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
110 self._domview_ui.add_component(comp_name)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
111 pass
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
112
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
113 def _rm_component(self):
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
114 if self._current_component() == 'main':
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
115 return
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
116
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
117 treeview = self._components_treeview
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
118 path, col = treeview.get_cursor()
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
119
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
120 model = self._components_model
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
121 itr = model.get_iter(path)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
122 comp_name = model.get_value(itr, 0)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
123 print comp_name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
124
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
125 self._domview_ui.rm_component(comp_name)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
126 pass
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
127
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
128 def _add_timeline(self):
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
129 def _make_timeline_name():
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
130 tl_name = 'New Timeline'
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
131 idx = 0
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
132 while tl_name in self._domview_ui.all_timeline_names():
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
133 tl_name = 'New Timeline %d' % (idx)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
134 idx = idx + 1
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
135 pass
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
136 return tl_name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
137
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
138 if self._current_component() == 'main':
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
139 return
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
140
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
141 tl_name = _make_timeline_name()
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
142 print tl_name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
143 self._domview_ui.add_timeline(tl_name)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
144 pass
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
145
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
146 def _rm_timeline(self):
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
147 if self._current_component() == 'main':
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
148 return
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
149
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
150 treeview = self._timelines_treeview
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
151 path, col = treeview.get_cursor()
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
152
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
153 model = self._timelines_model
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
154 itr = model.get_iter(path)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
155 tl_name = model.get_value(itr, col)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
156 print tl_name
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
157
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
158 self._domview_ui.rm_timeline(tl_name)
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
159 pass
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
160
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
161 def on_add_comp_clicked(self, *args):
1310
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
162 self._add_component()
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
163 pass
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
164
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
165 def on_remove_comp_clicked(self, *args):
1310
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
166 self._rm_component()
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
167 pass
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
168
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
169 def on_treeview_components_cursor_changed(self, *args):
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
170 print args
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
171 pass
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
172
1309
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
173 def on_cellrenderer_comp_edited(self, renderer, path,
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
174 new_text, *args):
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
175 print '%s - %s' % (path, new_text)
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
176 pass
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
177
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
178 def on_add_timeline_clicked(self, *args):
1310
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
179 self._add_timeline()
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
180 pass
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
181
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
182 def on_remove_timeline_clicked(self, *args):
1310
85d04ba11146 Support adding new components
Thinker K.F. Li <thinker@codemud.net>
parents: 1309
diff changeset
183 self._rm_timeline()
1308
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
184 pass
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
185
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
186 def on_treeview_timelines_cursor_changed(self, *args):
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
187 print args
49775feefbcf Show components and timelines in comp_dock
Thinker K.F. Li <thinker@codemud.net>
parents: 1305
diff changeset
188 pass
1309
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
189
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
190 def on_cellrenderer_timelines_edited(self, renderer, path,
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
191 new_text, *args):
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
192 print '%s - %s' % (path, new_text)
f2b1b22f7cbc Make comp_dock editable
Thinker K.F. Li <thinker@codemud.net>
parents: 1308
diff changeset
193 pass
1303
cf2691a18a7a Add component dock
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
194 pass