Permalink
Browse files

F-Script 2.1

  • Loading branch information...
1 parent bb1724a commit 25c850c66760bcc5e69af273607e5fae7920fbe5 @pmougin pmougin committed Jun 14, 2010
Showing with 2,440 additions and 485 deletions.
  1. +32 −19 F-Script/FScriptAppController.m
  2. +1 −2 F-Script/fs_main.m
  3. +115 −71 FScript.xcodeproj/pmougin.perspectivev3
  4. +88 −84 FScript.xcodeproj/project.pbxproj
  5. +1 −1 FScriptFramework/FSCNBase.h
  6. +3 −3 FScriptFramework/{FSCNClassAddition.h → FSCNCategory.h}
  7. +5 −5 FScriptFramework/{FSCNClassAddition.m → FSCNCategory.m}
  8. +1 −1 FScriptFramework/FSCollectionInspectorView.m
  9. +17 −15 FScriptFramework/FSCompiler.m
  10. +0 −28 FScriptFramework/FSConsole.nib/classes.nib
  11. +0 −10 FScriptFramework/FSConsole.nib/data.dependency
  12. +1,039 −0 FScriptFramework/FSConsole.nib/designable.nib
  13. +0 −16 FScriptFramework/FSConsole.nib/info.nib
  14. BIN FScriptFramework/FSConsole.nib/keyedobjects.nib
  15. +76 −71 FScriptFramework/FSExecEngine.m
  16. +11 −11 FScriptFramework/FSMiscTools.m
  17. +1 −0 FScriptFramework/FSNSDictionary.h
  18. +6 −0 FScriptFramework/FSNSDictionary.m
  19. +2 −1 FScriptFramework/FSNSFileHandle.m
  20. +10 −0 FScriptFramework/FSNSMutableDictionary.h
  21. +19 −0 FScriptFramework/FSNSMutableDictionary.m
  22. +15 −3 FScriptFramework/FSNSObject.m
  23. +1 −4 FScriptFramework/FSNSValue.m
  24. +1 −1 FScriptFramework/FSObjectBrowserView.h
  25. +1 −2 FScriptFramework/FSObjectBrowserView.m
  26. +7 −31 FScriptFramework/FSObjectBrowserViewObjectInfo.m
  27. +81 −20 FScriptFramework/FSTestClasses.txt
  28. +12 −0 FScriptFramework/FSWorksWhenModalWindow.h
  29. +14 −0 FScriptFramework/FSWorksWhenModalWindow.m
  30. +1 −0 FScriptFramework/FScript.h
  31. +1 −1 FScriptFramework/FScriptMenuItem.m
  32. +0 −4 FScriptFramework/KTest.txt
  33. +1 −1 FScriptFramework/ShellView.h
  34. +8 −0 FScriptFramework/TestFS.m
  35. +863 −72 FScriptFramework/genObjInspector.nib/designable.nib
  36. BIN FScriptFramework/genObjInspector.nib/keyedobjects.nib
  37. +2 −2 FScriptFramework/license.txt
  38. +1 −1 FScriptIBPlugin/FScriptIBPlugin-Info.plist
  39. +1 −1 Info-FScriptFramework__Upgraded_.plist
  40. +2 −2 Info-F_Script__Upgraded_.plist
  41. +1 −2 JGAdditions/FSServicesProvider.m
@@ -176,7 +176,7 @@ - (void)loadSystemFrameworks // Contributed by Cedric Luthi
for (NSString *systemFrameworksPath in systemFrameworksPaths)
{
- for (NSString *framework in [[NSFileManager defaultManager] directoryContentsAtPath:systemFrameworksPath])
+ for (NSString *framework in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:systemFrameworksPath error:NULL])
{
NSBundle *frameworkBundle = [NSBundle bundleWithPath:[systemFrameworksPath stringByAppendingPathComponent:framework]];
if ([frameworkBundle preflightAndReturnError:nil])
@@ -222,33 +222,46 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
if (!repositoryPath || ![fileManager fileExistsAtPath:repositoryPath isDirectory:&b])
{
+ NSError *error = nil;
NSString *applicationSupportDirectoryPath = findPathToFileInLibraryWithinUserDomain(@"Application Support");
+ BOOL repositoryCreated = NO;
if (!applicationSupportDirectoryPath)
{
NSArray *pathArray = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
if ([pathArray count] > 0)
- [fileManager createDirectoryAtPath:[[pathArray objectAtIndex:0] stringByAppendingPathComponent:@"Application Support"] attributes:nil];
+ [fileManager createDirectoryAtPath:[[pathArray objectAtIndex:0] stringByAppendingPathComponent:@"Application Support"] withIntermediateDirectories:NO attributes:nil error:NULL];
}
applicationSupportDirectoryPath = findPathToFileInLibraryWithinUserDomain(@"Application Support");
if (applicationSupportDirectoryPath)
- {
+ {
repositoryPath = [applicationSupportDirectoryPath stringByAppendingPathComponent:@"F-Script"];
- [fileManager createDirectoryAtPath:repositoryPath attributes:nil];
- [fileManager createDirectoryAtPath:[repositoryPath stringByAppendingPathComponent:@"classes"] attributes:nil];
- if ([[NSUserDefaults standardUserDefaults] respondsToSelector:@selector(setObject:forKey:inDomain:)])
- [[NSUserDefaults standardUserDefaults] setObject:repositoryPath forKey:@"FScriptRepositoryPath" inDomain:NSGlobalDomain]; // This is an undocumented Cocoa API in Mac OS X 10.1
+
+ [fileManager createDirectoryAtPath:[repositoryPath stringByAppendingPathComponent:@"classes"] withIntermediateDirectories:YES attributes:nil error:&error];
+
+ if (error)
+ NSLog(@"Failed to create the repository: %@", error);
else
- [[NSUserDefaults standardUserDefaults] setObject:repositoryPath forKey:@"FScriptRepositoryPath"];
- [[NSUserDefaults standardUserDefaults] setObject:[repositoryPath stringByAppendingPathComponent:@"journal.txt"] forKey:@"FScriptJournalName"];
- [[NSUserDefaults standardUserDefaults] synchronize];
+ {
+ repositoryCreated = YES;
+ if ([[NSUserDefaults standardUserDefaults] respondsToSelector:@selector(setObject:forKey:inDomain:)])
+ [[NSUserDefaults standardUserDefaults] setObject:repositoryPath forKey:@"FScriptRepositoryPath" inDomain:NSGlobalDomain]; // This is an undocumented Cocoa API in Mac OS X 10.1
+ else
+ [[NSUserDefaults standardUserDefaults] setObject:repositoryPath forKey:@"FScriptRepositoryPath"];
+ [[NSUserDefaults standardUserDefaults] setObject:[repositoryPath stringByAppendingPathComponent:@"journal.txt"] forKey:@"FScriptJournalName"];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+ }
}
- else
+ else
{
NSLog(@"Failed to create the repository in the user's \"Application Support\" directory.");
+ }
+
+ if (!repositoryCreated)
+ {
NSInteger choice = NSRunAlertPanel(@"Instalation" , @"F-Script is about to create a directory named \"FScriptRepository\" in your home directory. This directory will be used as a repository for things like extension bundles for F-Script and a journal file.", @"create the repository", @"don't create the repository", @"create the repository elsewhere...");
if (choice == NSAlertOtherReturn || choice == NSAlertDefaultReturn)
@@ -265,20 +278,20 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
}
else repositoryPath = [NSHomeDirectory() stringByAppendingPathComponent:@"FScriptRepository"];
- if (repositoryPath)
+ error = nil;
+ [fileManager createDirectoryAtPath:[repositoryPath stringByAppendingPathComponent:@"classes"] withIntermediateDirectories:YES attributes:nil error:&error];
+ if (error)
+ NSLog(@"Failed to create the repository: %@", error);
+ else
{
-
+ repositoryCreated = YES;
if ([[NSUserDefaults standardUserDefaults] respondsToSelector:@selector(setObject:forKey:inDomain:)])
[[NSUserDefaults standardUserDefaults] setObject:repositoryPath forKey:@"FScriptRepositoryPath" inDomain:NSGlobalDomain]; // This is an undocumented Cocoa API in Mac OS X 10.1
else
[[NSUserDefaults standardUserDefaults] setObject:repositoryPath forKey:@"FScriptRepositoryPath"];
-
- //[[NSUserDefaults standardUserDefaults] setObject:repositoryPath forKey:@"FScriptRepositoryPath"];
- [fileManager createDirectoryAtPath:repositoryPath attributes:nil];
- [fileManager createDirectoryAtPath:[repositoryPath stringByAppendingPathComponent:@"classes"] attributes:nil];
-
[[NSUserDefaults standardUserDefaults] setObject:[repositoryPath stringByAppendingPathComponent:@"journal.txt"] forKey:@"FScriptJournalName"];
- }
+ [[NSUserDefaults standardUserDefaults] synchronize];
+ }
}
}
}
View
@@ -4,7 +4,6 @@
int main(int argc, const char **argv)
{
RestartWithCorrectGarbageCollectionSettingIfNecessary();
-
- return NSApplicationMain(argc, argv);
+ return NSApplicationMain(argc, argv);
}
Oops, something went wrong.

0 comments on commit 25c850c

Please sign in to comment.