[53683] branches/gsoc09-gui/MPGUI

juanger at macports.org juanger at macports.org
Sat Jul 11 14:24:11 PDT 2009


Revision: 53683
          http://trac.macports.org/changeset/53683
Author:   juanger at macports.org
Date:     2009-07-11 14:24:10 -0700 (Sat, 11 Jul 2009)
Log Message:
-----------
Preferences window xib and controller

Modified Paths:
--------------
    branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib
    branches/gsoc09-gui/MPGUI/MPActionLauncher.h
    branches/gsoc09-gui/MPGUI/MPActionLauncher.m
    branches/gsoc09-gui/MPGUI/MPActionTool.h
    branches/gsoc09-gui/MPGUI/MPActionTool.m
    branches/gsoc09-gui/MPGUI/MPActionsController.h
    branches/gsoc09-gui/MPGUI/MPActionsController.m
    branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj
    branches/gsoc09-gui/MPGUI/PortsTableController.h
    branches/gsoc09-gui/MPGUI/PortsTableController.m

Added Paths:
-----------
    branches/gsoc09-gui/MPGUI/Preferences.xib
    branches/gsoc09-gui/MPGUI/PreferencesController.h
    branches/gsoc09-gui/MPGUI/PreferencesController.m

Modified: branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib
===================================================================
--- branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-07-11 21:24:10 UTC (rev 53683)
@@ -8,7 +8,8 @@
 		<string key="IBDocument.HIToolboxVersion">353.00</string>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="371"/>
+			<integer value="29"/>
+			<integer value="418"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2009,7 +2010,7 @@
 																				<reference ref="385089462"/>
 																			</object>
 																		</object>
-																		<object class="NSMutableDictionary" id="521510853">
+																		<object class="NSMutableDictionary" id="439706668">
 																			<bool key="EncodedWithXMLCoder">YES</bool>
 																			<object class="NSMutableArray" key="dict.sortedKeys">
 																				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2135,7 +2136,7 @@
 																					<bool key="EncodedWithXMLCoder">YES</bool>
 																					<reference ref="833924481"/>
 																					<reference ref="328879136"/>
-																					<reference ref="521510853"/>
+																					<reference ref="439706668"/>
 																				</object>
 																				<object class="NSMutableArray">
 																					<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2209,7 +2210,7 @@
 								</object>
 								<object class="NSScrollView" id="520202466">
 									<reference key="NSNextResponder" ref="169664854"/>
-									<int key="NSvFlags">274</int>
+									<int key="NSvFlags">306</int>
 									<object class="NSMutableArray" key="NSSubviews">
 										<bool key="EncodedWithXMLCoder">YES</bool>
 										<object class="NSClipView" id="221116208">
@@ -2663,6 +2664,9 @@
 			<object class="NSCustomObject" id="800227439">
 				<string key="NSClassName">MPActionsController</string>
 			</object>
+			<object class="NSCustomObject" id="517804865">
+				<string key="NSClassName">PreferencesController</string>
+			</object>
 		</object>
 		<object class="IBObjectContainer" key="IBDocument.Objects">
 			<object class="NSMutableArray" key="connectionRecords">
@@ -3228,6 +3232,22 @@
 					</object>
 					<int key="connectionID">650</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">openPreferences:</string>
+						<reference key="source" ref="800227439"/>
+						<reference key="destination" ref="609285721"/>
+					</object>
+					<int key="connectionID">655</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">tableController</string>
+						<reference key="source" ref="800227439"/>
+						<reference key="destination" ref="517167976"/>
+					</object>
+					<int key="connectionID">656</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -4367,6 +4387,11 @@
 						<reference key="object" ref="815358429"/>
 						<reference key="parent" ref="978062640"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">651</int>
+						<reference key="object" ref="517804865"/>
+						<reference key="parent" ref="1049"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -4579,6 +4604,7 @@
 					<string>557.IBPluginDependency</string>
 					<string>56.IBPluginDependency</string>
 					<string>56.ImportedFromIB2</string>
+					<string>57.IBEditorWindowLastContentRect</string>
 					<string>57.IBPluginDependency</string>
 					<string>57.ImportedFromIB2</string>
 					<string>57.editorWindowContentRectSynchronizationRect</string>
@@ -4602,6 +4628,7 @@
 					<string>641.IBPluginDependency</string>
 					<string>645.IBPluginDependency</string>
 					<string>647.IBPluginDependency</string>
+					<string>651.IBPluginDependency</string>
 					<string>72.IBPluginDependency</string>
 					<string>72.ImportedFromIB2</string>
 					<string>73.IBPluginDependency</string>
@@ -4767,9 +4794,9 @@
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
-					<string>{{0, 237}, {773, 449}}</string>
+					<string>{{93, 168}, {773, 449}}</string>
 					<reference ref="6"/>
-					<string>{{0, 237}, {773, 449}}</string>
+					<string>{{93, 168}, {773, 449}}</string>
 					<reference ref="9"/>
 					<string>{{33, 99}, {480, 360}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -4836,6 +4863,7 @@
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
+					<string>{{61, 251}, {245, 183}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
 					<string>{{23, 794}, {245, 183}}</string>
@@ -4860,6 +4888,7 @@
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
@@ -4906,7 +4935,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">650</int>
+			<int key="maxID">656</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -4927,6 +4956,7 @@
 						<object class="NSMutableArray" key="dict.sortedKeys">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<string>install:</string>
+							<string>openPreferences:</string>
 							<string>selfupdate:</string>
 							<string>sync:</string>
 							<string>uninstall:</string>
@@ -4939,11 +4969,21 @@
 							<string>id</string>
 							<string>id</string>
 							<string>id</string>
+							<string>id</string>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="outlets">
-						<string key="NS.key.0">ports</string>
-						<string key="NS.object.0">NSArrayController</string>
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSMutableArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>ports</string>
+							<string>tableController</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>NSArrayController</string>
+							<string>PortsTableController</string>
+						</object>
 					</object>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">
 						<string key="majorKey">IBProjectSource</string>
@@ -4987,6 +5027,31 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">PreferencesController</string>
+					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">selectPKGPath:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="NSMutableDictionary" key="outlets">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSMutableArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>pkgPathField</string>
+							<string>preferencesWindow</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>NSTextField</string>
+							<string>NSWindow</string>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">PreferencesController.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">StatePredicateTemplate</string>
 					<string key="superclassName">NSPredicateEditorRowTemplate</string>
 					<object class="IBClassDescriptionSource" key="sourceIdentifier">

Modified: branches/gsoc09-gui/MPGUI/MPActionLauncher.h
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionLauncher.h	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/MPActionLauncher.h	2009-07-11 21:24:10 UTC (rev 53683)
@@ -16,6 +16,7 @@
 #import <Cocoa/Cocoa.h>
 #import <MacPorts/MacPorts.h>
 #import "MPActionTool.h"
+#import "PreferencesController.h"
 
 /*!
  @class MPActionLauncher

Modified: branches/gsoc09-gui/MPGUI/MPActionLauncher.m
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionLauncher.m	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/MPActionLauncher.m	2009-07-11 21:24:10 UTC (rev 53683)
@@ -34,22 +34,8 @@
 - (id)init {
     NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
     if (sharedActionLauncher == nil) {
-        NSString *pkgPath;
-        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-        pkgPath = [defaults objectForKey:@"PKGPath"];
-        if (pkgPath == nil) {
-            // This pkgPath is just for testing purposes
-            // TODO: Open the preferences panel to setup the PKGPath
-            pkgPath = [bundlePath stringByAppendingPathComponent:@"../macports-1.8/Library/Tcl"];
-            pkgPath = [pkgPath stringByStandardizingPath];
-            [defaults setObject:pkgPath forKey:@"PKGPath"];
-        }
-                
-        [MPMacPorts setPKGPath:pkgPath];
-        ports = [NSMutableArray arrayWithCapacity:6000];
+        ports = [NSMutableArray arrayWithCapacity:1];
         sharedActionLauncher = self;
-        
-        // Runt he MPActionTool
     }
 
     // This is the path to the MPActionTool
@@ -108,6 +94,7 @@
 
 - (void)loadPorts {
     [self setIsLoading:YES];
+    ports = [NSMutableArray arrayWithCapacity:6000];
     NSDictionary *allPorts = [[MPMacPorts sharedInstance] search:MPPortsAll];
     NSDictionary *installedPorts = [[MPRegistry sharedRegistry] installed];
     
@@ -122,6 +109,12 @@
         [[allPorts objectForKey:port] setStateFromReceipts:[installedPorts objectForKey:port]];
     }
     [self didChangeValueForKey:@"ports"];
+    
+    id theProxy = [NSConnection
+                rootProxyForConnectionWithRegisteredName:@"actionTool"
+                host:nil];
+    [theProxy loadPKGPath];
+    
     [self setIsLoading:NO];
 }
 

Modified: branches/gsoc09-gui/MPGUI/MPActionTool.h
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionTool.h	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/MPActionTool.h	2009-07-11 21:24:10 UTC (rev 53683)
@@ -21,6 +21,7 @@
 - (oneway void)upgradePort:(byref id)port;
 - (oneway void)sync;
 - (oneway void)selfupdate;
+- (oneway void)loadPKGPath;
 
 - (NSString*)PKGPathFromDefaults;
 

Modified: branches/gsoc09-gui/MPGUI/MPActionTool.m
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionTool.m	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/MPActionTool.m	2009-07-11 21:24:10 UTC (rev 53683)
@@ -13,7 +13,11 @@
 @synthesize macports;
 
 - (id)init {
-    macports = [MPMacPorts sharedInstanceWithPkgPath:[self PKGPathFromDefaults] portOptions:nil];
+    if ([self PKGPathFromDefaults] != nil) {
+        [self loadPKGPath];
+    } else {
+        macports = [MPMacPorts sharedInstance];
+    }
     return self;
 }
 
@@ -73,6 +77,10 @@
     return PKGPath;
 }
 
+- (oneway void)loadPKGPath {
+    macports = [MPMacPorts sharedInstanceWithPkgPath:[self PKGPathFromDefaults] portOptions:nil];
+}
+
 @end
 
 int main(int argc, char const * argv[]) {

Modified: branches/gsoc09-gui/MPGUI/MPActionsController.h
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionsController.h	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/MPActionsController.h	2009-07-11 21:24:10 UTC (rev 53683)
@@ -8,12 +8,15 @@
 
 #import <Cocoa/Cocoa.h>
 #import "MPActionLauncher.h"
+#import "PortsTableController.h"
 
 
 @interface MPActionsController : NSObject {
     IBOutlet NSArrayController *ports;
+    IBOutlet PortsTableController *tableController;
 }
 
+- (IBAction)openPreferences:(id)sender;
 - (IBAction)install:(id)sender;
 - (IBAction)uninstall:(id)sender;
 - (IBAction)upgrade:(id)sender;

Modified: branches/gsoc09-gui/MPGUI/MPActionsController.m
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionsController.m	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/MPActionsController.m	2009-07-11 21:24:10 UTC (rev 53683)
@@ -11,6 +11,10 @@
 
 @implementation MPActionsController
 
+- (IBAction)openPreferences:(id)sender {
+    [NSBundle loadNibNamed:@"Preferences" owner:self];
+}
+
 - (IBAction)install:(id)sender {
     NSArray *selectedPorts = [ports selectedObjects];
     for (id port in selectedPorts) {
@@ -49,7 +53,16 @@
 #pragma mark App Delegate
 
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
-    [[MPActionLauncher sharedInstance] loadPortsInBackground];
+    [tableController hidePredicateEditor:self];
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    NSString *pkgPath = [defaults objectForKey:@"PKGPath"];
+    
+    if (pkgPath == nil) {
+        [self openPreferences:self];
+    } else {
+        [MPMacPorts setPKGPath:pkgPath];
+        [[MPActionLauncher sharedInstance] loadPortsInBackground];    
+    }
 }
 
 - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication {

Modified: branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj
===================================================================
--- branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj	2009-07-11 21:24:10 UTC (rev 53683)
@@ -25,13 +25,15 @@
 		21351FB30FEC67780074ACFE /* MPActionsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21351FB20FEC67780074ACFE /* MPActionsController.m */; };
 		214BAFE40FE7164200BD1B46 /* MPActionLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 214BAFE30FE7164200BD1B46 /* MPActionLauncher.m */; };
 		21A588360FF5D683003CF725 /* MPActionTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 21A588350FF5D683003CF725 /* MPActionTool.m */; };
-		21A588370FF5D697003CF725 /* MacPorts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21F165510FE2C04300542AEE /* MacPorts.framework */; };
 		21A5884C0FF5D834003CF725 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97325FDCFA39411CA2CEA /* Foundation.framework */; };
 		21A5895A0FF5E96E003CF725 /* MPActionTool in CopyFiles */ = {isa = PBXBuildFile; fileRef = 21A588140FF5D508003CF725 /* MPActionTool */; };
 		21B6A38E0FEDCBD5001DF976 /* TB_Install.icns in Resources */ = {isa = PBXBuildFile; fileRef = 21B6A38A0FEDCBD5001DF976 /* TB_Install.icns */; };
 		21B6A38F0FEDCBD5001DF976 /* TB_Sync.icns in Resources */ = {isa = PBXBuildFile; fileRef = 21B6A38B0FEDCBD5001DF976 /* TB_Sync.icns */; };
 		21B6A3910FEDCBD5001DF976 /* TB_Upgrade.icns in Resources */ = {isa = PBXBuildFile; fileRef = 21B6A38D0FEDCBD5001DF976 /* TB_Upgrade.icns */; };
 		21B6A3940FEDE6CA001DF976 /* TB_Uninstall.icns in Resources */ = {isa = PBXBuildFile; fileRef = 21B6A3930FEDE6CA001DF976 /* TB_Uninstall.icns */; };
+		21E2ADB01002E428003F8885 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 21E2ADAF1002E428003F8885 /* Preferences.xib */; };
+		21E2ADB71002EAE0003F8885 /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21E2ADB61002EAE0003F8885 /* PreferencesController.m */; };
+		21E2AEBB1002FC3C003F8885 /* MacPorts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21F165510FE2C04300542AEE /* MacPorts.framework */; };
 		21F166D80FE329A700542AEE /* MacPorts.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 21F165510FE2C04300542AEE /* MacPorts.framework */; };
 		21F166D90FE329AA00542AEE /* MacPorts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21F165510FE2C04300542AEE /* MacPorts.framework */; };
 		21F1675A0FE3382D00542AEE /* PortsTableController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21F167590FE3382D00542AEE /* PortsTableController.m */; };
@@ -49,7 +51,7 @@
 			isa = PBXContainerItemProxy;
 			containerPortal = 21F165400FE2C04300542AEE /* MacPorts.Framework.xcodeproj */;
 			proxyType = 1;
-			remoteGlobalIDString = 8DC2EF4F0486A6940098B216 /* MacPorts */;
+			remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
 			remoteInfo = MacPorts;
 		};
 		21A588E40FF5E09A003CF725 /* PBXContainerItemProxy */ = {
@@ -142,6 +144,9 @@
 		21B6A38B0FEDCBD5001DF976 /* TB_Sync.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = TB_Sync.icns; sourceTree = "<group>"; };
 		21B6A38D0FEDCBD5001DF976 /* TB_Upgrade.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = TB_Upgrade.icns; sourceTree = "<group>"; };
 		21B6A3930FEDE6CA001DF976 /* TB_Uninstall.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = TB_Uninstall.icns; sourceTree = "<group>"; };
+		21E2ADAF1002E428003F8885 /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Preferences.xib; sourceTree = "<group>"; };
+		21E2ADB51002EAE0003F8885 /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = "<group>"; };
+		21E2ADB61002EAE0003F8885 /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = "<group>"; };
 		21F165400FE2C04300542AEE /* MacPorts.Framework.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MacPorts.Framework.xcodeproj; path = ../MacPorts_Framework/MacPorts.Framework.xcodeproj; sourceTree = SOURCE_ROOT; };
 		21F167580FE3382D00542AEE /* PortsTableController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PortsTableController.h; sourceTree = "<group>"; };
 		21F167590FE3382D00542AEE /* PortsTableController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PortsTableController.m; sourceTree = "<group>"; };
@@ -164,7 +169,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				21A588370FF5D697003CF725 /* MacPorts.framework in Frameworks */,
+				21E2AEBB1002FC3C003F8885 /* MacPorts.framework in Frameworks */,
 				21A5884C0FF5D834003CF725 /* Foundation.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -245,6 +250,8 @@
 				21F167590FE3382D00542AEE /* PortsTableController.m */,
 				21351FB10FEC67780074ACFE /* MPActionsController.h */,
 				21351FB20FEC67780074ACFE /* MPActionsController.m */,
+				21E2ADB51002EAE0003F8885 /* PreferencesController.h */,
+				21E2ADB61002EAE0003F8885 /* PreferencesController.m */,
 			);
 			name = Controllers;
 			sourceTree = "<group>";
@@ -297,6 +304,7 @@
 				8D1107310486CEB800E47090 /* Info.plist */,
 				089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
 				1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
+				21E2ADAF1002E428003F8885 /* Preferences.xib */,
 			);
 			name = Resources;
 			sourceTree = "<group>";
@@ -429,6 +437,7 @@
 				21B6A38F0FEDCBD5001DF976 /* TB_Sync.icns in Resources */,
 				21B6A3910FEDCBD5001DF976 /* TB_Upgrade.icns in Resources */,
 				21B6A3940FEDE6CA001DF976 /* TB_Uninstall.icns in Resources */,
+				21E2ADB01002E428003F8885 /* Preferences.xib in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -484,6 +493,7 @@
 				21FC226A0FE8895900B1E835 /* StateTransformer.m in Sources */,
 				21FC233B0FE8AB0400B1E835 /* StatePredicateTemplate.m in Sources */,
 				21351FB30FEC67780074ACFE /* MPActionsController.m in Sources */,
+				21E2ADB71002EAE0003F8885 /* PreferencesController.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -560,6 +570,7 @@
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				COPY_PHASE_STRIP = NO;
+				FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/../MacPorts_Framework/build/\"";
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_FIX_AND_CONTINUE = YES;
 				GCC_MODEL_TUNING = G5;
@@ -582,6 +593,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
+				FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/../MacPorts_Framework/build/\"";
 				GCC_ENABLE_FIX_AND_CONTINUE = YES;
 				GCC_MODEL_TUNING = G5;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -643,7 +655,7 @@
 				COPY_PHASE_STRIP = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"\"$(SRCROOT)/../MacPorts_Framework/build/Debug\"",
+					"\"$(SRCROOT)/../MacPorts_Framework/build\"",
 				);
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_FIX_AND_CONTINUE = YES;
@@ -663,8 +675,8 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				COPY_PHASE_STRIP = NO;
 				FRAMEWORK_SEARCH_PATHS = (
+					"\"$(SRCROOT)/../MacPorts_Framework/build\"",
 					"$(inherited)",
-					"\"$(SRCROOT)/../MacPorts_Framework/build/Debug\"",
 				);
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_FIX_AND_CONTINUE = YES;

Modified: branches/gsoc09-gui/MPGUI/PortsTableController.h
===================================================================
--- branches/gsoc09-gui/MPGUI/PortsTableController.h	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/PortsTableController.h	2009-07-11 21:24:10 UTC (rev 53683)
@@ -50,5 +50,8 @@
 */
 - (IBAction)basicSearch:(id)sender;
 
+
+- (IBAction)hidePredicateEditor:(id)sender;
+
 @end
 

Modified: branches/gsoc09-gui/MPGUI/PortsTableController.m
===================================================================
--- branches/gsoc09-gui/MPGUI/PortsTableController.m	2009-07-11 19:53:14 UTC (rev 53682)
+++ branches/gsoc09-gui/MPGUI/PortsTableController.m	2009-07-11 21:24:10 UTC (rev 53683)
@@ -53,6 +53,10 @@
     [self setPredicate:newPredicate];
 }
 
+- (IBAction)hidePredicateEditor:(id)sender {
+    [self changePredicateEditorSize:0];
+}
+
 #pragma mark Private Methods
 
 - (void)changePredicateEditorSize:(NSInteger) newRowCount {

Added: branches/gsoc09-gui/MPGUI/Preferences.xib
===================================================================
--- branches/gsoc09-gui/MPGUI/Preferences.xib	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/Preferences.xib	2009-07-11 21:24:10 UTC (rev 53683)
@@ -0,0 +1,429 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
+	<data>
+		<int key="IBDocument.SystemTarget">1050</int>
+		<string key="IBDocument.SystemVersion">9J61</string>
+		<string key="IBDocument.InterfaceBuilderVersion">677</string>
+		<string key="IBDocument.AppKitVersion">949.46</string>
+		<string key="IBDocument.HIToolboxVersion">353.00</string>
+		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<integer value="2"/>
+		</object>
+		<object class="NSArray" key="IBDocument.PluginDependencies">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<string>com.apple.InterfaceBuilderKit</string>
+			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+		</object>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSArray" key="dict.sortedKeys">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+			<object class="NSMutableArray" key="dict.values">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+			</object>
+		</object>
+		<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+			<bool key="EncodedWithXMLCoder">YES</bool>
+			<object class="NSCustomObject" id="1001">
+				<string key="NSClassName">NSObject</string>
+			</object>
+			<object class="NSCustomObject" id="1003">
+				<string key="NSClassName">FirstResponder</string>
+			</object>
+			<object class="NSCustomObject" id="1004">
+				<string key="NSClassName">NSApplication</string>
+			</object>
+			<object class="NSWindowTemplate" id="540806231">
+				<int key="NSWindowStyleMask">15</int>
+				<int key="NSWindowBacking">2</int>
+				<string key="NSWindowRect">{{196, 394}, {477, 116}}</string>
+				<int key="NSWTFlags">1677722624</int>
+				<string key="NSWindowTitle">Preferences</string>
+				<string key="NSWindowClass">NSWindow</string>
+				<nil key="NSViewClass"/>
+				<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+				<object class="NSView" key="NSWindowView" id="615275372">
+					<reference key="NSNextResponder"/>
+					<int key="NSvFlags">256</int>
+					<object class="NSMutableArray" key="NSSubviews">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSTextField" id="707613289">
+							<reference key="NSNextResponder" ref="615275372"/>
+							<int key="NSvFlags">268</int>
+							<string key="NSFrame">{{17, 79}, {60, 17}}</string>
+							<reference key="NSSuperview" ref="615275372"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSTextFieldCell" key="NSCell" id="476929583">
+								<int key="NSCellFlags">68288064</int>
+								<int key="NSCellFlags2">272630784</int>
+								<string key="NSContents">Tcl path:</string>
+								<object class="NSFont" key="NSSupport" id="135612064">
+									<string key="NSName">LucidaGrande</string>
+									<double key="NSSize">1.300000e+01</double>
+									<int key="NSfFlags">1044</int>
+								</object>
+								<reference key="NSControlView" ref="707613289"/>
+								<object class="NSColor" key="NSBackgroundColor" id="317531640">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">controlColor</string>
+									<object class="NSColor" key="NSColor">
+										<int key="NSColorSpace">3</int>
+										<bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
+									</object>
+								</object>
+								<object class="NSColor" key="NSTextColor" id="689169118">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">controlTextColor</string>
+									<object class="NSColor" key="NSColor" id="1019754084">
+										<int key="NSColorSpace">3</int>
+										<bytes key="NSWhite">MAA</bytes>
+									</object>
+								</object>
+							</object>
+						</object>
+						<object class="NSTextField" id="140782020">
+							<reference key="NSNextResponder" ref="615275372"/>
+							<int key="NSvFlags">268</int>
+							<string key="NSFrame">{{82, 77}, {273, 22}}</string>
+							<reference key="NSSuperview" ref="615275372"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSTextFieldCell" key="NSCell" id="559211659">
+								<int key="NSCellFlags">-2072904127</int>
+								<int key="NSCellFlags2">272630784</int>
+								<string key="NSContents"/>
+								<reference key="NSSupport" ref="135612064"/>
+								<reference key="NSControlView" ref="140782020"/>
+								<bool key="NSDrawsBackground">YES</bool>
+								<object class="NSColor" key="NSBackgroundColor">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">textBackgroundColor</string>
+									<object class="NSColor" key="NSColor">
+										<int key="NSColorSpace">3</int>
+										<bytes key="NSWhite">MQA</bytes>
+									</object>
+								</object>
+								<object class="NSColor" key="NSTextColor">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">textColor</string>
+									<reference key="NSColor" ref="1019754084"/>
+								</object>
+							</object>
+						</object>
+						<object class="NSButton" id="259885027">
+							<reference key="NSNextResponder" ref="615275372"/>
+							<int key="NSvFlags">268</int>
+							<string key="NSFrame">{{363, 77}, {94, 19}}</string>
+							<reference key="NSSuperview" ref="615275372"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSButtonCell" key="NSCell" id="749224624">
+								<int key="NSCellFlags">-2080244224</int>
+								<int key="NSCellFlags2">134217728</int>
+								<string key="NSContents">Select...</string>
+								<object class="NSFont" key="NSSupport">
+									<string key="NSName">LucidaGrande</string>
+									<double key="NSSize">1.200000e+01</double>
+									<int key="NSfFlags">16</int>
+								</object>
+								<reference key="NSControlView" ref="259885027"/>
+								<int key="NSButtonFlags">-2038152961</int>
+								<int key="NSButtonFlags2">164</int>
+								<string key="NSAlternateContents"/>
+								<string key="NSKeyEquivalent"/>
+								<int key="NSPeriodicDelay">400</int>
+								<int key="NSPeriodicInterval">75</int>
+							</object>
+						</object>
+						<object class="NSTextField" id="784669975">
+							<reference key="NSNextResponder" ref="615275372"/>
+							<int key="NSvFlags">268</int>
+							<string key="NSFrame">{{29, 20}, {431, 42}}</string>
+							<reference key="NSSuperview" ref="615275372"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSTextFieldCell" key="NSCell" id="808105839">
+								<int key="NSCellFlags">67239424</int>
+								<int key="NSCellFlags2">1346502656</int>
+								<string key="NSContents">This is usually /Library/Tcl. Since this demo version is tested with MacPorts 1.8 your current installation may not fully work but you can always install a non privileged installation of MacPorts 1.8.</string>
+								<object class="NSFont" key="NSSupport">
+									<string key="NSName">LucidaGrande</string>
+									<double key="NSSize">1.100000e+01</double>
+									<int key="NSfFlags">3100</int>
+								</object>
+								<reference key="NSControlView" ref="784669975"/>
+								<reference key="NSBackgroundColor" ref="317531640"/>
+								<reference key="NSTextColor" ref="689169118"/>
+							</object>
+						</object>
+					</object>
+					<string key="NSFrameSize">{477, 116}</string>
+					<reference key="NSSuperview"/>
+				</object>
+				<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
+				<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+			</object>
+			<object class="NSUserDefaultsController" id="457243387">
+				<bool key="NSSharedInstance">YES</bool>
+			</object>
+			<object class="NSCustomObject" id="357012729">
+				<string key="NSClassName">PreferencesController</string>
+			</object>
+		</object>
+		<object class="IBObjectContainer" key="IBDocument.Objects">
+			<object class="NSMutableArray" key="connectionRecords">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBConnectionRecord">
+					<object class="IBBindingConnection" key="connection">
+						<string key="label">value: values.PKGPath</string>
+						<reference key="source" ref="140782020"/>
+						<reference key="destination" ref="457243387"/>
+						<object class="NSNibBindingConnector" key="connector">
+							<reference key="NSSource" ref="140782020"/>
+							<reference key="NSDestination" ref="457243387"/>
+							<string key="NSLabel">value: values.PKGPath</string>
+							<string key="NSBinding">value</string>
+							<string key="NSKeyPath">values.PKGPath</string>
+							<int key="NSNibBindingConnectorVersion">2</int>
+						</object>
+					</object>
+					<int key="connectionID">9</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBActionConnection" key="connection">
+						<string key="label">selectPKGPath:</string>
+						<reference key="source" ref="357012729"/>
+						<reference key="destination" ref="259885027"/>
+					</object>
+					<int key="connectionID">15</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">pkgPathField</string>
+						<reference key="source" ref="357012729"/>
+						<reference key="destination" ref="140782020"/>
+					</object>
+					<int key="connectionID">16</int>
+				</object>
+			</object>
+			<object class="IBMutableOrderedSet" key="objectRecords">
+				<object class="NSArray" key="orderedObjects">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBObjectRecord">
+						<int key="objectID">0</int>
+						<object class="NSArray" key="object" id="1002">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+						</object>
+						<reference key="children" ref="1000"/>
+						<nil key="parent"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-2</int>
+						<reference key="object" ref="1001"/>
+						<reference key="parent" ref="1002"/>
+						<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-1</int>
+						<reference key="object" ref="1003"/>
+						<reference key="parent" ref="1002"/>
+						<string key="objectName">First Responder</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">-3</int>
+						<reference key="object" ref="1004"/>
+						<reference key="parent" ref="1002"/>
+						<string key="objectName">Application</string>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">1</int>
+						<reference key="object" ref="540806231"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="615275372"/>
+						</object>
+						<reference key="parent" ref="1002"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">2</int>
+						<reference key="object" ref="615275372"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="707613289"/>
+							<reference ref="140782020"/>
+							<reference ref="259885027"/>
+							<reference ref="784669975"/>
+						</object>
+						<reference key="parent" ref="540806231"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">3</int>
+						<reference key="object" ref="707613289"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="476929583"/>
+						</object>
+						<reference key="parent" ref="615275372"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">4</int>
+						<reference key="object" ref="476929583"/>
+						<reference key="parent" ref="707613289"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">5</int>
+						<reference key="object" ref="140782020"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="559211659"/>
+						</object>
+						<reference key="parent" ref="615275372"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">6</int>
+						<reference key="object" ref="559211659"/>
+						<reference key="parent" ref="140782020"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">7</int>
+						<reference key="object" ref="457243387"/>
+						<reference key="parent" ref="1002"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">10</int>
+						<reference key="object" ref="259885027"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="749224624"/>
+						</object>
+						<reference key="parent" ref="615275372"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">11</int>
+						<reference key="object" ref="749224624"/>
+						<reference key="parent" ref="259885027"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">12</int>
+						<reference key="object" ref="784669975"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="808105839"/>
+						</object>
+						<reference key="parent" ref="615275372"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">13</int>
+						<reference key="object" ref="808105839"/>
+						<reference key="parent" ref="784669975"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">14</int>
+						<reference key="object" ref="357012729"/>
+						<reference key="parent" ref="1002"/>
+					</object>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="flattenedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSMutableArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>-1.IBPluginDependency</string>
+					<string>-2.IBPluginDependency</string>
+					<string>-3.IBPluginDependency</string>
+					<string>1.IBEditorWindowLastContentRect</string>
+					<string>1.IBPluginDependency</string>
+					<string>1.IBWindowTemplateEditedContentRect</string>
+					<string>1.NSWindowTemplate.visibleAtLaunch</string>
+					<string>10.IBPluginDependency</string>
+					<string>11.IBPluginDependency</string>
+					<string>12.IBPluginDependency</string>
+					<string>13.IBPluginDependency</string>
+					<string>14.IBPluginDependency</string>
+					<string>2.IBPluginDependency</string>
+					<string>3.IBPluginDependency</string>
+					<string>4.IBPluginDependency</string>
+					<string>5.IBPluginDependency</string>
+					<string>6.IBPluginDependency</string>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilderKit</string>
+					<string>com.apple.InterfaceBuilderKit</string>
+					<string>{{219, 400}, {477, 116}}</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>{{219, 400}, {477, 116}}</string>
+					<boolean value="YES"/>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+				</object>
+			</object>
+			<object class="NSMutableDictionary" key="unlocalizedProperties">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="activeLocalization"/>
+			<object class="NSMutableDictionary" key="localizations">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="NSArray" key="dict.sortedKeys">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+				<object class="NSMutableArray" key="dict.values">
+					<bool key="EncodedWithXMLCoder">YES</bool>
+				</object>
+			</object>
+			<nil key="sourceID"/>
+			<int key="maxID">18</int>
+		</object>
+		<object class="IBClassDescriber" key="IBDocument.Classes">
+			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
+				<bool key="EncodedWithXMLCoder">YES</bool>
+				<object class="IBPartialClassDescription">
+					<string key="className">PreferencesController</string>
+					<string key="superclassName">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">selectPKGPath:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="NSMutableDictionary" key="outlets">
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSMutableArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>pkgPathField</string>
+							<string>preferencesWindow</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>NSTextField</string>
+							<string>NSWindow</string>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">PreferencesController.h</string>
+					</object>
+				</object>
+			</object>
+		</object>
+		<int key="IBDocument.localizationMode">0</int>
+		<string key="IBDocument.LastKnownRelativeProjectPath">MPGUI.xcodeproj</string>
+		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+	</data>
+</archive>

Added: branches/gsoc09-gui/MPGUI/PreferencesController.h
===================================================================
--- branches/gsoc09-gui/MPGUI/PreferencesController.h	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/PreferencesController.h	2009-07-11 21:24:10 UTC (rev 53683)
@@ -0,0 +1,20 @@
+//
+//  PreferencesController.h
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 7/6/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import <MacPorts/MacPorts.h>
+#import "MPActionLauncher.h"
+
+
+ at interface PreferencesController : NSObject {
+    IBOutlet NSTextField *pkgPathField;
+    IBOutlet NSWindow *preferencesWindow;
+}
+- (IBAction)selectPKGPath:(id)sender;
+
+ at end

Added: branches/gsoc09-gui/MPGUI/PreferencesController.m
===================================================================
--- branches/gsoc09-gui/MPGUI/PreferencesController.m	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/PreferencesController.m	2009-07-11 21:24:10 UTC (rev 53683)
@@ -0,0 +1,29 @@
+//
+//  PreferencesController.m
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 7/6/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import "PreferencesController.h"
+
+
+ at implementation PreferencesController
+
+- (IBAction)selectPKGPath:(id)sender {
+    NSOpenPanel *openPanel = [NSOpenPanel openPanel];
+    [openPanel setCanChooseFiles:NO];
+    [openPanel setCanChooseDirectories:YES];
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    NSInteger result = [openPanel runModalForDirectory:[defaults objectForKey:@"NSNavLastCurrentDirectory"] file:nil types:nil];
+    if(result == NSOKButton) {
+        NSString *path = [[openPanel filenames] objectAtIndex:0];
+        [defaults setObject:path forKey:@"PKGPath"];
+        NSLog(@"PATH: %@", path);
+        [MPMacPorts setPKGPath:path];
+        [[MPActionLauncher sharedInstance] loadPortsInBackground];
+    }
+}
+
+ at end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090711/78c31e6c/attachment-0001.html>


More information about the macports-changes mailing list