#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Tue, 21 Jun 2016 10:20:57 +0200
changeset 16710 3db036345074
parent 16707 88a409fbc3b0
child 16711 bcaef4ee8e9a
#UI_ENHANCEMENT by cg class: VersionDiffBrowser changed: #updateLabels
VersionDiffBrowser.st
--- a/VersionDiffBrowser.st	Mon Jun 20 14:25:00 2016 +0200
+++ b/VersionDiffBrowser.st	Tue Jun 21 10:20:57 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2000 by eXept Software AG
 	      All Rights Reserved
@@ -2208,7 +2210,7 @@
             ].
         ].
         changeClassName notEmptyOrNil ifTrue:[
-            selectorString := ' » ',selectorString
+            selectorString := ' » ',selectorString
         ]
     ].
 
@@ -2296,22 +2298,36 @@
     "update the labels of the diff text view. Show the version numbers
      of the class."
 
-    |theVersionA theVersionB builder|
+    |theVersionA theVersionB builder revInfo labelA labelB date author|
 
     builder := self builder.
     (theVersionA := self versionA) notNil ifTrue:[
-	self diffTextLabelA value:theVersionA.
-	self onlyInALabelHolder value:('Only in ' , theVersionA).
-	(self componentAt:#OnlyInALabel)
-	    foregroundColor:Color white;
-	    backgroundColor:Color green darkened.
+        labelA := theVersionA.
+        revInfo := versionInfoList detect:[:info | (info at:#revision) = theVersionA value] ifNone:nil.
+        revInfo notNil ifTrue:[
+            date := (Timestamp readGeneralizedFrom:(revInfo at:#date)) asDate.
+            author := (revInfo at:#author) ? '?'.
+            labelA := theVersionA , ' [',date printString,' by ',author,']'.
+        ].
+        self diffTextLabelA value:labelA.
+        self onlyInALabelHolder value:('Only in ' , theVersionA).
+        (self componentAt:#OnlyInALabel)
+            foregroundColor:Color white;
+            backgroundColor:Color green darkened.
     ].
     (theVersionB :=self versionB) notNil ifTrue:[
-	self diffTextLabelB value:theVersionB.
-	self onlyInBLabelHolder value:('Only in ' , theVersionB).
-	(self componentAt:#OnlyInBLabel)
-	    foregroundColor:Color white;
-	    backgroundColor:Color red darkened.
+        labelB := theVersionB.
+        revInfo := versionInfoList detect:[:info | (info at:#revision) = theVersionB value] ifNone:nil.
+        revInfo notNil ifTrue:[
+            date := (Timestamp readGeneralizedFrom:(revInfo at:#date)) asDate.
+            author := (revInfo at:#author) ? '?'.
+            labelA := theVersionB , ' [',date printString,' by ',author,']'.
+        ].
+        self diffTextLabelB value:labelB.
+        self onlyInBLabelHolder value:('Only in ' , theVersionB).
+        (self componentAt:#OnlyInBLabel)
+            foregroundColor:Color white;
+            backgroundColor:Color red darkened.
     ].
 
     self changedLabelHolder value:('Different').