AbstractSettingsApplication.st
changeset 9057 94c1b8977ab3
parent 9041 37b016f28530
child 9067 3d6f7b88f4da
--- a/AbstractSettingsApplication.st	Thu Oct 22 21:12:06 2009 +0200
+++ b/AbstractSettingsApplication.st	Fri Oct 23 11:05:31 2009 +0200
@@ -13084,32 +13084,63 @@
 !
 
 sourceDirChanged
-    | nm fn|
+    |nm fn previousDir|
 
     manager isNil ifTrue:[^ self].
 
+    previousDir := AbstractSourceCodeManager cacheDirectoryName.
+
     nm := self sourceCacheDir value.
     nm isEmptyOrNil ifTrue:[^ self].
 
     (fn := nm asFilename) exists ifFalse:[
-        (self confirm:('SourceCache directory ''' , nm , ''' does not exist.\Create ?' withCRs)) ifTrue:[
-            fn recursiveMakeDirectory; 
-               makeReadableForAll;
-               makeWritableForAll;
-               makeExecutableForAll.
-        ] ifFalse:[
-            self sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName).
+        (self confirm:(resources 
+                            stringWithCRs:'SourceCache directory "%1" does not exist.\Create ?'
+                            with:nm)
+        ) ifFalse:[
+            self sourceCacheDir value:previousDir.
             ^ self.
         ].
-    ].
-    (fn isDirectory
-    and:[fn isReadable
-    and:[fn isWritable]]) ifTrue:[
-        AbstractSourceCodeManager cacheDirectoryName:nm.
-    ] ifFalse:[
-        self warn:'Invalid sourceCache directory.'.
-        self sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName).
-    ].
+        fn 
+            recursiveMakeDirectory; 
+            makeReadableForAll;
+            makeWritableForAll;
+            makeExecutableForAll.
+        ^ self.
+    ].
+
+    (fn isDirectory) ifFalse:[
+        self warn:(resources 
+                            stringWithCRs:'Not a directory: "%1"'
+                            with:nm).
+        self sourceCacheDir value:previousDir.
+        ^ self.
+    ].
+
+    (fn isReadable and:[fn isWritable]) ifFalse:[
+        (self confirm:(resources 
+                            stringWithCRs:'SourceCache directory "%1" is not both readable and writable.\Change ?'
+                            with:nm)
+        ) ifFalse:[
+            self sourceCacheDir value:previousDir.
+            ^ self.
+        ].
+        fn
+            makeReadableForAll;
+            makeWritableForAll;
+            makeExecutableForAll.
+    ].
+"/    (fn isReadableForAll and:[fn isWritableForAll]) ifFalse:[
+"/        (self confirm:(resources 
+"/                            stringWithCRs:'SourceCache directory "%1" is not both readable and writable for other users.\Change ?'
+"/                            with:nm)
+"/        ) ifTrue:[
+"/            fn
+"/                makeReadableForAll;
+"/                makeWritableForAll;
+"/                makeExecutableForAll.
+"/        ]
+"/    ].
 !
 
 update:something with:aParameter from:changedObject 
@@ -13271,7 +13302,7 @@
     (self hasManager and:[self useManager value]) ifFalse:[^ false].
 
     (Class tryLocalSourceFirst ~= self localSourceFirst value) ifTrue:[^ true].
-    ((AbstractSourceCodeManager cacheDirectoryName ? '') ~= (self sourceCacheDir value ? '')) ifTrue:[^ true].
+    ((self selectedManager cacheDirectoryName ? '') ~= (self sourceCacheDir value ? '')) ifTrue:[^ true].
 
     ((currentUserPrefs at:#checkClassesWhenCheckingIn ifAbsent:true) ~= self checkClassesWhenCheckingIn value)  
         ifTrue:[^ true].
@@ -15353,9 +15384,9 @@
 !AbstractSettingsApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.333 2009-10-22 12:44:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.334 2009-10-23 09:05:31 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.333 2009-10-22 12:44:10 cg Exp $'
-! !
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.334 2009-10-23 09:05:31 cg Exp $'
+! !