FindFileApplication.st
changeset 15214 f00b3fcd0a60
parent 15105 30559da8faf6
child 15217 d815d45f3c53
--- a/FindFileApplication.st	Sat Feb 07 14:27:25 2015 +0100
+++ b/FindFileApplication.st	Sat Feb 07 14:39:57 2015 +0100
@@ -659,6 +659,12 @@
             isVisible: showingMatchedFiles
             argument: false
           )
+         (MenuItem
+            enabled: hasTwoFilesSelected
+            label: 'Compare with Each Other'
+            itemValue: doCompareTwoFiles
+            argument: false
+          )
          )
         nil
         nil
@@ -807,6 +813,23 @@
     "Modified: / 29-03-2012 / 10:05:39 / cg"
 !
 
+doCompareTwoFiles
+    |sel entry1 entry2|
+
+    sel := self selectionHolder value.
+    sel size == 2 ifFalse:[^ self].
+
+    entry1 := self shownList at:sel first.
+    (entry1 := entry1 asFilename) exists ifFalse:[
+        self warn:'Oops - file is gone: ',entry1 pathName
+    ].
+    entry2 := self shownList at:sel second.
+    (entry2 := entry2 asFilename) exists ifFalse:[
+        self warn:'Oops - file is gone: ',entry2 pathName
+    ].
+    masterApplication openDiffViewOn:entry1 and:entry2
+!
+
 doSearch
     |namePatterns excludedNamePatterns contentsPattern notContentsPattern dir fileToCompareAgainst ignoreCaseInName ignoreCaseInExcludedName 
      ignoreCaseInContents ignoreCaseInNotContents|
@@ -899,6 +922,7 @@
     (sel notEmptyOrNil) ifTrue:[
         entry := self shownList at:sel first.
         entry asFilename exists ifFalse:[ ^ self].
+
         application := targetApplication ? self masterApplication.
         application notNil ifTrue:[
             application fileIn:(entry asFilename).
@@ -1883,10 +1907,10 @@
 !FindFileApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.115 2015-01-23 23:03:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.116 2015-02-07 13:39:57 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.115 2015-01-23 23:03:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FindFileApplication.st,v 1.116 2015-02-07 13:39:57 cg Exp $'
 ! !