401 asLoadDialog:aBoolean |
401 asLoadDialog:aBoolean |
402 viewFiles:true |
402 viewFiles:true |
403 multipleSelect:false. |
403 multipleSelect:false. |
404 |
404 |
405 enteredFileNameString := instance result. |
405 enteredFileNameString := instance result. |
406 (enteredFileNameString isEmptyOrNil) ifTrue:[ |
406 enteredFileNameString isEmptyOrNil ifTrue:[ |
407 ^ failBlock value |
407 ^ failBlock value |
408 ]. |
408 ]. |
|
409 |
409 enteredFileName := enteredFileNameString asFilename. |
410 enteredFileName := enteredFileNameString asFilename. |
410 enteredFileName isRelative ifTrue:[ |
411 enteredFileName isRelative ifTrue:[ |
411 enteredFileName := instance directory construct:enteredFileNameString |
412 (versionSymbol isNil and:[#(http https ftp) includes:(enteredFileNameString upToAll:'://')]) ifTrue:[ |
412 ]. |
413 ^ enteredFileNameString. |
413 enteredFileNameString := enteredFileName asString. |
414 ] ifFalse:[ |
414 |
415 enteredFileName := instance directory construct:enteredFileNameString. |
415 (enteredFileName notNil |
416 enteredFileNameString := enteredFileName asString. |
416 and:[enteredFileNameString notEmpty]) ifTrue:[ |
|
417 FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName). |
|
418 versionSymbol isNil ifTrue:[ ^ enteredFileNameString]. |
|
419 versionSymbol == #mustBeNew ifTrue:[ |
|
420 "/ file may not exist |
|
421 enteredFileName exists ifTrue:[^ '']. |
|
422 ]. |
417 ]. |
423 versionSymbol == #new ifTrue:[ |
418 ]. |
424 "/ file may not exist |
419 |
425 enteredFileName exists ifTrue:[ |
420 FileSelectionBox lastFileSelectionDirectory:(enteredFileName directoryName). |
426 (Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString)) |
421 |
427 ifFalse:[^ '']. |
422 versionSymbol isNil ifTrue:[ ^ enteredFileNameString]. |
428 ]. |
423 versionSymbol == #mustBeNew ifTrue:[ |
|
424 "/ file must not exist |
|
425 enteredFileName exists ifTrue:[^ failBlock value]. |
|
426 ]. |
|
427 versionSymbol == #new ifTrue:[ |
|
428 "/ file should not exist |
|
429 enteredFileName exists ifTrue:[ |
|
430 (Dialog confirm:(self classResources stringWithCRs:'''%1'' exists.\\Continue anyway ?' with:enteredFileNameString)) |
|
431 ifFalse:[^ failBlock value]. |
429 ]. |
432 ]. |
430 versionSymbol == #mustBeOld ifTrue:[ |
433 ]. |
431 enteredFileName exists ifFalse:[^ '']. |
434 versionSymbol == #mustBeOld ifTrue:[ |
|
435 "/ file must exist |
|
436 enteredFileName exists ifFalse:[^ failBlock value]. |
|
437 ]. |
|
438 versionSymbol == #old ifTrue:[ |
|
439 "/ file should exist |
|
440 enteredFileName exists ifFalse:[ |
|
441 (self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString)) |
|
442 ifFalse:[^ failBlock value]. |
432 ]. |
443 ]. |
433 versionSymbol == #old ifTrue:[ |
444 ]. |
434 "/ file may not exist |
445 |
435 enteredFileName exists ifFalse:[ |
|
436 (self confirm:(self classResources stringWithCRs:'''%1'' does not exist yet.\\Continue anyway ?' with:enteredFileNameString)) |
|
437 ifFalse:[^ '']. |
|
438 ]. |
|
439 ]. |
|
440 ]. |
|
441 ^ enteredFileNameString |
446 ^ enteredFileNameString |
442 " |
447 " |
443 FileDialog |
448 FileDialog |
444 requestFileName:'enter a fileName:' |
449 requestFileName:'enter a fileName:' |
445 default:'' |
450 default:'' |