FilenameEditField.st
changeset 4102 7dc70f1ff7aa
parent 3951 c1faa7c6d916
child 4103 41321b521425
--- a/FilenameEditField.st	Fri Jan 20 15:48:35 2012 +0100
+++ b/FilenameEditField.st	Mon Jan 23 18:24:22 2012 +0100
@@ -219,10 +219,19 @@
                         self flash.
                     ].
     newString asFilename pathName = canonContents ifTrue:[
-        self flash.
+        directory := canonContents asFilename.
+        (directory exists 
+         and:[directory isDirectory 
+         and:[directory directoryContents size = 1 ]]) ifTrue:[
+            newString := (directory construct:(directory directoryContents first)) pathName.        
+        ] ifFalse:[
+            self flash.
+        ]
     ].
 
     self contents:newString addSeparatorToDirectories:isMultiMatch not.
+
+    "Modified: / 23-01-2012 / 18:23:36 / cg"
 ! !
 
 !FilenameEditField methodsFor:'event handling'!
@@ -297,9 +306,9 @@
 !FilenameEditField class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.42 2010-10-21 13:07:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.43 2012-01-23 17:24:22 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.42 2010-10-21 13:07:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.43 2012-01-23 17:24:22 cg Exp $'
 ! !