# HG changeset patch # User Claus Gittinger # Date 1337950171 -7200 # Node ID b70be5bf20d6d40b4daccfc3bbbee782b110524d # Parent 7abc3f3c25306b9e2f8597293c90e2d4f9b19c54 changed: #allWindowsMenu added close all like this function diff -r 7abc3f3c2530 -r b70be5bf20d6 NewLauncher.st --- a/NewLauncher.st Thu May 24 16:17:43 2012 +0200 +++ b/NewLauncher.st Fri May 25 14:49:31 2012 +0200 @@ -4173,11 +4173,12 @@ allWindowsMenu "returns a subMenu with one oeprations-submenu entry per open window" - |menu| + |menu allViewsAndLabels| menu := Menu new receiver: self. - (self allTopViewsAndLabelsSortedFilteringWindowGroups:nil) do:[:assoc | - |view label submenu| + allViewsAndLabels := self allTopViewsAndLabelsSortedFilteringWindowGroups:nil. + allViewsAndLabels do:[:assoc | + |view label submenu likeThis info| view := assoc value. label := assoc key. @@ -4232,6 +4233,32 @@ value: [view destroy]; translateLabel: true). + likeThis := + allViewsAndLabels + select:[:assoc | + |otherView| + + otherView := assoc value. + otherView class == view class + and:[ otherView application class == view application class] + ] + thenCollect:[:assoc | assoc value ]. + + likeThis size > 1 ifTrue:[ + info := view application notNil + ifTrue:[ view application class name ] + ifFalse:[ view class name ]. + info := ' ("',info,'")'. + ] ifFalse:[ + info := '' + ]. + + submenu addItem:(MenuItem new + label: ('Close all like This%1' bindWith:info); + value: [likeThis do:[:eachView | eachView destroy]]; + translateLabel: true; + enabled:(likeThis size > 1)). + menu addItem:(MenuItem new label: label; submenu: submenu; @@ -4967,11 +4994,11 @@ !NewLauncher class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.433 2012-05-02 12:29:02 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.434 2012-05-25 12:49:31 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.433 2012-05-02 12:29:02 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.434 2012-05-25 12:49:31 cg Exp $' ! version_SVN