Warning.st
changeset 24096 98fa8c26986e
parent 24023 d28afa3c1a06
--- a/Warning.st	Sat Apr 27 12:46:51 2019 +0200
+++ b/Warning.st	Tue Apr 30 13:00:22 2019 +0200
@@ -150,11 +150,35 @@
 showWarnDialog
     "open a warn box with description"
 
-    |text|
+    |maxLineLength text collectedLines|
 
+    maxLineLength := 150.
+    
     text := self description.
 
     (self suppressDialogIfUnhandled not and:[self hasDialog]) ifTrue:[
+        text := text asStringCollection.
+        (text contains:[:line | line size > maxLineLength]) ifTrue:[
+            collectedLines := StringCollection new.
+            text do:[:line |
+                |first|
+                
+                line size > maxLineLength ifTrue:[
+                    first := true.
+                    (line splitForSize:maxLineLength) do:[:eachPart |
+                        first ifTrue:[
+                            collectedLines add:eachPart.
+                            first := false.
+                        ] ifFalse:[
+                            collectedLines add:(('    >> ' withColor:Color lightGrey),eachPart)
+                        ].    
+                    ].
+                ] ifFalse:[
+                    collectedLines add:line
+                ].    
+            ].
+            text := collectedLines
+        ].    
         optionalTitle notNil ifTrue:[
             Dialog warn:text title:optionalTitle
         ] ifFalse:[    
@@ -174,7 +198,7 @@
     "
 
     "Modified: / 03-08-1999 / 14:06:41 / stefan"
-    "Modified: / 29-03-2019 / 10:55:28 / Claus Gittinger"
+    "Modified: / 30-04-2019 / 12:59:53 / Claus Gittinger"
 ! !
 
 !Warning class methodsFor:'documentation'!