[Commits] (donn) Minor fixes to the Detail View
commits at osafoundation.org
commits at osafoundation.org
Sun Aug 8 19:12:14 PDT 2004
Commit by: donn
Modified files:
chandler/parcels/osaf/framework/blocks/detail/Detail.py 1.19 1.20
chandler/parcels/osaf/framework/blocks/detail/parcel.xml 1.15 1.16
Log message:
Minor fixes to the Detail View
* Hides itself when no selected item
* Removed workarounds needed for copy policy issues
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/detail/Detail.py.diff?r1=text&tr1=1.19&r2=text&tr2=1.20
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/detail/parcel.xml.diff?r1=text&tr1=1.15&r2=text&tr2=1.16
Index: chandler/parcels/osaf/framework/blocks/detail/parcel.xml
diff -u chandler/parcels/osaf/framework/blocks/detail/parcel.xml:1.15 chandler/parcels/osaf/framework/blocks/detail/parcel.xml:1.16
--- chandler/parcels/osaf/framework/blocks/detail/parcel.xml:1.15 Tue Aug 3 02:26:29 2004
+++ chandler/parcels/osaf/framework/blocks/detail/parcel.xml Sun Aug 8 19:12:13 2004
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.15 $ -->
-<!-- $Date: 2004/08/03 09:26:29 $ -->
+<!-- $Revision: 1.16 $ -->
+<!-- $Date: 2004/08/09 02:12:13 $ -->
<!-- Copyright (c) 2003 Open Source Applications Foundation -->
<!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
@@ -62,10 +62,10 @@
-->
<!-- Root -->
- <ContentItemDetail itemName="DetailRoot"
+ <SelectionContainer itemName="DetailRoot"
itemClass="osaf.framework.blocks.detail.Detail.DetailRoot">
<childrenBlocks itemref="doc:DetailTrunk"/>
- </ContentItemDetail>
+ </SelectionContainer>
<ContentItemDetail itemName="DetailTrunk">
<!-- child blocks -->
Index: chandler/parcels/osaf/framework/blocks/detail/Detail.py
diff -u chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.19 chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.20
--- chandler/parcels/osaf/framework/blocks/detail/Detail.py:1.19 Fri Aug 6 17:08:12 2004
+++ chandler/parcels/osaf/framework/blocks/detail/Detail.py Sun Aug 8 19:12:13 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.19 $"
-__date__ = "$Date: 2004/08/07 00:08:12 $"
+__version__ = "$Revision: 1.20 $"
+__date__ = "$Date: 2004/08/09 02:12:13 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -103,12 +103,12 @@
block.synchronizeWidget()
def synchronizeItemDetail (self, item):
- # if there is an item, we should show the From and To Area
+ # if there is an item, we should show ourself, else hide
shouldShow = item is not None
return self.show(shouldShow)
def show(self, shouldShow):
- # if the show status has changed, tell our widget, and our parent
+ # if the show status has changed, tell our widget, and return True
if shouldShow != self.isShown:
try:
widget = self.widget
@@ -137,7 +137,11 @@
return relayout
def synchronizeItemDetail (self, item):
- return self.synchronizeLabel(self.staticTextLabelValue(item))
+ hasChanged = super(StaticTextLabel, self).synchronizeItemDetail(item)
+ if self.isShown:
+ labelChanged = self.synchronizeLabel(self.staticTextLabelValue(item))
+ hasChanged = hasChanged or labelChanged
+ return hasChanged
class DateTimeBlock (StaticTextLabel):
"""
@@ -213,33 +217,29 @@
def onButtonPressed (self, notification):
# Rekind the item by adding or removing the associated Mixin Kind
tool = notification.data['sender']
- # DLDTBD - use self instead of bar here, once block copy problem is fixed.
- bar = tool.dynamicParent
- item = bar.selectedItem()
- # DLDTBD - once block copy problem is fixed, we won't
- # need this check, because the buttons will not be enabled.
+ item = self.selectedItem()
isANoteKind = item.itsKind.isKindOf(ContentModel.ContentModel.getNoteKind())
if not isANoteKind:
return
if item is not None:
mixinKind = tool.stampMixinKind()
- if bar.widget.GetToolState(tool.toolID):
+ if self.widget.GetToolState(tool.toolID):
operation = 'add'
else:
operation = 'remove'
item.StampKind(operation, mixinKind)
# notify the world that the item has a new kind.
- block = bar
+ block = self
while block.eventBoundary == False:
block = block.parentBlock
block.parentBlock.synchronizeWidget()
def onButtonPressedUpdateUI (self, notification):
item = self.selectedItem()
- # DLDTBD - fix the line below to False when the block copy problem is fixed.
- enable = True
if item is not None:
- enable = item.itsKind.isKindOf(ContentModel.ContentModel.getNoteKind())
+ enable = item.itsKind.isKindOf(ContentModel.ContentModel.getNoteKind())
+ else:
+ enable = False
notification.data ['Enable'] = enable
class DetailStampButton (DetailSynchronizer, DynamicContainerBlocks.ToolbarItem):
More information about the Commits
mailing list