Mailing list archives: July 2007

Site index · List index
Message list1 · 2 · Next »Thread · Author · Date
ja...@wordzoo.com ___________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Thu, 24 Apr, 14:24
ja...@wordzoo.com ___________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Thu, 24 Apr, 14:24
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
Parlante _____chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 09 Apr, 03:30
ghoff dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 31 Jul, 21:15
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
fo"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 02:32
s DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 07 Apr, 21:37
ro...@alldunn.com> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Tue, 17 Jul, 13:32
ro...@alldunn.com> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Tue, 17 Jul, 13:32
ue Martins ting, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 27 Jul, 11:53
ue Martins ting, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 27 Jul, 11:53
ic / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 07 Jun, 03:49
n /span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 11 Nov, 09:57
e s="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 18 Feb, 17:56
e ;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 18 Feb, 17:56
e ;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 18 Feb, 17:56
e ;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 18 Feb, 17:56
e ;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 18 Feb, 17:56
e ;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 18 Feb, 17:56
s selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Tue, 21 May, 04:38
@gmail.com> - logger.info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sun, 30 Aug, 21:17
@gmail.com> - logger.info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sun, 30 Aug, 21:17
r..@osafoundation.org> pan&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Thu, 30 Jan, 06:45
r..@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Thu, 30 Jan, 06:45
r..@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Thu, 30 Jan, 06:45
b...@code-bear.com does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Mani s def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; on.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@code-bear.com ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@osafoundation.org ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@osafoundation.org ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@osafoundation.org ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@osafoundation.org ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
b...@osafoundation.org ______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Sep, 09:29
va...@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Mar, 15:31
va...@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Mar, 15:31
va...@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Mar, 15:31
va...@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Mar, 15:31
va...@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Mar, 15:31
va...@osafoundation.org> info(&amp;quot;Starting GET of %s&amp;quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Sat, 13 Mar, 15:31
y # update the calendar with the calender's color &lt;/span&gt;&lt;span class="rem"&gt;- collection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ collection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # force the creation of the .color attribute # XXX temporary - really this should somehow generate automatically &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarCollectionCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list oer-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafohandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Wed, 06 May, 16:56
y # update the calendar with the calender's color &lt;/span&gt;&lt;span class="rem"&gt;- collection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ collection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # force the creation of the .color attribute # XXX temporary - really this should somehow generate automatically &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarCollectionCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list olection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="u&amp;quot;%(location)s does not exist&amp;quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Resources on server: %(resources)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'resources':sharingSelf.resourceList}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'resources':self.resourceList}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; logger.debug(_(u&amp;quot;Manifest: %(manifest)s&amp;quot;) % \ &lt;/span&gt;&lt;span class=&quot;rem&quot;&gt;- {'manifest':sharingSelf.manifest}) &lt;/span&gt;&lt;span class=&quot;add&quot;&gt;+ {'manifest':self.manifest}) &lt;/span&gt;&lt;span class=&quot;cx&quot;&gt; # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users&lt;/pre&gt; Wed, 06 May, 16:56
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
ia ;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Mon, 26 May, 09:29
w.@osafoundation.org> an be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 24 May, 21:02
w.@osafoundation.org> an be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sat, 24 May, 21:02
<mor...@osafoundation.org> # update the calendar with the calender's color &lt;/span&gt;&lt;span class="rem"&gt;- collection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ collection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # force the creation of the .color attribute # XXX temporary - really this should somehow generate automatically &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarCollectionCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -8,8 +8,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; import wx &lt;/span&gt;&lt;span class="rem"&gt;-from osaf.framework.blocks import DragAndDrop -from osaf.framework.blocks import Block &lt;/span&gt;&lt;span class="add"&gt;+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers &lt;/span&gt;&lt;span class="cx"&gt; from osaf.pim import AbstractCollection from application import schema from wx.lib import buttons &lt;/span&gt;&lt;span class="lines"&gt;@@ -227,7 +226,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; This class handles: 1. Mouse Events: the class sets up methods for selection, move, resize 2. Scrolling &lt;/span&gt;&lt;span class="rem"&gt;- 3. Double buffered painting: the class sets up methods for drawing &lt;/span&gt;&lt;span class="cx"&gt; Subclasses need to handle (by overriding appropriate methods): 1. Background drawing &lt;/span&gt;&lt;span class="lines"&gt;@@ -294,12 +292,6 @@ &lt;/span&gt;&lt;span class="cx"&gt; else: event.Skip() &lt;/span&gt;&lt;span class="rem"&gt;- def DrawCenteredText(self, dc, text, rect): - textExtent = dc.GetTextExtent(text) - middleRect = rect.width / 2 - middleText = textExtent[0] / 2 - dc.DrawText(text, rect.x + middleRect - middleText, rect.y) - &lt;/span&gt;&lt;span class="cx"&gt; def GetCanvasItemAt(self, unscrolledPosition): for canvasItem in reversed(self.canvasItemList): if canvasItem.isHit(unscrolledPosition): &lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # F______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 18 Nov, 07:51
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
is ot; is an obje Sun, 22 Jun, 20:09
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
is etContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Sun, 22 Jun, 20:09
nen lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Wed, 11 Jan, 14:11
nen lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Wed, 11 Jan, 14:11
nen lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Wed, 11 Jan, 14:11
nen lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Wed, 11 Jan, 14:11
nen lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Wed, 11 Jan, 14:11
nen lt;/span&gt;&lt;span class="lines"&gt;@@ -669,7 +661,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.blockItem.DeleteSelection() &lt;/span&gt;&lt;span class="rem"&gt;-class CollectionBlock(Block.RectangularChild): &lt;/span&gt;&lt;span class="add"&gt;+class CollectionBlock(FocusEventHandlers, Block.RectangularChild): &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; Parent block class for a generic collection display. Handles selection, hit testing, notifications, and some event handling &lt;/span&gt;&lt;span class="lines"&gt;@@ -695,11 +687,21 @@ &lt;/span&gt;&lt;span class="cx"&gt; # Event handling def onSetContentsEvent (self, event): &lt;/span&gt;&lt;span class="rem"&gt;- self.setContentsOnBlock (event.arguments ['item']) &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="rem"&gt;- Clear the selection each time we view a new contents until we get - a selection added to the contents item -- DJA &lt;/span&gt;&lt;span class="add"&gt;+ Make sure to update the selection, keeping any items that are + still in the newly selected collection, since items can be in + multiple collections. + + This also accounts for the case where multiple collections are + selected in the sidebar, and the user is selecting different + ones - the actual items visible don't change, but their + coloring does.. so you want to maintain selection. &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; &lt;/span&gt;&lt;span class="add"&gt;+ contents = event.arguments['item'] + # collectionList[0] is the currently selected collection in + # the sidebar + contentsCollection = contents.collectionList[0] + self.setContentsOnBlock(contents, contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; for item in self.selection: if item not in self.contents: self.selection.remove(item) &lt;/span&gt;&lt;span class="lines"&gt;@@ -730,20 +732,12 @@ &lt;/span&gt;&lt;span class="cx"&gt; &amp;quot;&amp;quot;&amp;quot; self.postEventByName('SelectItemsBroadcast', {'items': self.selection, &lt;/span&gt;&lt;span class="rem"&gt;- 'selectAll': self.selectAllMode}) &lt;/span&gt;&lt;span class="add"&gt;+ 'selectAll': self.selectAllMode, + 'collection': self.contentsCollection}) &lt;/span&gt;&lt;span class="cx"&gt; def SelectCollectionInSidebar(self, collection): self.postEventByName('RequestSelectSidebarItem', {'item':collection}) &lt;/span&gt;&lt;span class="rem"&gt;- def onDeleteEvent(self, event): - trash = schema.ns('osaf.app', self).TrashCollection - for item in self.selection: - item.addToCollection(trash) - self.ClearSelection() - - def onRemoveEvent(self, event): - self.DeleteSelection() - &lt;/span&gt;&lt;span class="cx"&gt; def onSelectAllEvent(self, event): self.selection = list(self.contents) self.selectAllMode = True &lt;/span&gt;&lt;span class="lines"&gt;@@ -754,7 +748,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; def DeleteSelection(self): for item in self.selection: &lt;/span&gt;&lt;span class="rem"&gt;- item.removeFromCollection(self.contents.collectionList[0]) &lt;/span&gt;&lt;span class="add"&gt;+ item.removeFromCollection(self.contentsCollection) &lt;/span&gt;&lt;span class="cx"&gt; self.ClearSelection() def ClearSelection(self): &lt;/span&gt;&lt;span class="lines"&gt;@@ -762,16 +756,5 @@ &lt;/span&gt;&lt;span class="cx"&gt; self.postSelectItemsBroadcast() def CanAdd(self): &lt;/span&gt;&lt;span class="rem"&gt;- return not self.contents.collectionList[0].isReadOnly() &lt;/span&gt;&lt;span class="add"&gt;+ return not self.contentsCollection.isReadOnly() &lt;/span&gt;&lt;span class="cx"&gt; &lt;/span&gt;&lt;span class="rem"&gt;- def CanRemove(self): - return (len(self.selection) &amp;gt; 0 and - not self.contents.collectionList[0].isReadOnly()) - - def onRemoveEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - event.arguments['Text'] = _(u&amp;quot;Delete from '%(collectionName)s'&amp;quot;) % {'collectionName': self.contents.collectionList[0].displayName} - - def onDeleteEventUpdateUI(self, event): - event.arguments['Enable'] = self.CanRemove() - &lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"&gt;&lt;/a&gt; &lt;div class="modfile"&gt;&lt;h4&gt;Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 =&gt; 8370)&lt;/h4&gt; &lt;pre class="diff"&gt; &lt;span class="info"&gt;--- branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:04:48 UTC (rev 8369) +++ branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py 2005-11-21 19:27:12 UTC (rev 8370) &lt;/span&gt;&lt;span class="lines"&gt;@@ -343,7 +343,7 @@ &lt;/span&gt;&lt;span class="cx"&gt; currentDragBox = None &lt;/span&gt;&lt;span class="rem"&gt;- primaryCollection = self.blockItem.contents.collectionList[0] &lt;/span&gt;&lt;span class="add"&gt;+ primaryCollection = self.blockItem.contentsCollection &lt;/span&gt;&lt;span class="cx"&gt; # First generate a sorted list of Time</span><span class="rem">- if sharingView is None: - sharingView = self.itsView </span><span class="add">+ if not self.exists(): + raise NotFound(_(u&quot;%(location)s does not exist&quot;) % + {'location': location}) </span><span class="cx"> </span><span class="rem">- else: - # Make sure our version is as it was at last sync - version = self.marker.getVersion() - sharingView.itsVersion = version </span><span class="add">+ self.resourceList = self._getResourceList(location) </span><span class="cx"> </span><span class="rem">- # &quot;self&quot; is an object in the main view; we need a reference to self - # that is in the sharing view: - sharingSelf = sharingView[self.itsUUID] - - location = sharingSelf.getLocation() - logger.info(&quot;Starting GET of %s&quot; % (location)) - - if not sharingSelf.exists(): - raise NotFound(_(u&quot;%(location)s does not exist&quot;) % {'location': location}) - - sharingSelf.resourceList = sharingSelf._getResourceList(location) - </span><span class="cx"> logger.debug(_(u&quot;Resources on server: %(resources)s&quot;) % \ </span><span class="rem">- {'resources':sharingSelf.resourceList}) </span><span class="add">+ {'resources':self.resourceList}) </span><span class="cx"> logger.debug(_(u&quot;Manifest: %(manifest)s&quot;) % \ </span><span class="rem">- {'manifest':sharingSelf.manifest}) </span><span class="add">+ {'manifest':self.manifest}) </span><span class="cx"> # We need to keep track of which items we'veosafoundation.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> Wed, 11 Jan, 14:11
Message list1 · 2 · Next »Thread · Author · Date
Box list
Feb 20104
Jan 20102
Dec 20092
Nov 20091
Sep 20097
Aug 200911
Jul 20093
Jun 200925
May 200933
Apr 200914
Mar 200913