#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Wed, 06 Apr 2016 14:20:43 +0200
changeset 16265 d6e988de171b
parent 16264 0a1ec4843fed
child 16266 7729a941a1cf
#BUGFIX by stefan class: FileDialog changed: #requestFileName:default:ok:abort:version:ifFail:pattern:fromDirectory:whenBoxCreatedEvaluate:asLoadDialog: do not prepend directory to http[s] urls (needed for expecco WSDL plugin)
FileDialog.st
--- a/FileDialog.st	Tue Apr 05 18:04:37 2016 +0200
+++ b/FileDialog.st	Wed Apr 06 14:20:43 2016 +0200
@@ -403,41 +403,46 @@
         multipleSelect:false.
 
     enteredFileNameString := instance result.
-    (enteredFileNameString isEmptyOrNil) ifTrue:[
+    enteredFileNameString isEmptyOrNil ifTrue:[
         ^ failBlock value
     ].
+
     enteredFileName := enteredFileNameString asFilename.
     enteredFileName isRelative ifTrue:[
-        enteredFileName := instance directory construct:enteredFileNameString
-    ].
-    enteredFileNameString := enteredFileName asString.
-
-    (enteredFileName notNil 
-    and:[enteredFileNameString notEmpty]) ifTrue:[
-        FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName).
-        versionSymbol isNil ifTrue:[ ^ enteredFileNameString].
-        versionSymbol == #mustBeNew ifTrue:[
-            "/ file may not exist
-            enteredFileName exists ifTrue:[^ ''].
-        ].
-        versionSymbol == #new ifTrue:[
-            "/ file may not exist
-            enteredFileName exists ifTrue:[
-                (Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString))
-                    ifFalse:[^ ''].
-            ].
-        ].
-        versionSymbol == #mustBeOld ifTrue:[
-            enteredFileName exists ifFalse:[^ ''].
-        ].
-        versionSymbol == #old ifTrue:[
-            "/ file may not exist
-            enteredFileName exists ifFalse:[
-                (self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString))
-                ifFalse:[^ ''].
-            ].
+        (versionSymbol isNil and:[#(http https ftp) includes:(enteredFileNameString upToAll:'://')]) ifTrue:[
+            ^ enteredFileNameString.
+        ] ifFalse:[
+            enteredFileName := instance directory construct:enteredFileNameString.
+            enteredFileNameString := enteredFileName asString.
         ].
     ].
+
+    FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName).
+
+    versionSymbol isNil ifTrue:[ ^ enteredFileNameString].
+    versionSymbol == #mustBeNew ifTrue:[
+        "/ file must not exist
+        enteredFileName exists ifTrue:[^ failBlock value].
+    ].
+    versionSymbol == #new ifTrue:[
+        "/ file should not exist
+        enteredFileName exists ifTrue:[
+            (Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString))
+                ifFalse:[^ failBlock value].
+        ].
+    ].
+    versionSymbol == #mustBeOld ifTrue:[
+        "/ file must exist
+        enteredFileName exists ifFalse:[^ failBlock value].
+    ].
+    versionSymbol == #old ifTrue:[
+        "/ file should exist
+        enteredFileName exists ifFalse:[
+            (self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString))
+            ifFalse:[^ failBlock value].
+        ].
+    ].
+
     ^ enteredFileNameString
 "
      FileDialog