Title: [commits] (stearns) [16081] tweak DV strategy around block copying; update plugins to use new DV API; fix several plugins to inherit from ContentItem instead of Note

Diff

Modified: branches/detail_layout/chandler/parcels/osaf/framework/certstore/blocks.py (16080 => 16081)

--- branches/detail_layout/chandler/parcels/osaf/framework/certstore/blocks.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/parcels/osaf/framework/certstore/blocks.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -98,10 +98,6 @@
     )
 
     dv = detail.DetailViewMapping(certstore.Certificate.getKind(parcel.itsView))
-    dv.addRow(parcel, 'MarkupBarArea', 0.05, None, 
-        detail.MarkupBar, 
-        detail.EXPAND_HORIZONTALLY,
-        paddingAbove=0)
     dv.addRow(parcel, "PurposeArea", 0.1, _(u'purpose'),
         detail.makeEditor(parcel, 'PurposeAttribute',
             viewAttribute=u'purpose',

Modified: branches/detail_layout/chandler/parcels/osaf/servlets/photo.py (16080 => 16081)

--- branches/detail_layout/chandler/parcels/osaf/servlets/photo.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/parcels/osaf/servlets/photo.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -21,7 +21,7 @@
     isLeaf = True
     def render_GET(self, request):
 
-        from photos import PhotoMixin
+        from photos import Photo
 
         result = []
         output = result.append
@@ -38,7 +38,7 @@
                 output(u"<h3>Photos</h3><br>")
 
                 photoList = []
-                for photo in PhotoMixin.iterItems(repoView):
+                for photo in Photo.iterItems(repoView):
                     photoList.append(photo)
                     if not hasattr(photo, 'dateTaken'):
                         photo.dateTaken = datetime.datetime.now(repoView.tzinfo.default)

Modified: branches/detail_layout/chandler/parcels/osaf/views/detail/detail.py (16080 => 16081)

--- branches/detail_layout/chandler/parcels/osaf/views/detail/detail.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/parcels/osaf/views/detail/detail.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -125,6 +125,7 @@
             labelFont = \
                 Styles.getFont(schema.ns("osaf.framework.blocks", 
                                          self.blockItem.itsView).LabelStyle)
+            
             for rowIndex, row in enumerate(self.blockItem.detailRows):
                 layoutFlags = row.layoutFlags
                 sizerFlags = layoutFlags & ~(PAD_LEFT | PAD_RIGHT | PAD_BETWEEN)
@@ -290,10 +291,10 @@
     
 class DetailBlock(schema.Annotation):
     """ 
-    A block in the detail view - we annotate it with the rows it belongs to
+    A block in the detail view - we annotate it with the row it belongs to
     """
     schema.kindInfo(annotates=Block.Block)
-    detailRows = schema.Sequence() # detailRow.blocks
+    detailRow = schema.One() # detailRow.blocks
 
 class DetailRow(schema.Item):
     """ 
@@ -302,7 +303,7 @@
     detailViewMapping = schema.One() # DetailViewMapping.detailRows
     detailView = schema.One() # DetailRootBlock.detailRows
     position = schema.One(schema.Float)
-    blocks = schema.Sequence(inverse=DetailBlock.detailRows)
+    blocks = schema.Sequence(inverse=DetailBlock.detailRow)
     label = schema.One(LocalizableString)
     layoutFlags = schema.One(schema.Integer)
     
@@ -311,10 +312,12 @@
     paddingAbove = schema.One(schema.Dictionary)
     paddingBelowIfLast = schema.One(schema.Dictionary)
 
+    # When we copy a row, copy its blocks too, but don't bother with
+    # the backreference to the detailviewmapping.
     schema.addClouds(
         copying = schema.Cloud(
-            byRef = [detailViewMapping],
-            byCloud = [blocks]
+            byCloud = [ blocks ],
+            none = [ detailViewMapping ]
         )
     )
 
@@ -394,28 +397,24 @@
         Handle a cache miss; build and return the detail tree-of-blocks
         for this keyItem, a Kind.
         """
-        # Walk through the keys we have subtrees for, and collect subtrees to use;
-        # we decide to use a subtree if _includeSubtree returns True for it.
-        # Each subtree we find has children that are the blocks that are to be 
-        # collected and sorted (by their 'position' attribute, then their paths
-        # to be deterministic in the event of a tie) into the tree we'll use.
-        # Blocks without 'position' attributes will naturally be sorted to the end.
-        # If we were given a reference to a 'stub' block, we'll copy that and use
-        # it as the root of the tree; otherwise, it's assumed that we'll only find
-        # one subtree for our key, and use it directly.
-
-        # (Yes, I wrote this as a double nested list comprehension with filtering, 
-        # but I couldn't decide how to work in a lambda function, so I backed off and
-        # opted for clarity.)
-        decoratedRowList = [] # each entry will be (position, path, detailRow)
+        # Collect a set containing this kind and all the kinds that it 
+        # inherits from
         itemKinds = set(keyItem.getInheritedSuperKinds())
         itemKinds.add(keyItem)
+        
+        # For each of those kinds that has a DetailViewMapping, make a copy of
+        # its rows -- the copy will also duplicate the row's blocks.
+        # Put the row copies in a list that we can sort by position (and by 
+        # path, to break ties deterministically)
+        decoratedRowList = [] # each entry will be (position, path, detailRowCopy)
         for itemKind in itemKinds:
             dvMapping = DetailViewMapping(itemKind)
             rows = getattr(dvMapping, 'detailRows', None)
             if rows is not None:
                 decoratedRowList.extend([
-                    (getattr(row, 'position', sys.maxint), row.itsPath, row)
+                    (getattr(row, 'position', sys.maxint), 
+                     row.itsPath, 
+                     self._copyItem(row))
                     for row in rows 
                 ])
 
@@ -423,25 +422,16 @@
             assert False, "Don't know how to build a branch for kind %r!" % keyItem
             # (We can continue here - we'll end up just caching an empty view.)
 
-        decoratedRowList.sort()
-
-        # Make a list of copies of all the detailrows we include in the new view,
-        # and a list of all the (copied) blocks comprising them.
-        rows = []
-        childBlocks = []
-        for position, path, detailRow in decoratedRowList:
-            detailRowCopy = self._copyItem(detailRow) # this makes copies of the blocks too.
-            rows.append(detailRowCopy)
-            childBlocks.extend(detailRowCopy.blocks)
-        
-        # Copy our stub block and move copies of each row's blocks onto it,
+        # Copy our stub block and each copied row's blocks onto it,
         # in order
         branchRootBlock = self._copyItem(self.branchStub)
-        branchRootBlock.detailRows.extend(rows)
-        branchRootBlock.childBlocks.extend(childBlocks)
+        decoratedRowList.sort()
+        rows = [ detailRow for position, path, detailRow in decoratedRowList ]
+        for row in rows:
+            branchRootBlock.childBlocks.extend(row.blocks)
+        branchRootBlock.detailRows.extend(rows)       
         return branchRootBlock
 
-
 class DetailSynchronizedBehavior(Item):
     """
     Mixin class that handles synchronization and notification common to most
@@ -1265,7 +1255,7 @@
                 control.AppendItems(choices)
             control.SetSelection(value)
 
-class ReminderUnitsAttributeEditor(StringAttributeEditor):    
+class ReminderUnitsAttributeEditor(SmallNumberAttributeEditor):    
     def GetAttributeValue(self, item, attributeName):
         # Get the existing reminder, and figure out what kind it is
         reminderType = getReminderType(item)
@@ -2128,7 +2118,8 @@
         for addr in addrs:
             choices.append(addr.emailAddress)
 
-        choices.append(_(u"Create outgoing mail account..."))
+        # *** I18N message changed to fit dropdown
+        choices.append(_(u"Configure accounts..."))
         return choices
 
     def GetControlValue(self, control):

Modified: branches/detail_layout/chandler/parcels/osaf/views/detail/detailblocks.py (16080 => 16081)

--- branches/detail_layout/chandler/parcels/osaf/views/detail/detailblocks.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/parcels/osaf/views/detail/detailblocks.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -131,39 +131,180 @@
 def installParcel(parcel, oldVersion=None):
     """
     Instantiate all the blocks, events, etc for the detail view.
-    """
-    blocks = schema.ns("osaf.framework.blocks", parcel.itsView)
-                       
+    """                       
     # Register all the custom attribute editors 
     registerAttributeEditors(parcel, oldVersion)
 
-    # Make the Markup Bar, which other detail views can include
-    makeMarkupBar(parcel, oldVersion)
-
     # Make the stub block that the BranchPoint mechanism will clone
     DetailRootBlock.template('DetailRoot',
                              orientationEnum='Vertical',
                              size=SizeType(80, 20),
                              minimumSize=SizeType(80, 40),
                              eventBoundary=True).install(parcel)
-   
-    # Build the detail view for Note (which is used for all the stamped things)
-    dv = DetailViewMapping(osaf.pim.Note.getKind(parcel))
+       
+    # Make and the detail view for ContentItem (mostly just the markup bar)
+    makeContentItemDetailView(parcel)
+
+    # Make the detail view for Note (which is used for all the stamped things)
+    makeNoteDetailView(parcel)
     
-    # Add our rows
+    # Make the blank detail view (for when there's nothing selected)
+    makeBlankDetailView(parcel)
+
+def registerAttributeEditors(parcel, oldVersion):
+    # make the detail view's attribute editors at repository-init time
+    # If you edit this dictionary, please keep it in alphabetical order by key.
+    aeDict = {
+        'DateTime+calendarDateOnly': 'CalendarDateAttributeEditor',
+        'DateTimeTZ+calendarDateOnly': 'CalendarDateAttributeEditor',
+        'DateTime+calendarTimeOnly': 'CalendarTimeAttributeEditor',
+        'DateTimeTZ+calendarTimeOnly': 'CalendarTimeAttributeEditor',
+        'EmailAddress+outbound': 'OutboundEmailAddressAttributeEditor',
+        'EmailAddress+originators': 'OriginatorsAttributeEditor',
+        'NoneType+appearsIn': 'AppearsInAttributeEditor',
+        'RecurrenceRuleSet+custom': 'RecurrenceCustomAttributeEditor',
+        'RecurrenceRuleSet+ends': 'RecurrenceEndsAttributeEditor',
+        'RecurrenceRuleSet+occurs': 'RecurrenceAttributeEditor',
+        'SmartCollection+appearsIn': 'AppearsInAttributeEditor',
+        'Reminder+reminderType': 'ReminderTypeAttributeEditor',
+        'TimeDelta+reminderUnits': 'ReminderUnitsAttributeEditor',
+        'TimeDelta+reminderScale': 'ReminderScaleAttributeEditor',
+    }
+    AttributeEditorMapping.register(parcel, aeDict, __name__)
+
+def makeContentItemDetailView(parcel):
+    """
+    Build the markup bar.
+    """
+    blocks = schema.ns("osaf.framework.blocks", parcel.itsView)
+
+    # Each button just sends this event to itself.
+    buttonPressed = BlockEvent.template('ButtonPressed',
+                                        dispatchEnum='SendToSender',
+                                        commitAfterDispatch=True).install(parcel)
+
+    # We also put the "read" timer in the markup bar; it sends this event.
+    unreadTimeout = BlockEvent.template('UnreadTimeout',
+                                        dispatchEnum = 'SendToSender').install(parcel)
+    
+    # The buttons.
+    triageStamp = \
+        DetailTriageButtonBlock.template('TriageStamp',
+                                         title=messages.STAMP_TRIAGE,
+                                         icon="TriageDone",
+                                         helpString=messages.STAMP_TRIAGE_HELP,
+                                         event=buttonPressed,
+                                         viewAttribute='_triageStatus',
+                                         stretchFactor=0.0)
+
+    markupSpacer1 = ControlBlocks.StaticText.template('MarkupSpacer1',
+                                    title=u'',
+                                    stretchFactor=0.0,
+                                    minimumSize=SizeType(30, 18))
+
+    mailMessageButton = \
+        MailMessageButtonBlock.template('MailMessageButton',
+                                        title=messages.STAMP_MAIL,
+                                        icon="MarkupMail",
+                                        helpString=messages.STAMP_MAIL_HELP,
+                                        unstampedHelpString=messages.UNSTAMP_MAIL_HELP,
+                                        event=buttonPressed,
+                                        stretchFactor=0.0,
+                                        minimumSize=SizeType(30, 18))
+
+    taskStamp = \
+        TaskStampButtonBlock.template('TaskStamp',
+                                title=messages.STAMP_TASK,
+                                icon="MarkupTask",
+                                helpString=messages.STAMP_TASK_HELP,
+                                unstampedHelpString=messages.UNSTAMP_TASK_HELP,
+                                event=buttonPressed,
+                                stretchFactor=0.0,
+                                minimumSize=SizeType(30, 18))
+
+    calendarStamp = \
+        CalendarStampButtonBlock.template('CalendarStamp',
+                                title=messages.STAMP_CALENDAR,
+                                icon="MarkupEvent",
+                                helpString=messages.STAMP_CALENDAR_HELP,
+                                unstampedHelpString=messages.UNSTAMP_CALENDAR_HELP,
+                                event=buttonPressed,
+                                stretchFactor=0.0,
+                                minimumSize=SizeType(30, 18))
+
+    markupSpacer2 = ControlBlocks.StaticText.template('MarkupSpacer2',
+                                    title=u'',
+                                    stretchFactor=0.0,
+                                    minimumSize=SizeType(30, 18))
+
+    # Per bug 8999, we're hiding this for now.
+    #privateSwitchButton = \
+        #PrivateSwitchButtonBlock.template('PrivateSwitchButton',
+                                    #title=messages.PRIVATE,
+                                    #icon="MarkupPrivate",
+                                    #helpString=messages.PRIVATE,
+                                    #unstampedHelpString=messages.NOT_PRIVATE,
+                                    #viewAttribute=u'private',
+                                    #event=buttonPressed,
+                                    #stretchFactor=0.0,
+                                    #minimumSize=SizeType(30, 18))
+    #markupSpacer3 = ControlBlocks.StaticText.template('MarkupSpacer3',
+                                    #title=u'')
+
+    readOnlyIcon = \
+        ReadOnlyIconBlock.template('ReadOnlyIcon',
+                                    title=messages.READONLY,
+                                    icon="MarkupReadOnly",
+                                    helpString=messages.READONLY,
+                                    event=buttonPressed,
+                                    stretchFactor=0.0,
+                                    minimumSize=SizeType(30, 18))
+
+    # The unread timer - it isn't visible, but the markup bar's a handy place to hang it.
+    unreadTimer = UnreadTimerBlock.template("unreadTimerBlock",
+                                            event=unreadTimeout)
+
+    # Build the detail view for ContentItem: it's just the markup bar, 
+    # conflict bar, and AppearsIn
+    dv = DetailViewMapping(osaf.pim.ContentItem.getKind(parcel))
     dv.addRow(parcel, 'ConflictBar', 0.00, None,
         ConflictWarningButton.template('ConflictButton',
                                        title=u'',
                                        characterStyle = blocks.DetailConflictStyle,
                                        buttonKind='TextImage',
                                        # need a better icon
-                                       icon=u'MailErrorRolloverSelected.png'))
-    
+                                       icon=u'MailErrorRolloverSelected.png'))    
     dv.addRow(parcel, 'MarkupBarArea', 0.05, None, 
-        parcel['MarkupBar'], 
+        ControlBlocks.ContentItemDetail.template('MarkupBar',
+            childBlocks=[triageStamp,
+                         markupSpacer1,
+                         mailMessageButton,
+                         taskStamp,
+                         calendarStamp,
+                         markupSpacer2,
+                         # hidden per bug 8999
+                         #privateSwitchButton,
+                         #markupSpacer3,
+                         readOnlyIcon,
+                         unreadTimer],
+            toolSize=SizeType(30, 18),
+            separatorWidth=16),
         EXPAND_HORIZONTALLY,
         paddingAbove=0)
 
+    dv.addRow(parcel, 'AppearsInArea', 0.90, None,
+        makeEditor(parcel, 'AppearsIn',
+                   baseClass=AppearsInAEBlock,
+                   viewAttribute=u'appearsIn',
+                   presentationStyle={'format': 'appearsIn'}),
+        EXPAND_HORIZONTALLY | PAD_LEFT | PAD_RIGHT)
+
+def makeNoteDetailView(parcel):
+    blocks = schema.ns("osaf.framework.blocks", parcel.itsView)
+
+    dv = DetailViewMapping(osaf.pim.Note.getKind(parcel))
+    
+    # Add our rows
     dv.addRow(parcel, 'OriginatorsArea', 0.10, _(u'from'),
         makeEditor(parcel, 'EditMailOriginators',
                    baseClass=OriginatorsAEBlock,
@@ -367,13 +508,7 @@
         EXPAND_VERTICALLY | EXPAND_HORIZONTALLY,
         paddingBelowIfLast=0)
 
-    dv.addRow(parcel, 'AppearsInArea', 0.90, None,
-        makeEditor(parcel, 'AppearsIn',
-                   baseClass=AppearsInAEBlock,
-                   viewAttribute=u'appearsIn',
-                   presentationStyle={'format': 'appearsIn'}),
-        EXPAND_HORIZONTALLY | PAD_LEFT | PAD_RIGHT)
-
+def makeBlankDetailView(parcel):
     # Make the blank detail view, too, used when there's no item selected 
     # in the detail view (We use the Block kind as the key, though it's not 
     # a content kind)
@@ -385,130 +520,3 @@
         EXPAND_VERTICALLY | EXPAND_HORIZONTALLY,
         paddingBelowIfLast=0)
     
-def registerAttributeEditors(parcel, oldVersion):
-    # make the detail view's attribute editors at repository-init time
-    # If you edit this dictionary, please keep it in alphabetical order by key.
-    aeDict = {
-        'DateTime+calendarDateOnly': 'CalendarDateAttributeEditor',
-        'DateTimeTZ+calendarDateOnly': 'CalendarDateAttributeEditor',
-        'DateTime+calendarTimeOnly': 'CalendarTimeAttributeEditor',
-        'DateTimeTZ+calendarTimeOnly': 'CalendarTimeAttributeEditor',
-        'EmailAddress+outbound': 'OutboundEmailAddressAttributeEditor',
-        'EmailAddress+originators': 'OriginatorsAttributeEditor',
-        'NoneType+appearsIn': 'AppearsInAttributeEditor',
-        'RecurrenceRuleSet+custom': 'RecurrenceCustomAttributeEditor',
-        'RecurrenceRuleSet+ends': 'RecurrenceEndsAttributeEditor',
-        'RecurrenceRuleSet+occurs': 'RecurrenceAttributeEditor',
-        'SmartCollection+appearsIn': 'AppearsInAttributeEditor',
-        'Reminder+reminderType': 'ReminderTypeAttributeEditor',
-        'TimeDelta+reminderUnits': 'ReminderUnitsAttributeEditor',
-        'TimeDelta+reminderScale': 'ReminderScaleAttributeEditor',
-    }
-    AttributeEditorMapping.register(parcel, aeDict, __name__)
-
-def makeMarkupBar(parcel, oldVersion):
-    """
-    Build the markup bar.
-    """
-
-    # Each button just sends this event to itself.
-    buttonPressed = BlockEvent.template('ButtonPressed',
-                                        dispatchEnum='SendToSender',
-                                        commitAfterDispatch=True).install(parcel)
-
-    # We also put the "read" timer in the markup bar; it sends this event.
-    unreadTimeout = BlockEvent.template('UnreadTimeout',
-                                        dispatchEnum = 'SendToSender').install(parcel)
-    
-    # The buttons.
-    triageStamp = \
-        DetailTriageButtonBlock.template('TriageStamp',
-                                         title=messages.STAMP_TRIAGE,
-                                         icon="TriageDone",
-                                         helpString=messages.STAMP_TRIAGE_HELP,
-                                         event=buttonPressed,
-                                         viewAttribute='_triageStatus',
-                                         stretchFactor=0.0)
-
-    markupSpacer1 = ControlBlocks.StaticText.template('MarkupSpacer1',
-                                    title=u'',
-                                    stretchFactor=0.0,
-                                    minimumSize=SizeType(30, 18))
-
-    mailMessageButton = \
-        MailMessageButtonBlock.template('MailMessageButton',
-                                        title=messages.STAMP_MAIL,
-                                        icon="MarkupMail",
-                                        helpString=messages.STAMP_MAIL_HELP,
-                                        unstampedHelpString=messages.UNSTAMP_MAIL_HELP,
-                                        event=buttonPressed,
-                                        stretchFactor=0.0,
-                                        minimumSize=SizeType(30, 18))
-
-    taskStamp = \
-        TaskStampButtonBlock.template('TaskStamp',
-                                title=messages.STAMP_TASK,
-                                icon="MarkupTask",
-                                helpString=messages.STAMP_TASK_HELP,
-                                unstampedHelpString=messages.UNSTAMP_TASK_HELP,
-                                event=buttonPressed,
-                                stretchFactor=0.0,
-                                minimumSize=SizeType(30, 18))
-
-    calendarStamp = \
-        CalendarStampButtonBlock.template('CalendarStamp',
-                                title=messages.STAMP_CALENDAR,
-                                icon="MarkupEvent",
-                                helpString=messages.STAMP_CALENDAR_HELP,
-                                unstampedHelpString=messages.UNSTAMP_CALENDAR_HELP,
-                                event=buttonPressed,
-                                stretchFactor=0.0,
-                                minimumSize=SizeType(30, 18))
-
-    markupSpacer2 = ControlBlocks.StaticText.template('MarkupSpacer2',
-                                    title=u'',
-                                    stretchFactor=0.0,
-                                    minimumSize=SizeType(30, 18))
-
-    # Per bug 8999, we're hiding this for now.
-    #privateSwitchButton = \
-        #PrivateSwitchButtonBlock.template('PrivateSwitchButton',
-                                    #title=messages.PRIVATE,
-                                    #icon="MarkupPrivate",
-                                    #helpString=messages.PRIVATE,
-                                    #unstampedHelpString=messages.NOT_PRIVATE,
-                                    #viewAttribute=u'private',
-                                    #event=buttonPressed,
-                                    #stretchFactor=0.0,
-                                    #minimumSize=SizeType(30, 18))
-    #markupSpacer3 = ControlBlocks.StaticText.template('MarkupSpacer3',
-                                    #title=u'')
-
-    readOnlyIcon = \
-        ReadOnlyIconBlock.template('ReadOnlyIcon',
-                                    title=messages.READONLY,
-                                    icon="MarkupReadOnly",
-                                    helpString=messages.READONLY,
-                                    event=buttonPressed,
-                                    stretchFactor=0.0,
-                                    minimumSize=SizeType(30, 18))
-
-    # The unread timer - it isn't visible, but the markup bar's a handy place to hang it.
-    unreadTimer = UnreadTimerBlock.template("unreadTimerBlock",
-                                            event=unreadTimeout)
-
-    # Finally, make the markup bar itself
-    ControlBlocks.ContentItemDetail.template('MarkupBar',
-        childBlocks=[triageStamp,
-                     markupSpacer1,
-                     mailMessageButton,
-                     taskStamp,
-                     calendarStamp,
-                     markupSpacer2,
-                     # hidden per bug 8999
-                     #privateSwitchButton,
-                     #markupSpacer3,
-                     readOnlyIcon,
-                     unreadTimer],
-        toolSize=SizeType(30, 18),
-        separatorWidth=16).install(parcel)

Modified: branches/detail_layout/chandler/parcels/osaf/views/detail/sizer.py (16080 => 16081)

--- branches/detail_layout/chandler/parcels/osaf/views/detail/sizer.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/parcels/osaf/views/detail/sizer.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -257,7 +257,7 @@
             if widestLabel < labelWidth:
                 widestLabel = labelWidth
             if expands_vertically:
-                assert vertical_expander is None
+                #assert vertical_expander is None
                 vertical_expander = rowIndex
             rows.append([rowItems, horizontal_expander])
         # logger.critical("Widest label is %s" % widestLabel)

Modified: branches/detail_layout/chandler/projects/Chandler-AmazonPlugin/amazon/__init__.py (16080 => 16081)

--- branches/detail_layout/chandler/projects/Chandler-AmazonPlugin/amazon/__init__.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/projects/Chandler-AmazonPlugin/amazon/__init__.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -69,10 +69,6 @@
     )
 
     dv = DetailViewMapping(AmazonItem.getKind(parcel.itsView))
-    dv.addRow(parcel, 'MarkupBarArea', 0.05, None, 
-        detail.MarkupBar, 
-        EXPAND_HORIZONTALLY,
-        paddingAbove=0)
     dv.addRow(parcel, 'AmazonDetailArea', 0.10, None,
         AmazonDetailBlock.update(parcel, "amazonDetail",
             blockName = "amazonDetail",

Modified: branches/detail_layout/chandler/projects/Chandler-FeedsPlugin/feeds/blocks.py (16080 => 16081)

--- branches/detail_layout/chandler/projects/Chandler-FeedsPlugin/feeds/blocks.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/projects/Chandler-FeedsPlugin/feeds/blocks.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -179,10 +179,6 @@
     
     # The hierarchy of UI elements for the FeedItem detail view
     dv = detail.DetailViewMapping(FeedItem.getKind(parcel.itsView))
-    dv.addRow(parcel, 'MarkupBarArea', 0.05, None, 
-        detail.MarkupBar, 
-        detail.EXPAND_HORIZONTALLY,
-        paddingAbove=0)
     dv.addRow(parcel, 'AuthorArea', 0.19, _(u"author"),
         detail.makeEditor(parcel, "author",
                viewAttribute=u"author",

Modified: branches/detail_layout/chandler/projects/Chandler-FeedsPlugin/feeds/channels.py (16080 => 16081)

--- branches/detail_layout/chandler/projects/Chandler-FeedsPlugin/feeds/channels.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/projects/Chandler-FeedsPlugin/feeds/channels.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -420,7 +420,7 @@
         if author is not None:
             whos.append((10, author, 'author'))
 
-class FeedItem(pim.Note):
+class FeedItem(pim.ContentItem):
     """
     This class implements a feed channel item that is visualized
     in the summary and detail views.

Modified: branches/detail_layout/chandler/projects/Chandler-FlickrPlugin/flickr/__init__.py (16080 => 16081)

--- branches/detail_layout/chandler/projects/Chandler-FlickrPlugin/flickr/__init__.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/projects/Chandler-FlickrPlugin/flickr/__init__.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -18,7 +18,7 @@
 from dialogs import LicenseTask, promptLicense
 from application import schema
 from osaf import pim
-from photos import PhotoMixin
+from photos import Photo
 from osaf.pim.collections import KindCollection
 from repository.util.URL import URL
 from repository.item.Item import MissingClass
@@ -34,9 +34,9 @@
 _ = MessageFactory("Chandler-FlickrPlugin")
 
 
-class FlickrPhotoMixin(PhotoMixin):
+class FlickrPhoto(Photo):
     """
-    A mixin that adds flickr attributes to a Note item
+    A Photo item with Flickr attributes
     """
     flickrID = schema.One(schema.Text)
     imageURL = schema.One(schema.URL)
@@ -78,16 +78,11 @@
         self.updateDisplayWho(op, attr)
     
     def addDisplayWhos(self, whos):
-        super(FlickrPhotoMixin, self).addDisplayWhos(whos)
+        super(FlickrPhoto, self).addDisplayWhos(whos)
         owner = getattr(self, 'owner', None)
         if owner is not None:
             whos.append((16, owner, 'owner'))
 
-
-class FlickrPhoto(FlickrPhotoMixin, pim.Note):
-    pass
-
-
 class Tag(pim.ContentItem):
     """
     Tag are items with bidirectional references to all the FlickrPhoto's
@@ -95,8 +90,7 @@
     all tags belonging to a photo. Currently, there isn't any code that
     takes advantage of Tags.
     """
-    itemsWithTag = schema.Sequence(FlickrPhotoMixin,
-                                   inverse=FlickrPhotoMixin.tags)
+    itemsWithTag = schema.Sequence(FlickrPhoto, inverse=FlickrPhoto.tags)
 
     @classmethod
     def getTag(cls, view, tagName):
@@ -284,7 +278,7 @@
     # lookup photos by flickrID quickly.
     flickrPhotosCollection = KindCollection.update(
         parcel, 'flickrPhotosCollection',
-        kind = FlickrPhotoMixin.getKind(parcel.itsView),
+        kind = FlickrPhoto.getKind(parcel.itsView),
         recursive = True)
 
     if not flickrPhotosCollection.hasIndex('flickrIDIndex'):

Modified: branches/detail_layout/chandler/projects/Chandler-PhotoPlugin/photos/Photos.py (16080 => 16081)

--- branches/detail_layout/chandler/projects/Chandler-PhotoPlugin/photos/Photos.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/projects/Chandler-PhotoPlugin/photos/Photos.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -31,7 +31,7 @@
 
 logger = logging.getLogger(__name__)
 
-class PhotoMixin(pim.ContentItem):
+class Photo(pim.Note):
     dateTaken = schema.One(schema.DateTimeTZ)
     file = schema.One(schema.Text)
     exif = schema.Mapping(schema.Text, initialValue={})
@@ -109,16 +109,12 @@
         self.updateDisplayDate(op, attr)
 
     def addDisplayDates(self, dates, now):
-        super(PhotoMixin, self).addDisplayDates(dates, now)
+        super(Photo, self).addDisplayDates(dates, now)
         dateTaken = getattr(self, 'dateTaken', None)
         if dateTaken is not None:
             dates.append((40, dateTaken, 'dateTaken'))
 
 
-class Photo(PhotoMixin, pim.Note):
-    pass
-
-
 class NewImageEvent(NewItemEvent):
     """
     An event used to import a new image from disk.

Modified: branches/detail_layout/chandler/projects/Chandler-PhotoPlugin/photos/__init__.py (16080 => 16081)

--- branches/detail_layout/chandler/projects/Chandler-PhotoPlugin/photos/__init__.py	2007-12-07 19:51:44 UTC (rev 16080)
+++ branches/detail_layout/chandler/projects/Chandler-PhotoPlugin/photos/__init__.py	2007-12-07 19:55:27 UTC (rev 16081)
@@ -15,7 +15,7 @@
 
 __parcel__ = "photos"
 
-from Photos import Photo, PhotoMixin, NewImageEvent
+from Photos import Photo, NewImageEvent
 from application import schema
 from osaf.pim.structs import RectType
 from osaf.pim.notes import Note
@@ -26,7 +26,7 @@
 
 def installParcel(parcel, old_version=None):
     detail = schema.ns('osaf.views.detail', parcel)
-    dv = detail.DetailViewMapping(PhotoMixin.getKind(parcel.itsView))
+    dv = detail.DetailViewMapping(Photo.getKind(parcel.itsView))
     dv.addRow(parcel, 'PhotoBodyArea', 0.59, None,
         detail.makeEditor(parcel, "PhotoBody",
             viewAttribute=u"photoBody",




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to