comparison pyink/domview_ui.py @ 1258:2609b219703d

Move initialize of consistency_checker to domview_ui_with_workers
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 11 Jan 2011 17:24:56 +0800
parents 07e0cb1e051d
children df474448364e
comparison
equal deleted inserted replaced
1257:027cd060d9ba 1258:2609b219703d
359 super(domview_ui, self).__init__() 359 super(domview_ui, self).__init__()
360 self._fl_stack = frameline_stack() 360 self._fl_stack = frameline_stack()
361 self._dom = domview() 361 self._dom = domview()
362 self._doc = None 362 self._doc = None
363 self._root = None 363 self._root = None
364 self._consistency_checker = consistency.consistency_checker(self)
365 self._lock = False 364 self._lock = False
366 pass 365 pass
367 366
368 ## \brief Update content of a frameline from scenes of respective layer. 367 ## \brief Update content of a frameline from scenes of respective layer.
369 # 368 #
408 self._add_frameline_for_every_layer() 407 self._add_frameline_for_every_layer()
409 self._fl_stack._show_framelines() 408 self._fl_stack._show_framelines()
410 409
411 self._doc = doc 410 self._doc = doc
412 self._root = root 411 self._root = root
413 self._consistency_checker.handle_doc_root(doc, root)
414 pass 412 pass
415 413
416 ## \brief Mark given frame as a key frame. 414 ## \brief Mark given frame as a key frame.
417 # 415 #
418 def mark_key(self, layer_idx, key_idx): 416 def mark_key(self, layer_idx, key_idx):
652 def unlock(self): 650 def unlock(self):
653 self._lock = False 651 self._lock = False
654 return True 652 return True
655 pass 653 pass
656 654
655
656 ## \brief A mix-in to enable workers for a domview_ui.
657 #
658 class domview_ui_with_workers(domview_ui):
659 def __init__(self):
660 super(domview_ui_with_workers, self).__init__()
661
662 self._consistency_checker = consistency.consistency_checker(self)
663 pass
664
665 def handle_doc_root(self, doc, root):
666 super(domview_ui_with_workers, self).handle_doc_root(doc, root)
667
668 self._consistency_checker.handle_doc_root(doc, root)
669 pass
670 pass
671
672
673 ## \brief Factory function of domview_ui.
674 #
675 def create_domview_ui():
676 domview = domview_ui_with_workers()
677 return domview
678