#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Tue, 28 Nov 2017 14:41:57 +0100
changeset 17803 12fb9b50a719
parent 17802 3fefef20b087
child 17804 77140839072d
#UI_ENHANCEMENT by cg class: Tools::NewSystemBrowser changed: #askForMethodAndSpawnSearchTitle:browserLabel:searchWith:searchWhat:searchArea:withCaseIgnore:withTextEntry:withMatch:withMethodList:setSearchPattern:initialText: when a search fails with an obvious matchPattern as string, but match-search not checked, ask again fo doing a match search.
Tools__NewSystemBrowser.st
--- a/Tools__NewSystemBrowser.st	Tue Nov 28 14:22:10 2017 +0100
+++ b/Tools__NewSystemBrowser.st	Tue Nov 28 14:41:57 2017 +0100
@@ -57123,6 +57123,7 @@
             methods := dialog methodsToSearch.
             isMethod := dialog matchMethods.
 
+        [:searchAgain |    
             self withSearchCursorDo:[
                 |initialList list newBrowser numFound label
                  selectorList selector entities arguments numArgs answer
@@ -57262,11 +57263,28 @@
                         arguments := altArguments.
 
                     ] ifFalse:[
-                        answer := Dialog
-                            confirm:question
-                            yesLabel:(resources string:'Search Again')
-                            noLabel:(resources string:'Cancel').
-                        answer ifFalse:[
+                        "/ answer := Dialog
+                        "/     confirm:question
+                        "/     yesLabel:(resources string:'Search Again')
+                        "/     noLabel:(resources string:'Cancel').
+                        (match not and:[string includesMatchCharacters]) ifTrue:[
+                            answer := Dialog
+                                        choose:question
+                                        labels:(resources array:#('Cancel' 'Search as Matchpattern' 'Search Again'))
+                                        values:#(false #matchSearch true)
+                                        default:#matchSearch.
+                        ] ifFalse:[    
+                            answer := Dialog
+                                        choose:question
+                                        labels:(resources array:#('Cancel' 'Search Again'))
+                                        values:#(false true)
+                                        default:true.
+                        ].
+                        answer == #matchSearch ifTrue:[
+                            match := true.
+                            searchAgain value.
+                        ].    
+                        (answer isNil or:[answer == false]) ifTrue:[
                             ^ self
                         ].
                         restart value.
@@ -57317,11 +57335,12 @@
                 "/ Transcript show:'search time: '; showCR:t.
                 ^ newBrowser.
             ].
+        ] valueWithRestart.
         ].
     ] valueWithRestart.
 
     "Modified: / 04-09-2013 / 17:39:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 15-03-2017 / 13:03:54 / cg"
+    "Modified: / 28-11-2017 / 14:41:02 / cg"
 !
 
 askForMethodAndSpawnSearchTitle:title browserLabel:labelHolderOrBlock