Commit by: stearns
Modified files:
chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py 1.40 1.40.2.1
chandler/parcels/osaf/framework/blocks/detail/Detail.py 1.105.2.2 1.105.2.3

Log message:
Fix 2666 and 2734 (r=Morgen), and 2743 (r=bkirsch,alecf): Detail view rendering 
messed up when you drag an event in the calendar view, detail view rendering is 
messed up when you enter values in the different fields, Chandler crashes in 
the calendar view

Bugzilla links:
http://bugzilla.osafoundation.org/show_bug.cgi?id=2666
http://bugzilla.osafoundation.org/show_bug.cgi?id=2734
http://bugzilla.osafoundation.org/show_bug.cgi?id=2743

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py.diff?r1=text&tr1=1.40&r2=text&tr2=1.40.2.1
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/detail/Detail.py.diff?r1=text&tr1=1.105.2.2&r2=text&tr2=1.105.2.3

Index: chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py
diff -u chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py:1.40 
chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py:1.40.2.1
--- chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py:1.40      
Thu Mar 17 15:01:28 2005
+++ chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py   Tue Mar 
22 15:42:16 2005
@@ -1,8 +1,8 @@
 """ Canvas for calendaring blocks
 """
 
-__version__ = "$Revision: 1.40 $"
-__date__ = "$Date: 2005/03/17 23:01:28 $"
+__version__ = "$Revision: 1.40.2.1 $"
+__date__ = "$Date: 2005/03/22 23:42:16 $"
 __copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm";
 
@@ -972,7 +972,7 @@
         parent.Bind(wx.EVT_SIZE, self.OnSize)
 
     def SaveItem(self):
-        if self.item != None:
+        if ((self.item != None) and (not self.IsBeingDeleted())):
             self.item.displayName = self.GetValue()
         
     def OnTextEnter(self, event):

Index: chandler/parcels/osaf/framework/blocks/detail/Detail.py
diff -u chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.105.2.2 
chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.105.2.3
--- chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.105.2.2   Mon Mar 
21 11:30:07 2005
+++ chandler/parcels/osaf/framework/blocks/detail/Detail.py     Tue Mar 22 
15:42:16 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.105.2.2 $"
-__date__ = "$Date: 2005/03/21 19:30:07 $"
+__version__ = "$Revision: 1.105.2.3 $"
+__date__ = "$Date: 2005/03/22 23:42:16 $"
 __copyright__ = "Copyright (c) 2004-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm";
 
@@ -275,7 +275,16 @@
         except AttributeError:
             pass
 
-
+    def onCollectionChanged (self, action):
+        """
+        When our item collection has changed, we need to synchronize ourselves.
+        (We suppress this if we're in the midst of stamping; our item's in an 
+        inconsistent state.)
+        """
+        if not getattr(self, "ignoreCollectionChangedWhileStamping", False):
+            # Block.logger.debug("DetailRoot: onCollectionChanged")
+            self.synchronizeWidget()
+    
 class DetailTrunkDelegate (Trunk.TrunkDelegate):
     """ 
     Delegate for the trunk builder on DetailRoot; the cache key is the given 
item's Kind
@@ -391,7 +400,11 @@
         if shouldShow != widget.IsShown():
             # we have a widget
             # make sure widget shown state is what we want
-            widget.Show (shouldShow)
+            if shouldShow:
+                widget.Show (shouldShow)
+            else:
+                widget.SetMinSize(wx.Size(0,0))
+                widget.Hide()
             self.isShown = shouldShow
             return True
         return False
@@ -563,7 +576,13 @@
             operation = 'add'
         else:
             operation = 'remove'
+        
+        # Suppress our on-change processing to avoid issues with 
+        # notifications midway through stamping. See bug 2739.
+        self.detailRoot().ignoreCollectionChangedWhileStamping = True
         item.StampKind(operation, mixinKind)
+        del self.detailRoot().ignoreCollectionChangedWhileStamping
+        
         # notify the world that the item has a new kind.
         self.resynchronizeDetailView ()
 

_______________________________________________
Commits mailing list
Commits@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to