Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

Delta Between Two Patch Sets: Mac/PythonLauncher/MyAppDelegate.m

Issue 15550: Trailing white spaces
Left Patch Set: Created 7 years, 7 months ago
Right Patch Set: Created 7 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « Mac/PythonLauncher/Makefile.in ('k') | Mac/PythonLauncher/MyDocument.m » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 #import "MyAppDelegate.h" 1 #import "MyAppDelegate.h"
2 #import "PreferencesWindowController.h" 2 #import "PreferencesWindowController.h"
3 #import <Carbon/Carbon.h> 3 #import <Carbon/Carbon.h>
4 #import <ApplicationServices/ApplicationServices.h> 4 #import <ApplicationServices/ApplicationServices.h>
5 5
6 @implementation MyAppDelegate 6 @implementation MyAppDelegate
7 7
8 - (id)init 8 - (id)init
9 { 9 {
10 self = [super init]; 10 self = [super init];
(...skipping 15 matching lines...) Expand all
26 // we've set initial_action_done in shouldShowUI 26 // we've set initial_action_done in shouldShowUI
27 // Otherwise we open a preferences dialog. 27 // Otherwise we open a preferences dialog.
28 if (!initial_action_done) { 28 if (!initial_action_done) {
29 initial_action_done = YES; 29 initial_action_done = YES;
30 [self showPreferences: self]; 30 [self showPreferences: self];
31 } 31 }
32 } 32 }
33 33
34 - (BOOL)shouldShowUI 34 - (BOOL)shouldShowUI
35 { 35 {
36 // if this call comes before applicationDidFinishLaunching: we 36 // if this call comes before applicationDidFinishLaunching: we
37 // should terminate immedeately after starting the script. 37 // should terminate immedeately after starting the script.
38 if (!initial_action_done) 38 if (!initial_action_done)
39 should_terminate = YES; 39 should_terminate = YES;
40 initial_action_done = YES; 40 initial_action_done = YES;
41 if( GetCurrentKeyModifiers() & optionKey ) 41 if( GetCurrentKeyModifiers() & optionKey )
42 return YES; 42 return YES;
43 return NO; 43 return NO;
44 } 44 }
45 45
46 - (BOOL)shouldTerminate 46 - (BOOL)shouldTerminate
47 { 47 {
48 return should_terminate; 48 return should_terminate;
49 } 49 }
50 50
51 - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender 51 - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
52 { 52 {
53 return NO; 53 return NO;
54 } 54 }
55 55
56 - (void)testFileTypeBinding 56 - (void)testFileTypeBinding
57 { 57 {
58 NSURL *ourUrl; 58 NSURL *ourUrl;
59 OSStatus err; 59 OSStatus err;
60 FSRef appRef; 60 FSRef appRef;
61 NSURL *appUrl; 61 NSURL *appUrl;
62 static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL}; 62 static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL};
63 NSString **ext_p; 63 NSString **ext_p;
64 int i; 64 int i;
65 65
66 if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest "]) 66 if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest "])
67 return; 67 return;
68 ourUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] bundlePath]]; 68 ourUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] bundlePath]];
69 for( ext_p = extensions; *ext_p; ext_p++ ) { 69 for( ext_p = extensions; *ext_p; ext_p++ ) {
70 err = LSGetApplicationForInfo( 70 err = LSGetApplicationForInfo(
71 kLSUnknownType, 71 kLSUnknownType,
72 kLSUnknownCreator, 72 kLSUnknownCreator,
73 (CFStringRef)*ext_p, 73 (CFStringRef)*ext_p,
74 kLSRolesViewer, 74 kLSRolesViewer,
75 &appRef, 75 &appRef,
76 (CFURLRef *)&appUrl); 76 (CFURLRef *)&appUrl);
77 if (err || ![appUrl isEqual: ourUrl] ) { 77 if (err || ![appUrl isEqual: ourUrl] ) {
78 i = NSRunAlertPanel(@"File type binding", 78 i = NSRunAlertPanel(@"File type binding",
79 @"PythonLauncher is not the default application for all " \ 79 @"PythonLauncher is not the default application for all " \
80 @"Python script types. You should fix this with the " \ 80 @"Python script types. You should fix this with the " \
81 @"Finder's \"Get Info\" command.\n\n" \ 81 @"Finder's \"Get Info\" command.\n\n" \
82 @"See \"Changing the application that opens a file\" in " \ 82 @"See \"Changing the application that opens a file\" in " \
83 @"Mac Help for details.", 83 @"Mac Help for details.",
84 @"OK", 84 @"OK",
85 @"Don't show this warning again", 85 @"Don't show this warning again",
86 NULL); 86 NULL);
87 if ( i == 0 ) { // Don't show again 87 if ( i == 0 ) { // Don't show again
88 [[NSUserDefaults standardUserDefaults] 88 [[NSUserDefaults standardUserDefaults]
89 setObject:@"YES" forKey:@"SkipFileBindingTest"]; 89 setObject:@"YES" forKey:@"SkipFileBindingTest"];
90 } 90 }
91 return; 91 return;
92 } 92 }
93 } 93 }
94 } 94 }
95 95
96 @end 96 @end
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+