[Commits] (john) * Used cloud delete to delete all the UI in the soup rather than my old piece of code that left garbage in the repository

commits at osafoundation.org commits at osafoundation.org
Wed Apr 6 18:01:05 PDT 2005


Commit by: john
Modified files:
chandler/application/Application.py 1.319 1.320
chandler/parcels/osaf/framework/blocks/Block.py 1.103 1.104
chandler/parcels/osaf/framework/blocks/parcel.xml 1.158 1.159
chandler/parcels/osaf/framework/blocks/ContainerBlocks.py 1.152 1.153
chandler/parcels/osaf/views/main/parcel.xml 1.197 1.198

Log message:
* Used cloud delete to delete all the UI in the soup rather than my old piece of code that left garbage in the repository
* Fixed various bugs in Chandler where the UI leaked out from the soup to the R/O view
* Verified that Reload Parcels in the debug menu now works from any UI skin

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/application/Application.py.diff?r1=text&tr1=1.319&r2=text&tr2=1.320
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/Block.py.diff?r1=text&tr1=1.103&r2=text&tr2=1.104
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/parcel.xml.diff?r1=text&tr1=1.158&r2=text&tr2=1.159
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ContainerBlocks.py.diff?r1=text&tr1=1.152&r2=text&tr2=1.153
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/parcel.xml.diff?r1=text&tr1=1.197&r2=text&tr2=1.198

Index: chandler/application/Application.py
diff -u chandler/application/Application.py:1.319 chandler/application/Application.py:1.320
--- chandler/application/Application.py:1.319	Mon Mar 28 23:22:47 2005
+++ chandler/application/Application.py	Wed Apr  6 18:01:02 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.319 $"
-__date__ = "$Date: 2005/03/29 07:22:47 $"
+__version__ = "$Revision: 1.320 $"
+__date__ = "$Date: 2005/04/07 01:01:02 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -356,32 +356,6 @@
           that isn't it's UUID. We need the name to look it up. If the main view's root
           isn't found then make a copy into the soup with the right name.
         """
-        def deleteBlockItem (block):
-            """
-              Deletes blocks. Temporary hack until cloud delete is available. May
-            leave minor garbage around that is never cleaned up.
-            """
-            if not block is None:
-                for child in block.childrenBlocks:
-                    deleteBlockItem (child)
-                try:
-                    eventsForNamedDispatch = block.eventsForNamedDispatch
-                except AttributeError:
-                    pass
-                else:
-                    for events in eventsForNamedDispatch:
-                        events.delete()
-                try:
-                    contents = block.contents
-                except AttributeError:
-                    pass
-                else:
-                    contents.delete()
-                try:
-                    blockName = block.blockName
-                except AttributeError:
-                    blockName = "None"
-                block.delete()
 
         mainViewRoot = self.UIRepositoryView.findPath('//userdata/MainViewRoot')
         if mainViewRoot and delete:
@@ -390,12 +364,11 @@
             except AttributeError:
                 pass
             self.UIRepositoryView.refresh()
-            deleteBlockItem (mainViewRoot)
+            mainViewRoot.delete (cloudAlias="default")
             self.UIRepositoryView.commit()
             mainViewRoot = None
         if mainViewRoot is None:
             template = self.UIRepositoryView.findPath ("//parcels/osaf/views/main/MainViewRoot")
-            assert (template)
             mainViewRoot = template.copy (parent = self.UIRepositoryView.findPath ("//userdata"),
                                           name = "MainViewRoot",
                                           cloudAlias="default")

Index: chandler/parcels/osaf/framework/blocks/parcel.xml
diff -u chandler/parcels/osaf/framework/blocks/parcel.xml:1.158 chandler/parcels/osaf/framework/blocks/parcel.xml:1.159
--- chandler/parcels/osaf/framework/blocks/parcel.xml:1.158	Wed Mar 23 17:02:06 2005
+++ chandler/parcels/osaf/framework/blocks/parcel.xml	Wed Apr  6 18:01:02 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.158 $ -->
-<!-- $Date: 2005/03/24 01:02:06 $ -->
+<!-- $Revision: 1.159 $ -->
+<!-- $Date: 2005/04/07 01:01:02 $ -->
 <!-- Copyright (c) 2003-2005 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -1394,7 +1394,7 @@
         <endpoints itemref="docSchema:TrunkParentBlock/DefaultCloud/trunkDelegate"/>
         <Endpoint itsName="detailItem">
             <attribute value="detailItem"/>
-            <includePolicy value="byRef"/>
+            <includePolicy value="byCloud"/>
         </Endpoint>
         <endpoints itemref="docSchema:TrunkParentBlock/DefaultCloud/detailItem"/>
         <Endpoint itsName="colorStyle">

Index: chandler/parcels/osaf/framework/blocks/Block.py
diff -u chandler/parcels/osaf/framework/blocks/Block.py:1.103 chandler/parcels/osaf/framework/blocks/Block.py:1.104
--- chandler/parcels/osaf/framework/blocks/Block.py:1.103	Fri Mar 18 13:41:43 2005
+++ chandler/parcels/osaf/framework/blocks/Block.py	Wed Apr  6 18:01:02 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.103 $"
-__date__ = "$Date: 2005/03/18 21:41:43 $"
+__version__ = "$Revision: 1.104 $"
+__date__ = "$Date: 2005/04/07 01:01:02 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -520,12 +520,11 @@
         except AttributeError:
             methodName = 'on' + event.blockName + 'Event'
 
-        try:
-            updateUI = event.arguments['UpdateUI']
-        except KeyError:
-            updateUI = False
-        else:
+        if event.arguments.has_key ('UpdateUI'):
             methodName += 'UpdateUI'
+            commitAfterDispatch = False
+        else:
+            commitAfterDispatch = event.commitAfterDispatch
 
         dispatchEnum = event.dispatchEnum
         if dispatchEnum == 'SendToBlockByReference':
@@ -580,7 +579,7 @@
         elif __debug__:
             assert (False)
 
-        if (not updateUI) and event.commitAfterDispatch:
+        if commitAfterDispatch:
             wx.GetApp().UIRepositoryView.commit()
     dispatchEvent = classmethod (dispatchEvent)
 

Index: chandler/parcels/osaf/views/main/parcel.xml
diff -u chandler/parcels/osaf/views/main/parcel.xml:1.197 chandler/parcels/osaf/views/main/parcel.xml:1.198
--- chandler/parcels/osaf/views/main/parcel.xml:1.197	Wed Mar 23 17:02:06 2005
+++ chandler/parcels/osaf/views/main/parcel.xml	Wed Apr  6 18:01:03 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.197 $ -->
-<!-- $Date: 2005/03/24 01:02:06 $ -->
+<!-- $Revision: 1.198 $ -->
+<!-- $Date: 2005/04/07 01:01:03 $ -->
 <!-- Copyright (c) 2003-2004 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -1419,7 +1419,7 @@
   </SplitterWindow>
 
   <LayoutChooser itsName="CPIATestSummaryView">
-    <blockName>CPIATestSummaryViewhooser</blockName>
+    <blockName>CPIATestSummaryView</blockName>
     <childrenBlocks itemref="doc:CPIATestLayoutToolbar"/>
     <childrenBlocks itemref="doc:CPIATestTable"/>
     <choices itemref="doc:CPIATestTable"/>

Index: chandler/parcels/osaf/framework/blocks/ContainerBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.152 chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.153
--- chandler/parcels/osaf/framework/blocks/ContainerBlocks.py:1.152	Fri Mar 18 13:41:43 2005
+++ chandler/parcels/osaf/framework/blocks/ContainerBlocks.py	Wed Apr  6 18:01:03 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.152 $"
-__date__ = "$Date: 2005/03/18 21:41:43 $"
+__version__ = "$Revision: 1.153 $"
+__date__ = "$Date: 2005/04/07 01:01:03 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -367,6 +367,15 @@
                     self.selectionIndex = selectionIndex
                     self.widget.wxSynchronizeWidget()
                 else:
+                    """
+                      If the view points to the read only section replace it with a copy
+                    in the soup
+                    """
+                    userData = self.findPath ('//userdata')
+                    if view.itsParent != userData:
+                        self.views.remove (view)
+                        view = view.copy (parent = userData, cloudAlias="default")
+                        self.views.append (view)
                     self.postEventByName('SelectItemBroadcast', {'item':view})
                 break
             selectionIndex = selectionIndex + 1



More information about the Commits mailing list