<div dir="ltr"><div><div>That worked for me, maybe not for the others, because '-- all --' category is empty but still there...<br></div>There is no clean-up of empty categories on MC load/merge.<br><br></div>Either we force Smalltalk removeEmptyMessageCategories in some script, or change MC to care of it at package level?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-26 23:18 GMT+01:00 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/MorphicExtras-nice.218.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>trunk/MorphicExtras-nice.218.<wbr>mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: MorphicExtras-nice.218<br>
Author: nice<br>
Time: 26 November 2017, 11:17:28.596315 pm<br>
UUID: c781b24f-85b2-4fca-941a-<wbr>dd8c2852a640<br>
Ancestors: MorphicExtras-dtl.217<br>
<br>
Change fancy categorization of FancyMailComposition methods.<br>
<br>
My arbitrary categorization might be less than perfect, but at least this makes testNoSpecialCategories pass.<br>
<br>
=============== Diff against MorphicExtras-dtl.217 ===============<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>addAttachment (in category 'actions') -----<br>
- ----- Method: FancyMailComposition>><wbr>addAttachment (in category '-- all --') -----<br>
addAttachment<br>
| file fileResult fileName |<br>
textEditor<br>
ifNotNil: [self hasUnacceptedEdits ifTrue: [textEditor accept]].<br>
<br>
(fileResult := StandardFileMenu oldFile)<br>
ifNotNil:<br>
[fileName := fileResult directory fullNameFor: fileResult name.<br>
file := FileStream readOnlyFileNamed: fileName.<br>
file ifNotNil:<br>
[file binary.<br>
self messageText:<br>
((MailMessage from: self messageText asString)<br>
addAttachmentFrom: file withName: fileResult name; text).<br>
file close]] !<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>breakLines:atWidth: (in category 'private') -----<br>
- ----- Method: FancyMailComposition>><wbr>breakLines:atWidth: (in category '-- all --') -----<br>
breakLines: aString atWidth: width<br>
"break lines in the given string into shorter lines"<br>
| result atAttachment |<br>
<br>
result := WriteStream on: (String new: (aString size * 50 // 49)).<br>
<br>
atAttachment := false.<br>
aString asString linesDo: [ :line | | start end |<br>
(line beginsWith: '====') ifTrue: [ atAttachment := true ].<br>
atAttachment ifTrue: [<br>
"at or after an attachment line; no more wrapping for the rest of the message"<br>
result nextPutAll: line. result cr ]<br>
ifFalse: [<br>
(line beginsWith: '>') ifTrue: [<br>
"it's quoted text; don't wrap it"<br>
result nextPutAll: line. result cr. ]<br>
ifFalse: [<br>
"regular old line. Wrap it to multiple lines"<br>
start := 1.<br>
"output one shorter line each time through this loop"<br>
[ start + width <= line size ] whileTrue: [<br>
<br>
"find the end of the line"<br>
end := start + width - 1.<br>
[end >= start and: [ (line at: (end+1)) isSeparator not ]] whileTrue: [<br>
end := end - 1 ].<br>
end < start ifTrue: [<br>
"a word spans the entire width!!"<br>
end := start + width - 1 ].<br>
<br>
"copy the line to the output"<br>
result nextPutAll: (line copyFrom: start to: end).<br>
result cr.<br>
<br>
"get ready for next iteration"<br>
start := end+1.<br>
(line at: start) isSeparator ifTrue: [ start := start + 1 ].<br>
].<br>
<br>
"write out the final part of the line"<br>
result nextPutAll: (line copyFrom: start to: line size).<br>
result cr.<br>
].<br>
].<br>
].<br>
<br>
^result contents!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>breakLinesInMessage: (in category 'private') -----<br>
- ----- Method: FancyMailComposition>><wbr>breakLinesInMessage: (in category '-- all --') -----<br>
breakLinesInMessage: message<br>
"reformat long lines in the specified message into shorter ones"<br>
self flag: #TODO. "Maybe deprecated"<br>
message body mainType = 'text' ifTrue: [<br>
"it's a single-part text message. reformat the text"<br>
| newBodyText |<br>
newBodyText := self breakLines: message bodyText atWidth: 72.<br>
message body: (MIMEDocument contentType: message body contentType content: newBodyText).<br>
<br>
^self ].<br>
<br>
message body isMultipart ifTrue: [<br>
"multipart message; process the top-level parts. HACK: the parts are modified in place"<br>
message parts do: [ :part |<br>
part body mainType = 'text' ifTrue: [<br>
| newBodyText |<br>
newBodyText := self breakLines: part bodyText atWidth: 72.<br>
part body: (MIMEDocument contentType: part body contentType content: newBodyText) ] ].<br>
message regenerateBodyFromParts. ].!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>menuGet:<wbr>shifted: (in category 'interface') -----<br>
- ----- Method: FancyMailComposition>>menuGet:<wbr>shifted: (in category '-- all --') -----<br>
menuGet: aMenu shifted: shifted<br>
<br>
aMenu addList: {<br>
{'find...(f)' translated. #find}.<br>
{'find selection again (g)' translated. #findAgain}.<br>
#-.<br>
{'accept (s)' translated. #accept}.<br>
{'send message' translated. #submit}}.<br>
<br>
^aMenu.!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>messageText (in category 'accessing') -----<br>
- ----- Method: FancyMailComposition>><wbr>messageText (in category '-- all --') -----<br>
messageText<br>
"return the current text"<br>
^messageText.<br>
!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>messageText: (in category 'accessing') -----<br>
- ----- Method: FancyMailComposition>><wbr>messageText: (in category '-- all --') -----<br>
messageText: aText<br>
"change the current text"<br>
messageText := aText.<br>
self changed: #messageText.<br>
^true!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>morphicOpen (in category 'user interface') -----<br>
- ----- Method: FancyMailComposition>><wbr>morphicOpen (in category '-- all --') -----<br>
morphicOpen<br>
"open an interface for sending a mail message with the given initial<br>
text "<br>
| textMorph buttonsList sendButton attachmentButton |<br>
morphicWindow := SystemWindow labelled: 'Mister Postman'.<br>
morphicWindow model: self.<br>
textEditor := textMorph := PluggableTextMorph<br>
on: self<br>
text: #messageText<br>
accept: #messageText:<br>
readSelection: nil<br>
menu: #menuGet:shifted:.<br>
morphicWindow addMorph: textMorph frame: (0 @ 0.1 corner: 1 @ 1).<br>
buttonsList := AlignmentMorph newRow.<br>
sendButton := PluggableButtonMorph<br>
on: self<br>
getState: nil<br>
action: #submit.<br>
sendButton<br>
hResizing: #spaceFill;<br>
vResizing: #spaceFill;<br>
label: 'send message';<br>
setBalloonText: 'Accept any unaccepted edits and add this to the queue of messages to be sent';<br>
onColor: Color white offColor: Color white.<br>
buttonsList addMorphBack: sendButton.<br>
<br>
attachmentButton := PluggableButtonMorph<br>
on: self<br>
getState: nil<br>
action: #addAttachment.<br>
attachmentButton<br>
hResizing: #spaceFill;<br>
vResizing: #spaceFill;<br>
label: 'add attachment';<br>
setBalloonText: 'Send a file with the message';<br>
onColor: Color white offColor: Color white.<br>
buttonsList addMorphBack: attachmentButton.<br>
<br>
morphicWindow addMorph: buttonsList frame: (0 @ 0 extent: 1 @ 0.1).<br>
morphicWindow openInWorld!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>mvcOpen (in category 'user interface') -----<br>
- ----- Method: FancyMailComposition>>mvcOpen (in category '-- all --') -----<br>
mvcOpen<br>
| textView sendButton |<br>
<br>
mvcWindow := StandardSystemView new<br>
label: 'Mister Postman';<br>
minimumSize: 400@250;<br>
model: self.<br>
<br>
textView := PluggableTextView<br>
on: self<br>
text: #messageText<br>
accept: #messageText:.<br>
textEditor := textView controller.<br>
<br>
sendButton := PluggableButtonView<br>
on: self<br>
getState: nil<br>
action: #submit.<br>
sendButton label: 'Send'.<br>
sendButton borderWidth: 1.<br>
<br>
sendButton window: (1@1 extent: 398@38).<br>
mvcWindow addSubView: sendButton.<br>
<br>
textView window: (0@40 corner: 400@250).<br>
mvcWindow addSubView: textView below: sendButton.<br>
<br>
mvcWindow controller open.<br>
<br>
<br>
!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>open (in category 'user interface') -----<br>
- ----- Method: FancyMailComposition>>open (in category '-- all --') -----<br>
open<br>
"open an interface"<br>
<br>
^ Project current<br>
dispatchTo: self<br>
addPrefixAndSend: #Open<br>
withArguments: {}<br>
!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>perform:<wbr>orSendTo: (in category 'private') -----<br>
- ----- Method: FancyMailComposition>>perform:<wbr>orSendTo: (in category '-- all --') -----<br>
perform: selector orSendTo: otherTarget<br>
<br>
(self respondsTo: selector)<br>
ifTrue: [^self perform: selector]<br>
ifFalse: [^otherTarget perform: selector]<br>
<br>
!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>sendMailMessage: (in category 'MailSender interface') -----<br>
- ----- Method: FancyMailComposition>><wbr>sendMailMessage: (in category '-- all --') -----<br>
sendMailMessage: aMailMessage<br>
self messageText: aMailMessage text!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>><wbr>smtpServer (in category 'MailSender interface') -----<br>
- ----- Method: FancyMailComposition>><wbr>smtpServer (in category '-- all --') -----<br>
smtpServer<br>
^MailSender smtpServer!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>subject (in category 'accessing') -----<br>
- ----- Method: FancyMailComposition>>subject (in category 'access') -----<br>
subject<br>
<br>
^ subject<br>
<br>
!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>subject: (in category 'accessing') -----<br>
- ----- Method: FancyMailComposition>>subject: (in category 'access') -----<br>
subject: x<br>
<br>
subject := x.<br>
self changed: #subject.<br>
^true!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>to (in category 'accessing') -----<br>
- ----- Method: FancyMailComposition>>to (in category 'access') -----<br>
to<br>
<br>
^to!<br>
<br>
Item was changed:<br>
+ ----- Method: FancyMailComposition>>to: (in category 'accessing') -----<br>
- ----- Method: FancyMailComposition>>to: (in category 'access') -----<br>
to: x<br>
<br>
to := x.<br>
self changed: #to.<br>
^true<br>
!<br>
<br>
<br>
</blockquote></div><br></div>