]> granicus.if.org Git - python/commitdiff
Changed the input field for the interpreter to use (in the preferences
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 26 Dec 2002 22:10:53 +0000 (22:10 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 26 Dec 2002 22:10:53 +0000 (22:10 +0000)
window) to a combobox listing the known interpreters.

Mac/OSX/PythonLauncher/FileSettings.h
Mac/OSX/PythonLauncher/FileSettings.m
Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib
Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib
Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib
Mac/OSX/PythonLauncher/PreferencesWindowController.h
Mac/OSX/PythonLauncher/PreferencesWindowController.m
Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj
Mac/OSX/PythonLauncher/factorySettings.plist

index ea69b58bb19201d41f5d0ab986d0172170e53b19..80c11f1e5274738d982c4d0d1c14646573747a77 100755 (executable)
@@ -23,6 +23,7 @@
 @interface FileSettings : NSObject <FileSettingsSource>
 {
     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
index 89772f66b9929b59257d8e7a29f17519ebf941c8..b2961d297a8e3b02fbe8d3f2a986d0e7f54d3b38 100755 (executable)
     int i;
     NSString *filename;
     NSDictionary *dict;
-    NSArray *interpreters;
     static NSDictionary *factorySettings;
     
     self = [super init];
     fsdefaults = [FileSettings getFactorySettingsForFileType: filetype];
     self = [self initWithFileSettings: fsdefaults];
     if (!self) return self;
+    interpreters = [fsdefaults->interpreters retain];
     [self applyUserDefaults: filetype];
     prefskey = [filetype retain];
     return self;
         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;};
index 2a07ee11c65f0aa23650d837754fd2ff7b732a41..43a1936d65faba28dacffdd5f9a45622fe6446d7 100644 (file)
@@ -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; 
         }
index 952d977cd40c7922c4b3e4f08a1f5f8e6494b162..f5b17b60588b267622d1dae0386e528df8ad2cba 100644 (file)
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>237 -80 356 240 0 0 1280 938 </string>
+       <string>126 59 356 240 0 0 1024 746 </string>
        <key>IBFramework Version</key>
-       <string>263.2</string>
+       <string>291.0</string>
        <key>IBOpenObjects</key>
        <array>
                <integer>5</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>5S66</string>
+       <string>6G30</string>
 </dict>
 </plist>
index 8c3102db5c5a4ac799a68c181fba1153de16a872..f220e5cb142f106a1ba026f0a01d2fd7ecd4cb26 100644 (file)
Binary files a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib and b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib differ
index a2a4c74ed6e756d2f5124e4bfc0024872d53d575..57821c5b37c4fff7dbf71c1f8133dbe9ac96695a 100644 (file)
@@ -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
index 79344f6a4d04eafc955528f7638e8d4f91223072..e7ddfdd7800ac35041b5f489dc7349c566408978 100644 (file)
     [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
index 93bd1ead6b0ba29b641bdacd19d0cdfba06511de..2cfdaf1239301cd131d5483756a0fc1a5e00f55c 100755 (executable)
                                4A9504D0FFE6A4CB11CA0CBA,
                                4A9504D1FFE6A4CB11CA0CBA,
                        );
+                       hasScannedForEncodings = 1;
                        isa = PBXProject;
                        mainGroup = 2A37F4AAFDCFA73011CA2CEA;
                        projectDirPath = "";
                        refType = 4;
                };
                2A37F4ACFDCFA73011CA2CEA = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = MyDocument.m;
                        refType = 4;
                };
                2A37F4AEFDCFA73011CA2CEA = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = MyDocument.h;
                        refType = 4;
                        refType = 4;
                };
                2A37F4B0FDCFA73011CA2CEA = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = main.m;
                        refType = 4;
 </dict>
 </plist>
 ";
-                       shouldUseHeadermap = 1;
                };
                2A37F4C7FDCFA73011CA2CEA = {
                        buildActionMask = 2147483647;
 //F53
 //F54
                F52A90CD02EB5C6A01000102 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = FileSettings.m;
                        refType = 4;
                };
                F52A90CE02EB5C6A01000102 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = FileSettings.h;
                        refType = 4;
                        };
                };
                F5A42167038BDD8E0110C447 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = factorySettings.plist;
                        refType = 4;
                        };
                };
                F5A4C14002F2055C01000102 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = PreferencesWindowController.h;
                        refType = 4;
                };
                F5A4C14102F2055C01000102 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = PreferencesWindowController.m;
                        refType = 4;
                        };
                };
                F5A4C14402F2070D01000102 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = MyAppDelegate.m;
                        refType = 4;
                };
                F5A4C14502F2070D01000102 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = MyAppDelegate.h;
                        refType = 4;
                        };
                };
                F5AA9C6A02F8042D0110C447 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = doscript.h;
                        refType = 4;
                        };
                };
                F5AAA21D02F8115D0110C447 = {
+                       fileEncoding = 30;
                        isa = PBXFileReference;
                        path = doscript.m;
                        refType = 4;
index 5b81d7d4130bd00c2686d945cf4dafac2bd8fee6..46092b5d443f61f3f5a7be991bd09ffbbd2dffe8 100644 (file)
                     <string>/sw/bin/python</string>
                     <string>/Library/Frameworks/Python.framework/Versions/Current/bin/python</string>
                     <string>/usr/bin/python</string>
+                    <string>/usr/local/bin/pythonw</string>
+                    <string>/sw/bin/pythonw</string>
+                    <string>/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/python</string>
+                    <string>/usr/bin/pythonw</string>
+                    <string>/Applications/MacPython-OSX/python-additions/Python.app/Contents/MacOS/python</string>
                 </array>
                 <key>nosite</key>
                 <false/>