BathyScapheのリンクをクリックした時に開くアプリケーションを設定するためのツール
Révision | a8ec31c293701a1cf9b0493e4aab5c6b2e72315c (tree) |
---|---|
l'heure | 2012-07-16 19:24:45 |
Auteur | masakih <masakih@user...> |
Commiter | masakih |
[Mod] Deprecatedなものをリプレース
@@ -172,19 +172,6 @@ static void bslcSwapMethod() | ||
172 | 172 | |
173 | 173 | [self notifyItemDidChange]; |
174 | 174 | } |
175 | - | |
176 | -- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo | |
177 | -{ | |
178 | - [panel orderOut:self]; | |
179 | - | |
180 | - if(NSCancelButton == returnCode) return; | |
181 | - | |
182 | - NSString *filename = [panel filename]; | |
183 | - filename = [filename lastPathComponent]; | |
184 | - filename = [filename stringByDeletingPathExtension]; | |
185 | - | |
186 | - [itemsController setValue:filename forKeyPath:@"selection.targetApplicationName"]; | |
187 | -} | |
188 | 175 | |
189 | 176 | - (void)chooseApplication:(id)sender |
190 | 177 | { |
@@ -194,14 +181,21 @@ static void bslcSwapMethod() | ||
194 | 181 | |
195 | 182 | NSOpenPanel *panel = [NSOpenPanel openPanel]; |
196 | 183 | [panel setAllowsMultipleSelection:NO]; |
197 | - | |
198 | - [panel beginSheetForDirectory:@"/Applications/" | |
199 | - file:@"" | |
200 | - types:[NSArray arrayWithObject:@"app"] | |
201 | - modalForWindow:[sender window] | |
202 | - modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) | |
203 | - contextInfo:NULL]; | |
204 | - | |
184 | + [panel setResolvesAliases:YES]; | |
185 | + [panel setDirectoryURL:[NSURL fileURLWithPath:@"/Applications/"]]; | |
186 | + [panel setAllowedFileTypes:[NSArray arrayWithObject:@"app"]]; | |
187 | + [panel beginSheetModalForWindow:[sender window] | |
188 | + completionHandler:^(NSInteger result) { | |
189 | + [panel orderOut:self]; | |
190 | + | |
191 | + if(NSCancelButton == result) return; | |
192 | + | |
193 | + NSURL *fileURL = [panel URL]; | |
194 | + NSString *filename = [fileURL lastPathComponent]; | |
195 | + filename = [filename stringByDeletingPathExtension]; | |
196 | + | |
197 | + [itemsController setValue:filename forKeyPath:@"selection.targetApplicationName"]; | |
198 | + }]; | |
205 | 199 | } |
206 | 200 | - (IBAction)menuDidChange:(id)sender |
207 | 201 | { |
@@ -19,7 +19,7 @@ | ||
19 | 19 | |
20 | 20 | NSMutableArray *items; |
21 | 21 | |
22 | - PreviewerSelector *previewSelector; | |
22 | + PreviewerSelector<PSPreviewerInterface> *previewSelector; | |
23 | 23 | NSArray *previewers; |
24 | 24 | |
25 | 25 | HMTemporaryFolder *tempFolder; |
@@ -22,6 +22,10 @@ static NSString *const BSLCSavedItemsKey = @"com.masakih.BSLinkConductor.BSLCSav | ||
22 | 22 | |
23 | 23 | BSLinkConductor* BSLinkC; |
24 | 24 | |
25 | +@interface BSLinkConductor () <NSURLDownloadDelegate> | |
26 | + | |
27 | +@end | |
28 | + | |
25 | 29 | @interface BSLinkConductor (BSLCPrivate) |
26 | 30 | - (BOOL)openLink:(NSURL *)anURL withItem:(BSLinkConductorItem *)item; |
27 | 31 |
@@ -9,7 +9,7 @@ | ||
9 | 9 | /* Begin PBXBuildFile section */ |
10 | 10 | 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; |
11 | 11 | 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; |
12 | - F4058754146AC4E3008A4304 /* CocoaOniguruma.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4058753146AC4E3008A4304 /* CocoaOniguruma.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; | |
12 | + F4058754146AC4E3008A4304 /* CocoaOniguruma.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4058753146AC4E3008A4304 /* CocoaOniguruma.framework */; settings = {ATTRIBUTES = (Required, ); }; }; | |
13 | 13 | F4A2F3FE0F43170F00A84E18 /* BSLinkConductor.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A2F3FD0F43170F00A84E18 /* BSLinkConductor.m */; }; |
14 | 14 | F4A2F4020F4317A800A84E18 /* BSLinkConductorItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A2F4010F4317A800A84E18 /* BSLinkConductorItem.m */; }; |
15 | 15 | F4A2F5880F444E3000A84E18 /* BSLinkConductor.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4A2F5860F444E3000A84E18 /* BSLinkConductor.xib */; }; |
@@ -39,7 +39,7 @@ | ||
39 | 39 | 8D5B49B6048680CD000E48DA /* BSLinkConductor.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BSLinkConductor.plugin; sourceTree = BUILT_PRODUCTS_DIR; }; |
40 | 40 | 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; |
41 | 41 | D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; }; |
42 | - F4058753146AC4E3008A4304 /* CocoaOniguruma.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaOniguruma.framework; path = "/Users/masaki/Projects/External Project/CocoaOniguruma/framework/build/Release/CocoaOniguruma.framework"; sourceTree = "<absolute>"; }; | |
42 | + F4058753146AC4E3008A4304 /* CocoaOniguruma.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaOniguruma.framework; path = /Users/masaki/Projects/ExternalProject/CocoaOniguruma/framework/build/Release/CocoaOniguruma.framework; sourceTree = "<absolute>"; }; | |
43 | 43 | F4A2F3FC0F43170F00A84E18 /* BSLinkConductor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSLinkConductor.h; sourceTree = "<group>"; }; |
44 | 44 | F4A2F3FD0F43170F00A84E18 /* BSLinkConductor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSLinkConductor.m; sourceTree = "<group>"; }; |
45 | 45 | F4A2F3FF0F43175300A84E18 /* BSImagePreviewerInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSImagePreviewerInterface.h; sourceTree = "<group>"; }; |
@@ -226,7 +226,7 @@ | ||
226 | 226 | ); |
227 | 227 | runOnlyForDeploymentPostprocessing = 0; |
228 | 228 | shellPath = /bin/sh; |
229 | - shellScript = "dest=\"/Users/masaki/Library/Application support/BathyScaphe/PlugIns/\"\nsrcname=${PRODUCT_NAME}.${WRAPPER_EXTENSION}\n\ncp -r ${CONFIGURATION_BUILD_DIR}/${srcname} \"${dest}\"\n"; | |
229 | + shellScript = "app=BathyScaphe\n\ndest=$HOME/Library/Application\\ Support/$app/PlugIns/\nsrc=$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.plugin\n\nif [ -d \"$dest/$PRODUCT_NAME.plugin\" ] ; then\nrm -fr \"$dest/$PRODUCT_NAME.plugin\"\nfi\n\necho \"Copy\"\ncp -R $src \"$dest\""; | |
230 | 230 | showEnvVarsInLog = 0; |
231 | 231 | }; |
232 | 232 | /* End PBXShellScriptBuildPhase section */ |
@@ -318,11 +318,11 @@ | ||
318 | 318 | 1DEB913F08733D840010E9CD /* Debug */ = { |
319 | 319 | isa = XCBuildConfiguration; |
320 | 320 | buildSettings = { |
321 | + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; | |
321 | 322 | GCC_OPTIMIZATION_LEVEL = 0; |
322 | 323 | GCC_WARN_ABOUT_RETURN_TYPE = YES; |
323 | 324 | GCC_WARN_UNUSED_VARIABLE = YES; |
324 | 325 | MACOSX_DEPLOYMENT_TARGET = 10.6; |
325 | - ONLY_ACTIVE_ARCH = YES; | |
326 | 326 | SDKROOT = macosx10.7; |
327 | 327 | }; |
328 | 328 | name = Debug; |
@@ -39,7 +39,7 @@ | ||
39 | 39 | _path = [tmpDir stringByAppendingPathComponent:folderName]; |
40 | 40 | |
41 | 41 | if( ![fm fileExistsAtPath:_path] && |
42 | - [fm createDirectoryAtPath:_path attributes:nil] ) { | |
42 | + [fm createDirectoryAtPath:_path withIntermediateDirectories:NO attributes:nil error:NULL]) { | |
43 | 43 | created = YES; |
44 | 44 | } |
45 | 45 | } while( !created ); |