diff --git a/Mac/OSX/PythonLauncher/FileSettings.h b/Mac/OSX/PythonLauncher/FileSettings.h index ea69b58bb19..80c11f1e527 100755 --- a/Mac/OSX/PythonLauncher/FileSettings.h +++ b/Mac/OSX/PythonLauncher/FileSettings.h @@ -23,6 +23,7 @@ @interface FileSettings : NSObject { NSString *interpreter; // The pathname of the interpreter to use + NSArray *interpreters; // List of known interpreters BOOL debug; // -d option: debug parser BOOL verbose; // -v option: verbose import BOOL inspect; // -i option: interactive mode after script @@ -54,5 +55,6 @@ //- (void)applyUserDefaults: (NSString *)filetype; - (void)applyValuesFromDict: (NSDictionary *)dict; - (void)reset; +- (NSArray *) interpreters; @end diff --git a/Mac/OSX/PythonLauncher/FileSettings.m b/Mac/OSX/PythonLauncher/FileSettings.m index 89772f66b99..b2961d297a8 100755 --- a/Mac/OSX/PythonLauncher/FileSettings.m +++ b/Mac/OSX/PythonLauncher/FileSettings.m @@ -104,7 +104,6 @@ int i; NSString *filename; NSDictionary *dict; - NSArray *interpreters; static NSDictionary *factorySettings; self = [super init]; @@ -163,6 +162,7 @@ fsdefaults = [FileSettings getFactorySettingsForFileType: filetype]; self = [self initWithFileSettings: fsdefaults]; if (!self) return self; + interpreters = [fsdefaults->interpreters retain]; [self applyUserDefaults: filetype]; prefskey = [filetype retain]; return self; @@ -247,9 +247,11 @@ tabs?" -t":"", others, script, - with_terminal? "&& exit" : " &"]; + with_terminal? "&& echo Exit status: $? && exit 1" : " &"]; } +- (NSArray *) interpreters { return interpreters;}; + // FileSettingsSource protocol - (NSString *) interpreter { return interpreter;}; - (BOOL) debug { return debug;}; diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib index 2a07ee11c65..43a1936d65f 100644 --- a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib +++ b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib @@ -2,7 +2,7 @@ IBClasses = ( {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { - ACTIONS = {do_apply = id; do_filetype = id; do_reset = id; }; + ACTIONS = {"do_apply" = id; "do_filetype" = id; "do_reset" = id; }; CLASS = PreferencesWindowController; LANGUAGE = ObjC; OUTLETS = { @@ -16,7 +16,7 @@ others = NSTextField; tabs = NSButton; verbose = NSButton; - with_terminal = NSButton; + "with_terminal" = NSButton; }; SUPERCLASS = NSWindowController; } diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib index 952d977cd40..f5b17b60588 100644 --- a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib +++ b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib @@ -1,16 +1,16 @@ - - + + IBDocumentLocation - 237 -80 356 240 0 0 1280 938 + 126 59 356 240 0 0 1024 746 IBFramework Version - 263.2 + 291.0 IBOpenObjects 5 IBSystem Version - 5S66 + 6G30 diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib index 8c3102db5c5..f220e5cb142 100644 Binary files a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib and b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib differ diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.h b/Mac/OSX/PythonLauncher/PreferencesWindowController.h index a2a4c74ed6e..57821c5b37c 100644 --- a/Mac/OSX/PythonLauncher/PreferencesWindowController.h +++ b/Mac/OSX/PythonLauncher/PreferencesWindowController.h @@ -29,4 +29,9 @@ - (void)controlTextDidChange:(NSNotification *)aNotification; +- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString; +- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index; +- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox; + + @end diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.m b/Mac/OSX/PythonLauncher/PreferencesWindowController.m index 79344f6a4d0..e7ddfdd7800 100644 --- a/Mac/OSX/PythonLauncher/PreferencesWindowController.m +++ b/Mac/OSX/PythonLauncher/PreferencesWindowController.m @@ -90,5 +90,21 @@ [self update_display]; }; +// NSComboBoxDataSource protocol +- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString +{ + return [[settings interpreters] indexOfObjectIdenticalTo: aString]; +} + +- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index +{ + return [[settings interpreters] objectAtIndex: index]; +} + +- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox +{ + return [[settings interpreters] count]; +} + @end diff --git a/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj b/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj index 93bd1ead6b0..2cfdaf12393 100755 --- a/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj +++ b/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj @@ -132,6 +132,7 @@ 4A9504D0FFE6A4CB11CA0CBA, 4A9504D1FFE6A4CB11CA0CBA, ); + hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 2A37F4AAFDCFA73011CA2CEA; projectDirPath = ""; @@ -169,11 +170,13 @@ refType = 4; }; 2A37F4ACFDCFA73011CA2CEA = { + fileEncoding = 30; isa = PBXFileReference; path = MyDocument.m; refType = 4; }; 2A37F4AEFDCFA73011CA2CEA = { + fileEncoding = 30; isa = PBXFileReference; path = MyDocument.h; refType = 4; @@ -190,6 +193,7 @@ refType = 4; }; 2A37F4B0FDCFA73011CA2CEA = { + fileEncoding = 30; isa = PBXFileReference; path = main.m; refType = 4; @@ -400,7 +404,6 @@ "; - shouldUseHeadermap = 1; }; 2A37F4C7FDCFA73011CA2CEA = { buildActionMask = 2147483647; @@ -515,11 +518,13 @@ //F53 //F54 F52A90CD02EB5C6A01000102 = { + fileEncoding = 30; isa = PBXFileReference; path = FileSettings.m; refType = 4; }; F52A90CE02EB5C6A01000102 = { + fileEncoding = 30; isa = PBXFileReference; path = FileSettings.h; refType = 4; @@ -581,6 +586,7 @@ }; }; F5A42167038BDD8E0110C447 = { + fileEncoding = 30; isa = PBXFileReference; path = factorySettings.plist; refType = 4; @@ -603,11 +609,13 @@ }; }; F5A4C14002F2055C01000102 = { + fileEncoding = 30; isa = PBXFileReference; path = PreferencesWindowController.h; refType = 4; }; F5A4C14102F2055C01000102 = { + fileEncoding = 30; isa = PBXFileReference; path = PreferencesWindowController.m; refType = 4; @@ -625,11 +633,13 @@ }; }; F5A4C14402F2070D01000102 = { + fileEncoding = 30; isa = PBXFileReference; path = MyAppDelegate.m; refType = 4; }; F5A4C14502F2070D01000102 = { + fileEncoding = 30; isa = PBXFileReference; path = MyAppDelegate.h; refType = 4; @@ -647,6 +657,7 @@ }; }; F5AA9C6A02F8042D0110C447 = { + fileEncoding = 30; isa = PBXFileReference; path = doscript.h; refType = 4; @@ -670,6 +681,7 @@ }; }; F5AAA21D02F8115D0110C447 = { + fileEncoding = 30; isa = PBXFileReference; path = doscript.m; refType = 4; diff --git a/Mac/OSX/PythonLauncher/factorySettings.plist b/Mac/OSX/PythonLauncher/factorySettings.plist index 5b81d7d4130..46092b5d443 100644 --- a/Mac/OSX/PythonLauncher/factorySettings.plist +++ b/Mac/OSX/PythonLauncher/factorySettings.plist @@ -39,6 +39,11 @@ /sw/bin/python /Library/Frameworks/Python.framework/Versions/Current/bin/python /usr/bin/python + /usr/local/bin/pythonw + /sw/bin/pythonw + /Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/python + /usr/bin/pythonw + /Applications/MacPython-OSX/python-additions/Python.app/Contents/MacOS/python nosite