'From Squeak3.3alpha of 30 January 2002 [latest update: #4827] on 19 April 2002 at 8:48:39 am'! "Change Set: LoaderPromptFix-nk Date: 13 April 2002 Author: Ned Konz If there is a problem downloading, the download process pops up a menu. Unfortunately, this is popped up from a non-UI thread, and crashes Squeak. This fixes that problem by making the menu run in the UI thread. "! !HTTPSocket class methodsFor: 'utilities' stamp: 'nk 4/13/2002 13:00'! retry: tryBlock asking: troubleString ifGiveUp: abortActionBlock "Execute the given block. If it evaluates to true, return true. If it evaluates to false, prompt the user with the given string to see if he wants to try again. If not, evaluate the abortActionBlock and return false." | response | [tryBlock value] whileFalse: [ | sema | sema _ Semaphore new. WorldState addDeferredUIMessage: [ response _ (PopUpMenu labels: 'Retry\Give Up' withCRs) startUpWithCaption: troubleString. sema signal. ]. sema wait. response = 2 ifTrue: [abortActionBlock value. ^ false]]. ^ true ! !