[Commits] (donn) Implemented rerender() to rebuild CPIA world when "Reload Parcels" is selected

commits at osafoundation.org commits at osafoundation.org
Wed Aug 11 19:16:13 PDT 2004


Commit by: donn
Modified files:
chandler/application/Application.py 1.257 1.258
chandler/parcels/osaf/framework/blocks/Block.py 1.58 1.59
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.98 1.99

Log message:
Implemented rerender() to rebuild CPIA world when "Reload Parcels" is selected
   * Just a first pass implementation - still has problems with Menus
   * Reloads the children of the MainView, but couldn't get MainView reloading to work

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/application/Application.py.diff?r1=text&tr1=1.257&r2=text&tr2=1.258
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/Block.py.diff?r1=text&tr1=1.58&r2=text&tr2=1.59
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.98&r2=text&tr2=1.99

Index: chandler/application/Application.py
diff -u chandler/application/Application.py:1.257 chandler/application/Application.py:1.258
--- chandler/application/Application.py:1.257	Fri Jul 30 15:47:27 2004
+++ chandler/application/Application.py	Wed Aug 11 19:16:11 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.257 $"
-__date__ = "$Date: 2004/07/30 22:47:27 $"
+__version__ = "$Revision: 1.258 $"
+__date__ = "$Date: 2004/08/12 02:16:11 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -414,7 +414,7 @@
                           The state of the new GetShow flag should be the opposite of whether or
                         not we have a subscribeWhenVisibleEventsUUID attribute
                         """
-                        assert event.GetShow() ^ widget.hasAttributeValue ('subscribeWhenVisibleEventsUUID')
+                        assert event.GetShow() ^ hasattr (widget, 'subscribeWhenVisibleEventsUUID')
         
                         if event.GetShow():
                             widget.subscribeWhenVisibleEventsUUID = UUID()

Index: chandler/parcels/osaf/framework/blocks/Block.py
diff -u chandler/parcels/osaf/framework/blocks/Block.py:1.58 chandler/parcels/osaf/framework/blocks/Block.py:1.59
--- chandler/parcels/osaf/framework/blocks/Block.py:1.58	Wed Aug 11 06:33:13 2004
+++ chandler/parcels/osaf/framework/blocks/Block.py	Wed Aug 11 19:16:12 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.58 $"
-__date__ = "$Date: 2004/08/11 13:33:13 $"
+__version__ = "$Revision: 1.59 $"
+__date__ = "$Date: 2004/08/12 02:16:12 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -116,6 +116,24 @@
                 if doFreeze:
                     widget.Thaw()
 
+    def rerender (self):
+        """ 
+        Tear down and rebuild the widgets for all blocks starting at self.
+        Used by ReloadParcels
+        """
+        import osaf.framework.blocks.DynamicContainerBlocks as DynamicContainerBlocks
+        for child in self.childrenBlocks:
+            # Menus are not contined in the widget hierarchy, so
+            #  we need to handle them specially.
+            if isinstance(child, DynamicContainerBlocks.MenuBar):
+                # flag rebuild of dynamic containers including menus
+                Globals.mainView.lastDynamicParent = False
+            else:
+                # destroy a widget
+                child.widget.Destroy ()
+                child.render ()
+        self.synchronizeWidget ()
+
     def onCollectionChanged (self, notification):
         """
           When our item collection has changed, we need to synchronize

Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.98 chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.99
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.98	Wed Aug 11 06:33:13 2004
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py	Wed Aug 11 19:16:12 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.98 $"
-__date__ = "$Date: 2004/08/11 13:33:13 $"
+__version__ = "$Revision: 1.99 $"
+__date__ = "$Date: 2004/08/12 02:16:12 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -728,7 +728,6 @@
 class StatusBar(Block):
     def instantiateWidget (self):
         frame = Globals.wxApplication.mainFrame
-        assert frame.GetStatusBar() == None
         widget = wxStatusBar (frame, Block.getWidgetID(self))
         frame.SetStatusBar (widget)
         return widget



More information about the Commits mailing list