Mercurial > MadButterfly
comparison pyink/MBScene.py @ 1263:1a54486c2987
Add undo points
author | wycc |
---|---|
date | Wed, 12 Jan 2011 08:31:32 +0800 |
parents | 2609b219703d |
children | ff410dcdea02 |
comparison
equal
deleted
inserted
replaced
1262:2f861eea1214 | 1263:1a54486c2987 |
---|---|
223 self._director.show_scene(frame_idx) | 223 self._director.show_scene(frame_idx) |
224 self.selectSceneObject(layer_idx, frame_idx) | 224 self.selectSceneObject(layer_idx, frame_idx) |
225 | 225 |
226 self._lockui = False | 226 self._lockui = False |
227 pass | 227 pass |
228 | |
229 def markUndo(self, msg): | |
230 #self._domview.mark_undo(msg) | |
231 # FIXME: move into domview latter when the inkscpae-pybind is modified | |
232 # to support the sp_document_done. | |
233 self.desktop.doc().done("None",msg) | |
228 | 234 |
229 def doInsertKeyScene(self,w): | 235 def doInsertKeyScene(self,w): |
230 self._lockui=True | 236 self._lockui=True |
231 layer_idx, frame_idx = self._domview.get_active_layer_frame() | 237 layer_idx, frame_idx = self._domview.get_active_layer_frame() |
232 self.insertKeyScene(layer_idx, frame_idx) | 238 self.insertKeyScene(layer_idx, frame_idx) |
233 self.selectSceneObject(layer_idx, frame_idx) | 239 self.selectSceneObject(layer_idx, frame_idx) |
240 self.markUndo("insert key") | |
234 self._lockui=False | 241 self._lockui=False |
235 return | 242 return |
236 | 243 |
237 def doDuplicateKeyScene(self,w): | 244 def doDuplicateKeyScene(self,w): |
238 self._lockui = True | 245 self._lockui = True |
239 self.duplicateKeyScene() | 246 self.duplicateKeyScene() |
247 self.markUndo("dup key") | |
240 self._lockui = False | 248 self._lockui = False |
241 | 249 |
242 def doRemoveScene(self,w): | 250 def doRemoveScene(self,w): |
243 self._lockui = True | 251 self._lockui = True |
244 layer_idx, frame_idx = self._domview.get_active_layer_frame() | 252 layer_idx, frame_idx = self._domview.get_active_layer_frame() |
245 self.removeKeyScene(layer_idx, frame_idx) | 253 self.removeKeyScene(layer_idx, frame_idx) |
254 self.markUndo("remove key") | |
246 self._lockui = False | 255 self._lockui = False |
247 return | 256 return |
248 | 257 |
249 | 258 |
250 def doExtendScene(self,w): | 259 def doExtendScene(self,w): |
251 self._lockui = True | 260 self._lockui = True |
252 self.extendScene() | 261 self.extendScene() |
262 self.markUndo("extend key") | |
253 self._lockui = False | 263 self._lockui = False |
254 pass | 264 pass |
255 | 265 |
256 def doRun(self,arg): | 266 def doRun(self,arg): |
257 """ | 267 """ |
285 | 295 |
286 def doInsertFrame(self, w): | 296 def doInsertFrame(self, w): |
287 self.lockui=True | 297 self.lockui=True |
288 layer_idx, frame_idx = self._domview.get_active_layer_frame() | 298 layer_idx, frame_idx = self._domview.get_active_layer_frame() |
289 self._domview.insert_frames(layer_idx, frame_idx, 1) | 299 self._domview.insert_frames(layer_idx, frame_idx, 1) |
300 self.markUndo("insert frame") | |
290 self.lockui=False | 301 self.lockui=False |
291 | 302 |
292 def doRemoveFrame(self, w): | 303 def doRemoveFrame(self, w): |
293 self.lockui=True | 304 self.lockui=True |
294 layer_idx, frame_idx = self._domview.get_active_layer_frame() | 305 layer_idx, frame_idx = self._domview.get_active_layer_frame() |
295 self._domview.rm_frames(layer_idx, frame_idx, 1) | 306 self._domview.rm_frames(layer_idx, frame_idx, 1) |
307 self.markUndo("remove frame") | |
296 self.lockui=False | 308 self.lockui=False |
297 | 309 |
298 def do_TweenTypeChange(self, w): | 310 def do_TweenTypeChange(self, w): |
299 if self._disable_tween_type_selector: | 311 if self._disable_tween_type_selector: |
300 return | 312 return |
306 self._domview.get_left_key(layer_idx, frame_idx) | 318 self._domview.get_left_key(layer_idx, frame_idx) |
307 if end >= frame_idx and start != end: | 319 if end >= frame_idx and start != end: |
308 # Length of tween > 1 and cover this frame | 320 # Length of tween > 1 and cover this frame |
309 self._domview.chg_tween(layer_idx, start, tween_type=tween_type) | 321 self._domview.chg_tween(layer_idx, start, tween_type=tween_type) |
310 pass | 322 pass |
323 self.markUndo("change type") | |
311 pass | 324 pass |
312 | 325 |
313 def onQuit(self, event): | 326 def onQuit(self, event): |
314 self.OK = False | 327 self.OK = False |
315 gtk.main_quit() | 328 gtk.main_quit() |