| 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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(&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, 17 Jul, 13:32 |
| ro...@alldunn.com> |
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, 17 Jul, 13:32 |
| ue Martins |
ting, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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><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, 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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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(&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, 30 Aug, 21:17 |
| @gmail.com> |
- 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, 30 Aug, 21:17 |
| r..@osafoundation.org> |
pan><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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(&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(&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 |
| b...@code-bear.com |
does.. so you want to maintain selection.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Mani s
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
on.org/mailman/listinfo/chandler-users_______________________________________________chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@code-bear.com |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@osafoundation.org |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@osafoundation.org |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@osafoundation.org |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@osafoundation.org |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| b...@osafoundation.org |
______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sat, 13 Sep, 09:29 |
| va...@osafoundation.org> |
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, 13 Mar, 15:31 |
| va...@osafoundation.org> |
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, 13 Mar, 15:31 |
| va...@osafoundation.org> |
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, 13 Mar, 15:31 |
| va...@osafoundation.org> |
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, 13 Mar, 15:31 |
| va...@osafoundation.org> |
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, 13 Mar, 15:31 |
| va...@osafoundation.org> |
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, 13 Mar, 15:31 |
| y |
# update the calendar with the calender's color
</span><span class="rem">- collection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ collection = self.blockItem.contentsCollection
</span><span class="cx">
# force the creation of the .color attribute
# XXX temporary - really this should somehow generate automatically
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarCollectionCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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</pre> |
Wed, 06 May, 16:56 |
| y |
# update the calendar with the calender's color
</span><span class="rem">- collection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ collection = self.blockItem.contentsCollection
</span><span class="cx">
# force the creation of the .color attribute
# XXX temporary - really this should somehow generate automatically
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarCollectionCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# First generate a sorted list olection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="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, 06 May, 16:56 |
| ia |
;@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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
</span><span class="rem">- collection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ collection = self.blockItem.contentsCollection
</span><span class="cx">
# force the creation of the .color attribute
# XXX temporary - really this should somehow generate automatically
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarCollectionCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/CollectionCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -8,8 +8,7 @@
</span><span class="cx">
import wx
</span><span class="rem">-from osaf.framework.blocks import DragAndDrop
-from osaf.framework.blocks import Block
</span><span class="add">+from osaf.framework.blocks import Block, DragAndDrop, FocusEventHandlers
</span><span class="cx"> from osaf.pim import AbstractCollection
from application import schema
from wx.lib import buttons
</span><span class="lines">@@ -227,7 +226,6 @@
</span><span class="cx"> This class handles:
1. Mouse Events: the class sets up methods for selection, move, resize
2. Scrolling
</span><span class="rem">- 3. Double buffered painting: the class sets up methods for drawing
</span><span class="cx">
Subclasses need to handle (by overriding appropriate methods):
1. Background drawing
</span><span class="lines">@@ -294,12 +292,6 @@
</span><span class="cx"> else:
event.Skip()
</span><span class="rem">- 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)
-
</span><span class="cx"> def GetCanvasItemAt(self, unscrolledPosition):
for canvasItem in reversed(self.canvasItemList):
if canvasItem.isHit(unscrolledPosition):
</span><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# F______chandler-usersmailinglistchandler-users@osafoundation.orghttp://lists.osafoundation.org/mailman/listinfo/chandler-users</pre> |
Sun, 18 Nov, 07:51 |
| is |
etContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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><span class="lines">@@ -669,7 +661,7 @@
</span><span class="cx"> self.blockItem.DeleteSelection()
</span><span class="rem">-class CollectionBlock(Block.RectangularChild):
</span><span class="add">+class CollectionBlock(FocusEventHandlers, Block.RectangularChild):
</span><span class="cx"> &quot;&quot;&quot;
Parent block class for a generic collection display. Handles selection,
hit testing, notifications, and some event handling
</span><span class="lines">@@ -695,11 +687,21 @@
</span><span class="cx"> # Event handling
def onSetContentsEvent (self, event):
</span><span class="rem">- self.setContentsOnBlock (event.arguments ['item'])
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="rem">- Clear the selection each time we view a new contents until we get
- a selection added to the contents item -- DJA
</span><span class="add">+ 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.
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="add">+ contents = event.arguments['item']
+ # collectionList[0] is the currently selected collection in
+ # the sidebar
+ contentsCollection = contents.collectionList[0]
+ self.setContentsOnBlock(contents, contentsCollection)
</span><span class="cx"> for item in self.selection:
if item not in self.contents:
self.selection.remove(item)
</span><span class="lines">@@ -730,20 +732,12 @@
</span><span class="cx"> &quot;&quot;&quot;
self.postEventByName('SelectItemsBroadcast',
{'items': self.selection,
</span><span class="rem">- 'selectAll': self.selectAllMode})
</span><span class="add">+ 'selectAll': self.selectAllMode,
+ 'collection': self.contentsCollection})
</span><span class="cx">
def SelectCollectionInSidebar(self, collection):
self.postEventByName('RequestSelectSidebarItem', {'item':collection})
</span><span class="rem">- 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()
-
</span><span class="cx"> def onSelectAllEvent(self, event):
self.selection = list(self.contents)
self.selectAllMode = True
</span><span class="lines">@@ -754,7 +748,7 @@
</span><span class="cx">
def DeleteSelection(self):
for item in self.selection:
</span><span class="rem">- item.removeFromCollection(self.contents.collectionList[0])
</span><span class="add">+ item.removeFromCollection(self.contentsCollection)
</span><span class="cx"> self.ClearSelection()
def ClearSelection(self):
</span><span class="lines">@@ -762,16 +756,5 @@
</span><span class="cx"> self.postSelectItemsBroadcast()
def CanAdd(self):
</span><span class="rem">- return not self.contents.collectionList[0].isReadOnly()
</span><span class="add">+ return not self.contentsCollection.isReadOnly()
</span><span class="cx">
</span><span class="rem">- def CanRemove(self):
- return (len(self.selection) &gt; 0 and
- not self.contents.collectionList[0].isReadOnly())
-
- def onRemoveEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
- event.arguments['Text'] = _(u&quot;Delete from '%(collectionName)s'&quot;) % {'collectionName': self.contents.collectionList[0].displayName}
-
- def onDeleteEventUpdateUI(self, event):
- event.arguments['Enable'] = self.CanRemove()
-
</span></pre></div>
<a id="branchesandichandlerparcelsosafframeworkblockscalendarTimedCanvaspy"></a>
<div class="modfile"><h4>Modified: branches/andi/chandler/parcels/osaf/framework/blocks/calendar/TimedCanvas.py (8369 => 8370)</h4>
<pre class="diff">
<span class="info">--- 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)
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">
currentDragBox = None
</span><span class="rem">- primaryCollection = self.blockItem.contents.collectionList[0]
</span><span class="add">+ primaryCollection = self.blockItem.contentsCollection
</span><span class="cx">
# 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"%(location)s does not exist") %
+ {'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">- # "self" 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("Starting GET of %s" % (location))
-
- if not sharingSelf.exists():
- raise NotFound(_(u"%(location)s does not exist") % {'location': location})
-
- sharingSelf.resourceList = sharingSelf._getResourceList(location)
-
</span><span class="cx"> logger.debug(_(u"Resources on server: %(resources)s") % \
</span><span class="rem">- {'resources':sharingSelf.resourceList})
</span><span class="add">+ {'resources':self.resourceList})
</span><span class="cx"> logger.debug(_(u"Manifest: %(manifest)s") % \
</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 |