Back to index

python3.2  3.2.2
Public Member Functions | Protected Attributes
MyAppDelegate Class Reference

#import <MyAppDelegate.h>

List of all members.

Public Member Functions

(id) - init
(IBAction) - showPreferences:
(BOOL- shouldShowUI
(BOOL- shouldTerminate
(void- testFileTypeBinding
(void- applicationDidFinishLaunching: [implementation]
(BOOL- applicationShouldOpenUntitledFile: [implementation]

Protected Attributes

BOOL initial_action_done
BOOL should_terminate

Detailed Description

Definition at line 5 of file MyAppDelegate.h.

Member Function Documentation

- (void) applicationDidFinishLaunching: (NSNotification *)  notification [implementation]

Definition at line 21 of file MyAppDelegate.m.

                                     :(NSNotification *)notification
    // Test that the file mappings are correct
    [self testFileTypeBinding];
    // If we were opened because of a file drag or doubleclick
    // we've set initial_action_done in shouldShowUI
    // Otherwise we open a preferences dialog.
    if (!initial_action_done) {
        initial_action_done = YES;
        [self showPreferences: self];

Here is the call graph for this function:

- (BOOL) applicationShouldOpenUntitledFile: (NSApplication *)  sender [implementation]

Definition at line 51 of file MyAppDelegate.m.

                                         :(NSApplication *)sender
    return NO;
- (id) init

Definition at line 8 of file MyAppDelegate.m.

    self = [super init];
    initial_action_done = NO;
    should_terminate = NO;
    return self;

Definition at line 34 of file MyAppDelegate.m.

    // if this call comes before applicationDidFinishLaunching: we 
    // should terminate immedeately after starting the script.
    if (!initial_action_done)
        should_terminate = YES;
    initial_action_done = YES;
    if( GetCurrentKeyModifiers() & optionKey )
        return YES;
    return NO;

Definition at line 46 of file MyAppDelegate.m.

    return should_terminate;
- (IBAction) showPreferences: (id)  sender

Definition at line 16 of file MyAppDelegate.m.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 56 of file MyAppDelegate.m.

    NSURL *ourUrl;
    OSStatus err;
    FSRef appRef;
    NSURL *appUrl;
    static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL};
    NSString **ext_p;
    int i;
    if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest"])
    ourUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] bundlePath]];
    for( ext_p = extensions; *ext_p; ext_p++ ) {
        err = LSGetApplicationForInfo(
            (CFURLRef *)&appUrl);
        if (err || ![appUrl isEqual: ourUrl] ) {
            i = NSRunAlertPanel(@"File type binding",
                @"PythonLauncher is not the default application for all " \
                  @"Python script types. You should fix this with the " \
                  @"Finder's \"Get Info\" command.\n\n" \
                  @"See \"Changing the application that opens a file\" in " \
                  @"Mac Help for details.",
                @"Don't show this warning again",
            if ( i == 0 ) { // Don't show again
                [[NSUserDefaults standardUserDefaults]
                    setObject:@"YES" forKey:@"SkipFileBindingTest"];

Here is the caller graph for this function:

Member Data Documentation

- (BOOL) initial_action_done [protected]

Definition at line 7 of file MyAppDelegate.h.

- (BOOL) should_terminate [protected]

Definition at line 8 of file MyAppDelegate.h.

The documentation for this class was generated from the following files: