diff --git a/Application/AppController.m b/Application/AppController.m index 633a2d19f..f89e502b0 100644 --- a/Application/AppController.m +++ b/Application/AppController.m @@ -15,6 +15,8 @@ #import "PathNode.h" #import +#import "SandboxBroker.h" + #import "Logging.h" #import "MiniModeMenuTitleTransformer.h" #import "DualWindow.h" @@ -72,13 +74,15 @@ void* kAppControllerContext = &kAppControllerContext; [p setResolvesAliases:YES]; [p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) { + [p close]; + [NSApp stopModal]; if ( result == NSModalResponseOK ) { [self->playlistLoader willInsertURLs:[p URLs] origin:URLOriginInternal]; [self->playlistLoader didInsertURLs:[self->playlistLoader addURLs:[p URLs] sort:YES] origin:URLOriginInternal]; - } else { - [p close]; } }]; + + [NSApp runModalForWindow:[NSApp mainWindow]]; } - (IBAction)savePlaylist:(id)sender @@ -143,6 +147,12 @@ void* kAppControllerContext = &kAppControllerContext; [self registerHotKeys]; (void) [spotlightWindowController init]; + + SandboxBroker * sandboxBroker = [SandboxBroker sharedSandboxBroker]; + if (!sandboxBroker) + { + ALog("sandbox init failed"); + } [[playlistController undoManager] disableUndoRegistration]; NSString *basePath = [@"~/Library/Application Support/Cog/" stringByExpandingTildeInPath]; @@ -355,6 +365,9 @@ void* kAppControllerContext = &kAppControllerContext; NSError *error; [[NSFileManager defaultManager] removeItemAtPath:[folder stringByAppendingPathComponent:fileName] error:&error]; + + DLog(@"Saving bookmarks for sandbox access"); + [[SandboxBroker sharedSandboxBroker] shutdown]; DLog(@"Saving expanded nodes: %@", [expandedNodes description]); @@ -387,10 +400,11 @@ void* kAppControllerContext = &kAppControllerContext; { //Need to convert to urls NSMutableArray *urls = [NSMutableArray array]; - + for (NSString *filename in filenames) { - [urls addObject:[NSURL fileURLWithPath:filename]]; + NSURL * fileUrl = [NSURL fileURLWithPath:filename]; + [urls addObject:fileUrl]; } [playlistLoader willInsertURLs:urls origin:URLOriginExternal]; [playlistLoader didInsertURLs:[playlistLoader addURLs:urls sort:YES] origin:URLOriginExternal]; diff --git a/Audio/CogAudio.xcodeproj/project.pbxproj b/Audio/CogAudio.xcodeproj/project.pbxproj index 0dde09b5b..d0a7fc3d6 100644 --- a/Audio/CogAudio.xcodeproj/project.pbxproj +++ b/Audio/CogAudio.xcodeproj/project.pbxproj @@ -366,6 +366,7 @@ TargetAttributes = { 8DC2EF4F0486A6940098B216 = { DevelopmentTeam = ""; + LastSwiftMigration = 1240; ProvisioningStyle = Automatic; }; }; @@ -431,10 +432,12 @@ 1DEB91AE08733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; + DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -448,12 +451,15 @@ GCC_PREFIX_HEADER = CogAudio_Prefix.pch; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = org.cogx.cogaudio; PRODUCT_NAME = CogAudio; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; WARNING_LDFLAGS = ""; WRAPPER_EXTENSION = framework; ZERO_LINK = YES; @@ -463,9 +469,11 @@ 1DEB91AF08733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -477,12 +485,14 @@ GCC_PREFIX_HEADER = CogAudio_Prefix.pch; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = org.cogx.cogaudio; PRODUCT_NAME = CogAudio; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; WARNING_LDFLAGS = ""; WRAPPER_EXTENSION = framework; }; diff --git a/Base.lproj/MainMenu.xib b/Base.lproj/MainMenu.xib index 7ce9fb503..1221ab157 100644 --- a/Base.lproj/MainMenu.xib +++ b/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -18,7 +18,7 @@ - + @@ -565,7 +565,7 @@ - +