*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Thu, 16 Nov 2000 12:55:32 +0100
changeset 992 83f257a4fa0c
parent 991 8d7083231ed9
child 993 ebcbcdd21e05
*** empty log message ***
SourceCodeManagerUtilities.st
--- a/SourceCodeManagerUtilities.st	Wed Nov 15 13:49:28 2000 +0100
+++ b/SourceCodeManagerUtilities.st	Thu Nov 16 12:55:32 2000 +0100
@@ -15,7 +15,8 @@
 
 Object subclass:#SourceCodeManagerUtilities
 	instanceVariableNames:''
-	classVariableNames:'LastSourceLogMessage LastModule LastPackage'
+	classVariableNames:'LastSourceLogMessage LastModule LastPackage YesToAllQuery
+		YesToAllNotification'
 	poolDictionaries:''
 	category:'System-SourceCodeManagement'
 !
@@ -53,6 +54,22 @@
 "
 ! !
 
+!SourceCodeManagerUtilities class methodsFor:'Signal constants'!
+
+yesToAllNotification
+    YesToAllNotification isNil ifTrue:[
+        YesToAllNotification := QuerySignal new.
+    ].
+    ^ YesToAllNotification
+!
+
+yesToAllQuery
+    YesToAllQuery isNil ifTrue:[
+        YesToAllQuery := QuerySignal new.
+    ].
+    ^ YesToAllQuery
+! !
+
 !SourceCodeManagerUtilities class methodsFor:'utilities'!
 
 askForContainer:boxText title:title note:notice initialModule:initialModule initialPackage:initialPackage initialFileName:initialFileName
@@ -306,7 +323,7 @@
         #error
         (and maybe more in the future)"
 
-    |badStuff whatIsBad msg|
+    |badStuff whatIsBad msg answer|
 
     badStuff := #(
         ( #halt         'sent of #halt without descriptive message - better use halt:''some message''' )
@@ -325,12 +342,35 @@
         ].
     ].
     whatIsBad notEmpty ifTrue:[
+        (YesToAllQuery notNil and:[YesToAllQuery isHandled]) ifTrue:[
+            answer := YesToAllQuery query.
+            answer notNil ifTrue:[ ^ answer ].
+        ].
+
         msg := 'Your class contains the following  (considered bad style) message sends:\\'.
         whatIsBad do:[:each |
             msg := msg , '   ' , each , '\'
         ].
         msg := msg , '\\' , 'Do you really want to check in this class ?'.
-        ^ self confirm:msg withCRs
+        (YesToAllNotification notNil and:[YesToAllNotification isHandled]) ifTrue:[
+            answer := OptionBox 
+                          request:msg withCRs
+                          label:'Really checkIn ?'
+                          form:(InfoBox iconBitmap)
+                          buttonLabels:#('yes' 'yes to all' 'no' 'no to all')
+                          values:#(true #yesToAll false #noToAll).
+            answer == #yesToAll ifTrue:[
+                YesToAllNotification raiseWith:true.
+                ^ true
+            ].
+            answer == #noToAll ifTrue:[
+                YesToAllNotification raiseWith:false.
+                ^ false
+            ].
+            ^ answer
+        ] ifFalse:[
+            ^ self confirm:msg withCRs
+        ]
     ].
     ^ true.
 
@@ -455,7 +495,15 @@
     "check a bunch of classes into the source repository.
      If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
 
-    |classes logMessage resources|
+    ^ self
+        checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil withCheck:true
+!
+
+checkinClasses:aCollectionOfClasses withLog:aLogMessageOrNil withCheck:doCheckClasses
+    "check a bunch of classes into the source repository.
+     If the argument, aLogMessageOrNil isNil, ask interactively for log-message."
+
+    |classes logMessage resources yesOrNoToAll|
 
     "/ ignore private classes
     classes := aCollectionOfClasses select:[:aClass | aClass owningClass isNil].
@@ -469,7 +517,7 @@
         ^ self
     ].
     classes size == 1 ifTrue:[
-        ^ self checkinClass:classes first withLog:aLogMessageOrNil.
+        ^ self checkinClass:classes first withLog:aLogMessageOrNil withCheck:doCheckClasses.
     ].
 
     resources := ResourcePack for:self.
@@ -482,17 +530,26 @@
         ].
     ].
 
-    classes do:[:aClass |
-        (self checkAndWarnAboutBadMessagesInClass:aClass) ifTrue:[
-            self activityNotification:(resources string:'checking in %1' with:aClass name).
-            "/ ca does not want boxes to pop up all over ...
-            InformationSignal handle:[:ex |
-                Transcript showCR:ex errorString
-            ] do:[
-                self checkinClass:aClass withLog:logMessage
-            ].
-        ].
-    ]
+    self yesToAllNotification handle:[:ex |
+        yesOrNoToAll := ex parameter.
+        ex proceed
+    ] do:[
+        self yesToAllQuery handle:[:ex |
+            ex proceedWith:yesOrNoToAll
+        ] do:[
+            classes do:[:aClass |
+                (self checkAndWarnAboutBadMessagesInClass:aClass) ifTrue:[
+                    self activityNotification:(resources string:'checking in %1' with:aClass name).
+                    "/ ca does not want boxes to pop up all over ...
+                    InformationSignal handle:[:ex |
+                        Transcript showCR:ex errorString
+                    ] do:[
+                        self checkinClass:aClass withLog:logMessage withCheck:doCheckClasses
+                    ].
+                ].
+            ]
+        ]
+    ].
 !
 
 checkinExtensionMethods:aCollectionOfMethods forPackage:aPackageID withLog:aLogMessageOrNil
@@ -1469,5 +1526,5 @@
 !SourceCodeManagerUtilities class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.31 2000-11-14 19:11:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/SourceCodeManagerUtilities.st,v 1.32 2000-11-16 11:55:32 cg Exp $'
 ! !