Tools__NewSystemBrowser.st
changeset 19222 a46e0f77f600
parent 19193 c94e6916839c
child 19242 eeab0a7983b2
--- a/Tools__NewSystemBrowser.st	Thu Oct 17 20:59:46 2019 +0200
+++ b/Tools__NewSystemBrowser.st	Fri Oct 18 10:59:41 2019 +0200
@@ -48255,10 +48255,12 @@
     self moveOrCopyMethods:methods toClass:newClass moveOrCopy:#copy
 !
 
-doCompareMethod:m1 against:m2 label:label
+doCompareMethod:m1 against:m2 label:labelOrNil
     "compare two methods"
 
-    |source1 source2 v m1Class m2Class|
+    |source1 source2 v 
+     m1Class m2Class m1ClassName m2ClassName m1Selector m2Selector
+     label1 label2 label|
 
     source1 := m1 source string.
     source1 isNil ifTrue:[
@@ -48273,13 +48275,37 @@
 
     m1Class := m1 mclass.
     m2Class := m2 mclass.
-
+    m1ClassName := m1Class name.
+    m2ClassName := m2Class name.
+    m1Selector := m1 selector.
+    m2Selector := m2 selector.
+    label := labelOrNil.
+
+    m1Selector = m2Selector ifTrue:[
+        label1 := m1ClassName.
+        label2 := m2ClassName.
+        label isNil ifTrue:[
+            label := resources string:'Comparing %1' with:m1Selector.
+        ].
+    ] ifFalse:[
+        label1 := (m1 printStringForBrowserWithSelector:m1Selector inClass:m1Class).
+        label2 := (m2 printStringForBrowserWithSelector:m2Selector inClass:m2Class).
+        m1Class = m2Class ifTrue:[
+            label isNil ifTrue:[
+                label := resources string:'Comparing in %1' with:m1ClassName.
+            ].
+        ] ifFalse:[
+            label1 := m1ClassName , ' ' , label1.
+            label2 := m2ClassName , ' ' , label2.
+            label isNil ifTrue:[
+                label := resources string:'Comparing Methods'.
+            ].
+        ].
+    ].
     v := DiffCodeView
-            openOn:source1
-            label:(m1Class name , ' ' , (m1 printStringForBrowserWithSelector:m1 selector inClass:m1Class))
-            and:source2
-            label:(m2Class name , ' ' , (m2 printStringForBrowserWithSelector:m2 selector inClass:m2Class)).
-    v label:label.
+            openOn:source1 label:label1
+            and:source2 label:label2.
+    v topView label:label.
     v waitUntilVisible.
     ^ self
 !
@@ -49636,7 +49662,7 @@
     self
         doCompareMethod:(selectedMethods first)
         against:(selectedMethods second)
-        label:(resources string:'Comparing methods')
+        label:nil. "/ let callee compute a label (resources string:'Comparing Methods')
 
     "Modified: / 28-02-2012 / 16:29:05 / cg"
 !