From f044e090c4c8aeed0480fc56fec01e651d811680 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Thu, 26 Dec 2002 22:10:53 +0000 Subject: [PATCH] Changed the input field for the interpreter to use (in the preferences window) to a combobox listing the known interpreters. --- Mac/OSX/PythonLauncher/FileSettings.h | 2 ++ Mac/OSX/PythonLauncher/FileSettings.m | 6 ++++-- .../PreferenceWindow.nib/classes.nib | 4 ++-- .../PreferenceWindow.nib/info.nib | 10 +++++----- .../PreferenceWindow.nib/objects.nib | Bin 4920 -> 7678 bytes .../PreferencesWindowController.h | 5 +++++ .../PreferencesWindowController.m | 16 ++++++++++++++++ .../PythonLauncher.pbproj/project.pbxproj | 14 +++++++++++++- Mac/OSX/PythonLauncher/factorySettings.plist | 5 +++++ 9 files changed, 52 insertions(+), 10 deletions(-) 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 8c3102db5c5a4ac799a68c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Y7vq;Jku2@0W3QOM|KzAEP7e2K(ymm3 z%E%!=FKGfT2>RG>Q|YUS@9KSgcdVy9kMXV*@f}J2KKb$QV7y;1V|w0aYVk8$Y}4gL zlxn845-&8*N%u+4UC6ofIRv$U`#i|oO`|ataGxdoZxrySf|$l@(sE^mYzg~4?~TNU z!13ebH6@rC!31E9E=i-R0}iS}$mC>_f?b7Dz^$u@Re60vxNVVdEn=mTFi6MT`x$pG z=T@iP$&5RdaqmvKSJQ50tvj7@18MhO#(k7?XEN?=#?8&T*^IlGb06khmT@0s+{d}} zRyPfL*Kj0y5~{&*pTIMKy8?h}Y;@fFxFSJOkeL(B1(c+yerj)B@8!$6YAf zbI@_;$_V=%w;Bk5@$zsNc(On#)x8gNj{&XrC_uEA;$r8Z2A2tU3P>=@04X)%>F&ZK zcnkk|1eY5-LLEwPXTnq|03S_*E1zyyVvUVX{E-ck8;^t;BHk1Rcgq-qr(?b$7oAcR0#Hwj@RpstTA9at!3{%Rbx> z+qQ@L^+9ov?}8DQP-$G0fWw=~G%Q98J?ia$g!^CU)YM_|SV9Tw;-H>T!yMksbNY0)uNKz4{&&QJVs?DqR7Ccn2Mw-?@7F&dW>_(`0^=ffQo$-QW-Rd3lmk0 zt4d$L3HHUK62CQbKP@27-Zov-bQ5M4_7{YPy#Oi1s4@gYi=R{K1mSA`Mx_ynwjYP??I?aHTNVXam)bQI475XUQ&N2=&$AY+#aXgUG`pLY)B z={^+kX_$fm9ltE#Rs$b)o+|h@A^(hJwi?m|(VowQ4XqB4aQ`Jg1yo$H?dN!jK!)QN z7llNJ8rhqj?wURCUb^Ic?KyK zQ-^&i50@i8UXD1o9C3a*;=*@{`?A7TOuZ?Jo>v#C9-vy&YBDI^z* 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