# HG changeset patch # User Claus Gittinger # Date 1323096009 -3600 # Node ID 10f8ee0f23fef40261b04f729b7cd1373cd02e9f # Parent 2600408a8005fb96f4ecdc0c1f819c59a9729bfd changed: #doLoadFromURL diff -r 2600408a8005 -r 10f8ee0f23fe ImageEditor.st --- a/ImageEditor.st Mon Dec 05 03:22:12 2011 +0100 +++ b/ImageEditor.st Mon Dec 05 15:40:09 2011 +0100 @@ -6300,19 +6300,25 @@ doLoadFromURL "opens a dialog for loading an image from a URL" - |tempFile url| + |tempFile url response| self checkModified ifFalse:[ ^ self ]. url := Dialog - request:'Load Image from URL' + request:(resources string:'Load Image from URL') initialAnswer:LastURL. url notEmptyOrNil ifTrue:[ LastURL := url. tempFile := Filename newTemporary. - HTTPInterface get:url destinationFile:tempFile. - self loadFromFile:tempFile. + self withWaitCursorDo:[ + response := HTTPInterface get:url destinationFile:tempFile. + ]. + response isErrorResponse ifTrue:[ + Dialog warn:(resources string:'Could not load image ("%1")' with:response responseText). + ] ifFalse:[ + self loadFromFile:tempFile. + ]. tempFile delete ]