Changeset 391 for python/trunk/Mac/PythonLauncher/MyDocument.m
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Mac/PythonLauncher/MyDocument.m
r2 r391 17 17 self = [super init]; 18 18 if (self) { 19 19 20 20 // Add your subclass-specific initialization here. 21 21 // If an error occurs here, send a [self dealloc] message and return nil. … … 38 38 NSApplication *app = [NSApplication sharedApplication]; 39 39 [super close]; 40 if ([ [app delegate] shouldTerminate])40 if ([(MyAppDelegate*)[app delegate] shouldTerminate]) 41 41 [app terminate: self]; 42 42 } … … 44 44 - (void)load_defaults 45 45 { 46 // if (settings) [settings release];47 46 settings = [FileSettings newSettingsForFileType: filetype]; 48 47 } … … 50 49 - (void)update_display 51 50 { 52 // [[self window] setTitle: script];53 54 51 [interpreter setStringValue: [settings interpreter]]; 55 52 [honourhashbang setState: [settings honourhashbang]]; … … 63 60 [scriptargs setStringValue: [settings scriptargs]]; 64 61 [with_terminal setState: [settings with_terminal]]; 65 62 66 63 [commandline setStringValue: [settings commandLineForScript: script]]; 67 64 } … … 76 73 const char *cmdline; 77 74 int sts; 78 79 cmdline = [[settings commandLineForScript: script] cString];75 76 cmdline = [[settings commandLineForScript: script] UTF8String]; 80 77 if ([settings with_terminal]) { 81 78 sts = doscript(cmdline); … … 108 105 // Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofType: instead. 109 106 BOOL show_ui; 110 111 // ask the app delegate whether we should show the UI or not. 112 show_ui = [ [[NSApplication sharedApplication] delegate] shouldShowUI];107 108 // ask the app delegate whether we should show the UI or not. 109 show_ui = [(MyAppDelegate*)[[NSApplication sharedApplication] delegate] shouldShowUI]; 113 110 [script release]; 114 111 script = [fileName retain]; 115 112 [filetype release]; 116 113 filetype = [type retain]; 117 // if (settings) [settings release];118 114 settings = [FileSettings newSettingsForFileType: filetype]; 119 115 if (show_ui) { … … 153 149 } 154 150 155 // FileSettingsSource protocol 151 // FileSettingsSource protocol 156 152 - (NSString *) interpreter { return [interpreter stringValue];}; 157 153 - (BOOL) honourhashbang { return [honourhashbang state];};
Note:
See TracChangeset
for help on using the changeset viewer.