author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 19 Jan 2012 11:46:00 +0000 | |
branch | jv |
changeset 17911 | a99f15c5efa5 |
parent 17910 | 8d796ca8bd1d |
child 18011 | deb0c3355881 |
permissions | -rw-r--r-- |
8728 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
8385 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
8386 | 14 |
Notification subclass:#YesToAllConfirmation |
8385 | 15 |
instanceVariableNames:'' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
11199 | 18 |
category:'Kernel-Exceptions-Notifications' |
8385 | 19 |
! |
20 |
||
8728 | 21 |
!YesToAllConfirmation class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
17807 | 35 |
! |
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
used with confirmation dialogs, especially from the filebrowser and compilers |
|
40 |
to up-notify that further such confirmations are not wanted by the user. |
|
41 |
" |
|
8728 | 42 |
! ! |
8385 | 43 |
|
11204
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
44 |
!YesToAllConfirmation class methodsFor:'queries'! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
45 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
46 |
notify |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
47 |
"raise a notification; usually will be remembered in a handler for the next |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
48 |
query to return true" |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
49 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
50 |
^ self raiseRequestWith:#yesToAll. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
51 |
! ! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
52 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
53 |
!YesToAllConfirmation class methodsFor:'utilities'! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
54 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
55 |
handleConfirmationIn:aBlock |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
56 |
"evaluate aBlock; |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
57 |
if inside that block, a query for YesToAll is raised, remember it and |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
58 |
answer it as required." |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
59 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
60 |
|alreadyAnswered| |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
61 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
62 |
alreadyAnswered := false. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
63 |
self handle:[:ex | |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
64 |
ex parameter == #yesToAll ifTrue:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
65 |
alreadyAnswered := true. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
66 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
67 |
ex proceedWith:alreadyAnswered |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
68 |
] do:aBlock. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
69 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
70 |
" |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
71 |
YesToAllConfirmation |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
72 |
handleConfirmationIn:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
73 |
1 to:5 do:[:i | |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
74 |
|confirmed| |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
75 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
76 |
YesToAllConfirmation query ifFalse:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
77 |
confirmed := OptionBox |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
78 |
request:(i printString) |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
79 |
label:('Ask again and again') |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
80 |
image:(YesNoBox iconBitmap) |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
81 |
buttonLabels:#('Cancel' 'No' 'Yes' 'Yes to All') |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
82 |
values:#(nil false true #yesToAll) |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
83 |
default:false |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
84 |
onCancel:false. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
85 |
confirmed == #yesToAll ifTrue:[ |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
86 |
YesToAllConfirmation notify |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
87 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
88 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
89 |
Transcript showCR:i. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
90 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
91 |
]. |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
92 |
" |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
93 |
! ! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
94 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
95 |
!YesToAllConfirmation methodsFor:'defaults'! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
96 |
|
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
97 |
defaultResumeValue |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
98 |
^ false |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
99 |
! ! |
c6c94c53df21
utility which does the ok-to-all for me
Claus Gittinger <cg@exept.de>
parents:
11199
diff
changeset
|
100 |
|
8385 | 101 |
!YesToAllConfirmation class methodsFor:'documentation'! |
102 |
||
103 |
version |
|
17892 | 104 |
^ '$Header: /cvs/stx/stx/libbasic/YesToAllConfirmation.st,v 1.6 2010/10/14 08:38:03 cg Exp $' |
17807 | 105 |
! |
106 |
||
107 |
version_CVS |
|
17845 | 108 |
^ '§Header: /cvs/stx/stx/libbasic/YesToAllConfirmation.st,v 1.6 2010/10/14 08:38:03 cg Exp §' |
17865 | 109 |
! |
110 |
||
111 |
version_SVN |
|
17911 | 112 |
^ '$Id: YesToAllConfirmation.st 10761 2012-01-19 11:46:00Z vranyj1 $' |
17846 | 113 |
! ! |
17892 | 114 |
|
17910 | 115 |
|
17911 | 116 |