[38329] branches/gsoc08-framework/MacPorts_Framework

armahg at macports.org armahg at macports.org
Tue Jul 15 21:53:32 PDT 2008


Revision: 38329
          http://trac.macosforge.org/projects/macports/changeset/38329
Author:   armahg at macports.org
Date:     2008-07-15 21:53:32 -0700 (Tue, 15 Jul 2008)
Log Message:
-----------
Added localization of Notifications in MPInterpreter. Modifiied init.tcl to send notifications based on message priority.

Modified Paths:
--------------
    branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h
    branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m
    branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h
    branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m
    branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m
    branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.h
    branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.m
    branches/gsoc08-framework/MacPorts_Framework/MPPort.h
    branches/gsoc08-framework/MacPorts_Framework/MPPort.m
    branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/Armahg.mode1v3
    branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
    branches/gsoc08-framework/MacPorts_Framework/dummycommit.test
    branches/gsoc08-framework/MacPorts_Framework/init.tcl
    branches/gsoc08-framework/MacPorts_Framework/notifications.m

Added Paths:
-----------
    branches/gsoc08-framework/MacPorts_Framework/ToDo.txt

Modified: branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h	2008-07-16 04:53:32 UTC (rev 38329)
@@ -40,7 +40,8 @@
  */
 
 #import <Cocoa/Cocoa.h>
-#include <tcl.h>
+#include <tcl.h>  
+#import "MPNotificationsListener.h"
 
 #define	MPPackage			@"macports"
 #define MPPackageVersion	@"1.0"

Modified: branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m	2008-07-16 04:53:32 UTC (rev 38329)
@@ -36,7 +36,76 @@
 #import "MPInterpreter.h"
 
 @implementation MPInterpreter
+#pragma mark Notifications Code 
+int Notifications_Send(int objc, Tcl_Obj *CONST objv[], int global, Tcl_Interp *interpreter) {
+	//NSLog(@" INSIDE Notifications_Send METHOD");
+	NSString *name , *msg;
+	NSMutableDictionary *info = nil;
+	
+	int tclCount;
+	int tclResult;
+	int i;
+	const char **tclElements;
+	
+	name = [NSString stringWithUTF8String:Tcl_GetString(*objv)];
+	++objv; --objc;
+	
+	tclResult = Tcl_SplitList(interpreter, Tcl_GetString(*objv), &tclCount, &tclElements);
+	if (tclResult == TCL_OK) {
+		info = [NSMutableDictionary dictionaryWithCapacity:(tclCount / 2)];
+		for (i = 0; i < tclCount; i +=2) {
+			[info setObject:[NSString stringWithUTF8String:tclElements[i + 1]] forKey:[NSString stringWithUTF8String:tclElements[i]]];
+		}
+		
+		//Get ui_* message separately 
+		++objv; --objc;
+		if(objv != NULL) {
+			msg = [NSString stringWithUTF8String:Tcl_GetString(*objv)];
+			//strip off "--->" over here
+			msg = [msg stringByReplacingOccurrencesOfString:@"--->" withString:@""];
+			[info setObject:msg forKey:[NSString stringWithString:@"Message"]];
+		}
+		
+		if (global != 0) {
+			[[NSDistributedNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+		} else {
+			[[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+		}
+		
+		
+	} else {
+		return TCL_ERROR;
+	}
+	
+	return TCL_OK;
+}
 
+int Notifications_Command(ClientData clientData, Tcl_Interp *interpreter, int objc, Tcl_Obj *CONST objv[]) {
+	//NSAutoreleasePool *pool = [NSAutoreleasePool new];
+	NSString *action = nil;
+	int returnCode = TCL_ERROR;
+	
+	++objv, --objc;
+	
+	if (objc) {
+		action = [NSString stringWithUTF8String:Tcl_GetString(*objv)];
+		++objv, --objc;
+		if ([action isEqualToString:@"send"]) {
+			if ([[NSString stringWithUTF8String:Tcl_GetString(*objv)] isEqualToString:@"global"]) {
+				++objv, --objc;
+				returnCode = Notifications_Send(objc, objv, 1, interpreter);				
+			} else {
+				returnCode = Notifications_Send(objc, objv, 0, interpreter);
+			}
+		}
+	}
+	
+	//[pool release];
+	return returnCode;
+}
+
+
+#pragma mark MPInterpreter Code
 - (id) init {
 	if (self = [super init]) {
 		_interpreter = Tcl_CreateInterp();
@@ -44,9 +113,23 @@
 			NSLog(@"Error in Tcl_CreateInterp, aborting.");
 		}
 		if(Tcl_Init(_interpreter) == TCL_ERROR) {
-			NSLog(@"Error in Tcl Init: %s", Tcl_GetStringResult(_interpreter));
+			NSLog(@"Error in Tcl_Init: %s", Tcl_GetStringResult(_interpreter));
 			Tcl_DeleteInterp(_interpreter);
 		}
+		
+		/*
+		//TO DO ...
+		//Use client provided .tcl file if any
+		
+		//Finally load our own init.tcl file
+		*/
+		
+		Tcl_CreateObjCommand(_interpreter, "notifications", Notifications_Command, NULL, NULL);
+		
+		if (Tcl_PkgProvide(_interpreter, "notifications", "1.0") != TCL_OK) {
+			NSLog(@"Error in Tcl_PkgProvide: %s", Tcl_GetStringResult(_interpreter));
+			Tcl_DeleteInterp(_interpreter);
+		}
 		if( Tcl_EvalFile(_interpreter, [[[NSBundle bundleWithIdentifier:@"org.macports.frameworks.macports"] pathForResource:@"init" ofType:@"tcl"] UTF8String]) != TCL_OK) {
 			NSLog(@"Error in Tcl_EvalFile: %s", Tcl_GetStringResult(_interpreter));
 			Tcl_DeleteInterp(_interpreter);
@@ -151,5 +234,4 @@
 - (NSString *)getVariableAsString:(NSString *)variable {
 	return [NSString stringWithUTF8String:Tcl_GetVar(_interpreter, [variable UTF8String], 0)];
 }
-
 @end

Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h	2008-07-16 04:53:32 UTC (rev 38329)
@@ -84,14 +84,16 @@
 /*!
  @brief Returns an NSDictionary of ports. Calls [self search:query caseSensiitve:YES].   
  @param query An NSString containing name or partial name of port being searched. 
- @discussion The keys are NSString names of the ports whilst the values are the respective MPPort objects
+ @discussion The keys are NSString names of the ports whilst the values are the respective MPPort objects.
+ Possible search style options are are regexp, exact and glob.
  */
 - (NSDictionary *)search:(NSString *)query;
 /*!
  @brief Returns an NSDictionary of ports. Calls [self search:query caseSensitive:sensitivity matchStyle:\@"regex"].  
  @param query An NSString containing name (full or parital) of port being searched.
  @param sensitivity A Boolean value indicating whether or not the search should be case sensitive
- @discussion  The keys are NSString names of the ports whilst the values are the respective MPPort objects
+ @discussion  The keys are NSString names of the ports whilst the values are the respective MPPort objects.
+ Possible search style options are are regexp, exact and glob.
  */
 - (NSDictionary *)search:(NSString *)query caseSensitive:(BOOL)sensitivity;
 /*!
@@ -99,7 +101,8 @@
  @param query An NSString containing name (full or parital) of port being searched.
  @param sensitivity A Boolean value indicating whether or not the search should be case sensitive
  @param style Search style for query
- @discussion  The keys are NSString names of the ports whilst the values are the respective MPPort objects
+ @discussion  The keys are NSString names of the ports whilst the values are the respective MPPort objects.
+ Possible search style options are are regexp, exact and glob.
  */
 - (NSDictionary *)search:(NSString *)query caseSensitive:(BOOL)sensitivity matchStyle:(NSString *)style;
 /*!
@@ -108,7 +111,8 @@
  @param sensitivity A Boolean value indicating whether or not the search should be case sensitive
  @param style Search style for query
  @param fieldName Field for port query
- @discussion  The keys are NSString names of the ports whilst the values are the respective MPPort objects
+ @discussion  The keys are NSString names of the ports whilst the values are the respective MPPort objects.
+ Possible search style options are are regexp, exact and glob.
  */
 - (NSDictionary *)search:(NSString *)query caseSensitive:(BOOL)sensitivity matchStyle:(NSString *)style field:(NSString *)fieldName;
 
@@ -119,8 +123,9 @@
  */
 - (NSArray *)depends:(MPPort *)port;
 
-
+/* TO DO: Delete this method
 - (void)exec:(MPPort *)port withTarget:(NSString *)target;
+*/
 
 /*!
  @brief Executes specific target of given MPPort
@@ -167,7 +172,7 @@
 
 
 //Notifications stuff
--(void)registerForLocalNotification;
+-(void)registerForLocalNotifications;
 -(void)respondToLocalNotification:(NSNotification *) notification;
 
 @end

Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m	2008-07-16 04:53:32 UTC (rev 38329)
@@ -41,7 +41,7 @@
 - (id) init {
 	if (self = [super init]) {
 		interpreter = [MPInterpreter sharedInterpreter];
-		[self registerForLocalNotification];
+		[self registerForLocalNotifications];
 	}
 	return self;
 }
@@ -115,7 +115,7 @@
 }
 
 - (NSDictionary *)search:(NSString *)query caseSensitive:(BOOL)sensitivity matchStyle:(NSString *)style field:(NSString *)fieldName {
-	NSMutableDictionary *result;
+	NSMutableDictionary *result, *newResult;
 	NSEnumerator *enumerator;
 	id key;
 	NSString *caseSensitivity;
@@ -132,21 +132,24 @@
 		fieldName,
 		@"]",
 		nil]]]];
+	
+	newResult = [NSMutableDictionary dictionaryWithCapacity:[result count]];
 	enumerator = [result keyEnumerator];
 	while (key = [enumerator nextObject]) {
-		[result setObject:[[MPPort alloc] initWithTclListAsString:[result objectForKey:key]] forKey:key];
+		[newResult setObject:[[MPPort alloc] initWithTclListAsString:[result objectForKey:key]] forKey:key];
 	}
-	return [NSDictionary dictionaryWithDictionary:result];
+	return [NSDictionary dictionaryWithDictionary:newResult];
 }
 
 - (NSArray *)depends:(MPPort *)port {
 	return [port depends];
 }
 
+/* TO DO: Delete this method
 - (void)exec:(MPPort *)port withTarget:(NSString *)target {
 	[port exec:target];
 }
-
+*/
 - (void)exec:(MPPort *)port withTarget:(NSString *)target withOptions:(NSArray *)options withVariants:(NSArray *)variants {
 	[port exec:target withOptions:options withVariants:variants];
 }
@@ -174,14 +177,6 @@
 	return sources;
 }
 
-- (NSURL *)pathToPortIndex:(NSString *)source {
-	return [NSURL fileURLWithPath:
-			[interpreter evaluateArrayAsString:[NSArray arrayWithObjects:
-												@"return [macports::getindex",
-												source,
-												@"]",
-												nil]]];
-}
 
 - (NSURL *)pathToPortIndex:(NSString *)source {
 	return [NSURL fileURLWithPath:
@@ -197,22 +192,43 @@
 	return version;
 }
 
-
--(void) registerForLocalNotification {
+#pragma mark Testing MacPorts Notifications
+-(void) registerForLocalNotifications {
 	[[NSNotificationCenter defaultCenter] addObserver:self
 											 selector:@selector(respondToLocalNotification:) 
+												 name:@"MPInfoNotification"
+											   object:nil];
+	
+	[[NSNotificationCenter defaultCenter] addObserver:self
+											 selector:@selector(respondToLocalNotification:) 
+												 name:@"MPMsgNotification"
+											   object:nil];
+	
+	[[NSNotificationCenter defaultCenter] addObserver:self
+											 selector:@selector(respondToLocalNotification:) 
+												 name:@"MPErrorNotification"
+											   object:nil];
+	
+	[[NSNotificationCenter defaultCenter] addObserver:self
+											 selector:@selector(respondToLocalNotification:) 
+												 name:@"MPWarnNotification"
+											   object:nil];
+	
+	[[NSNotificationCenter defaultCenter] addObserver:self
+											 selector:@selector(respondToLocalNotification:) 
 												 name:@"testMacPortsNotification"
 											   object:nil];
 }
 
 -(void) respondToLocalNotification:(NSNotification *)notification {
-	id sentObject = [notification object];
+	id sentDict = [notification userInfo];
+	//NSLog(@" INSIDE respondToLocalNotification METHOD");
 	
 	//Just NSLog it for now
-	if(sentObject == nil)
-		NSLog(@"Looooo caaaaal");
+	if(sentDict == nil)
+		NSLog(@"Looooocaaaaal");
 	else
-		NSLog(@"%@" , NSStringFromClass([sentObject class]));
+		NSLog(@"%@" , [sentDict description]);
 }
 
 @end

Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m	2008-07-16 04:53:32 UTC (rev 38329)
@@ -83,9 +83,8 @@
 -(void) testSync {
 	//The only way to test this that I know of is to listen for the posted notifications
 	//and take actions as appropriate
+	//NSLog(@"TESTING SYNC");
 	[testPort sync];
-	
-	
 }
 
 /*
@@ -119,9 +118,6 @@
 
 
 -(void) testVersion {
-	
-	[[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName:@"Test Version" 
-																	  object:nil];
 	NSString * version = [testPort version];
 	STAssertNotNil(version, @"%@ should not be nil", version);
 }

Modified: branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.h	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.h	2008-07-16 04:53:32 UTC (rev 38329)
@@ -45,10 +45,12 @@
 @interface MPNotificationsListener : NSObject {
 	
 }
++ (MPNotificationsListener *)sharedListener;
 
 //Testing Key Value Compliance
 -(void)setInfoString:(NSString *)string;
 -(NSString *)infoString;
+-(void)doLocalNotifications;
 
 /*/This same class will observe its infoString key value
 //- (void) observeInfoString;

Modified: branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.m	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.m	2008-07-16 04:53:32 UTC (rev 38329)
@@ -106,6 +106,10 @@
 	return infoString;
 }
 
+- (void) doLocalNotifications {
+	
+}
+
 /*
 -(void) observeInfoString {
 	[self addObserver:self 

Modified: branches/gsoc08-framework/MacPorts_Framework/MPPort.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPPort.h	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPPort.h	2008-07-16 04:53:32 UTC (rev 38329)
@@ -142,12 +142,11 @@
 - (void)deactivateWithOptions:(NSArray *)options withVersion:(NSString *)version;
 
 
-#pragma mark --exec: and its convenience methods--
 /*
  MAYBE WE SHOULD MAKE THIS METHOD PRIVATE AND USE IT AS THE DEFAULT 
  IMPLEMENTATION OF PUBLIC METHOD BELOW ??
- */
 - (void)exec:(NSString *)target;
+ */
 
 /*!
  @brief Executes the specified target for this MPPort

Modified: branches/gsoc08-framework/MacPorts_Framework/MPPort.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPPort.m	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MPPort.m	2008-07-16 04:53:32 UTC (rev 38329)
@@ -142,6 +142,10 @@
 			arrayByAddingObjectsFromArray:[self valueForKey:@"depends_run"]];
 }
 
+
+/*
+ TO DO : Delete this method when scrubbing code
+ 
 - (void)exec:(NSString *)target {
 	MPInterpreter *interpreter;
 	interpreter = [MPInterpreter sharedInterpreter];
@@ -154,30 +158,11 @@
 		@"mportclose portHandle",
 		nil]];
 }
+*/
 
 
--(void)execPortProc:(NSString *)procedure withOptions:(NSArray *)options withVersion:(NSString *)version {
-	NSString *opts, *v;
-	MPInterpreter *interpreter;
-	opts = [NSString stringWithString:@" "];
-	v = [NSString stringWithString:[self name]];
-	interpreter = [MPInterpreter sharedInterpreter];
-	
-	if (version != NULL)
-		v = [NSString stringWithString:version];
-	else 
-		v = [NSString stringWithString:[self version]];
-	
-	if (options != NULL) 
-		opts = [NSString stringWithString:[options componentsJoinedByString:@" "]];	
-	
-	[interpreter evaluateStringAsString:
-	 [NSString stringWithFormat:
-	  @"[%@ %@ %@ %@]" ,
-	  procedure, [self name], v, opts]];
-}
 
-
+//This method is nice but really isn't used.
 - (void)execPortProc:(NSString *)procedure withParams:(NSArray *)params {
 	//params can contain either NSStrings or NSArrays
 	NSString * sparams = [NSString stringWithString:@" "];
@@ -204,18 +189,30 @@
 	 [NSString stringWithFormat:@"[%@ %@]" , procedure, sparams]];
 }
 
-- (void)uninstallWithOptions:(NSArray *)options withVersion:(NSString *)version {
-	[self execPortProc:@"mportuninstall" withOptions:options withVersion:version];
-}
 
-- (void)activateWithOptions:(NSArray *)options withVersion:(NSString *)version {
-	[self execPortProc:@"mportactivate" withOptions:options withVersion:version];
+//Used for mportactivate, mportdeactivate and mportuninstall
+-(void)execPortProc:(NSString *)procedure withOptions:(NSArray *)options withVersion:(NSString *)version {
+	NSString *opts, *v;
+	MPInterpreter *interpreter;
+	opts = [NSString stringWithString:@" "];
+	v = [NSString stringWithString:[self name]];
+	interpreter = [MPInterpreter sharedInterpreter];
+	
+	if (version != NULL)
+		v = [NSString stringWithString:version];
+	else 
+		v = [NSString stringWithString:[self version]];
+	
+	if (options != NULL) 
+		opts = [NSString stringWithString:[options componentsJoinedByString:@" "]];	
+	
+	[interpreter evaluateStringAsString:
+	 [NSString stringWithFormat:
+	  @"[%@ %@ %@ %@]" ,
+	  procedure, [self name], v, opts]];
 }
 
-- (void)deactivateWithOptions:(NSArray *)options withVersion:(NSString *)version {
-	[self execPortProc:@"mportdeactivate" withOptions:options withVersion:version];
-}
-
+//Used for the rest of other exec procedures
 -(void)exec:(NSString *)target withOptions:(NSArray *)options withVariants:(NSArray *)variants {
 	NSString *opts; 
 	NSString *vrnts;
@@ -237,51 +234,110 @@
 	  mportexec portHandle %@; \
 	  mportclose portHandle", 
 	  [self valueForKey:@"portURL"], opts, vrnts, target]];
+	
 }
 
+-(void)sendGlobalExecNotification:(NSString *)target withStatus:(NSString *)status {
+	NSString * notificationName = [NSString stringWithString:@"MacPorts"];
+	notificationName = [notificationName stringByAppendingString:target];
+	notificationName = [notificationName stringByAppendingString:status];
+	
+	//Should I be sending self as the object? Or should I send a newly created
+	//copy? What if the listener modifies this object? 
+	[[NSDistributedNotificationCenter defaultCenter] postNotificationName:notificationName 
+																   object:self]; 
+}
+
+
+
+#pragma mark -
+# pragma mark Exec methods 
+- (void)uninstallWithOptions:(NSArray *)options withVersion:(NSString *)version {
+	
+	[self sendGlobalExecNotification:@"Uninstall" withStatus:@"Started"];
+	[self execPortProc:@"mportuninstall" withOptions:options withVersion:version];
+	[self sendGlobalExecNotification:@"Uninstall" withStatus:@"Finished"];
+}
+
+- (void)activateWithOptions:(NSArray *)options withVersion:(NSString *)version {
+	[self sendGlobalExecNotification:@"Activate" withStatus:@"Started"];
+	[self execPortProc:@"mportactivate" withOptions:options withVersion:version];
+	[self sendGlobalExecNotification:@"Activate" withStatus:@"Finished"];
+}
+
+- (void)deactivateWithOptions:(NSArray *)options withVersion:(NSString *)version {
+	[self sendGlobalExecNotification:@"Deactivate" withStatus:@"Started"];
+	[self execPortProc:@"mportdeactivate" withOptions:options withVersion:version];
+	[self sendGlobalExecNotification:@"Deactivate" withStatus:@"Finished"];
+}
+
 -(void)configureWithOptions:(NSArray *)options withVariants:(NSArray *)variants{
+	[self sendGlobalExecNotification:@"Configure" withStatus:@"Started"];
 	[self exec:@"configure" withOptions:options withVariants:variants];
 }
 -(void)buildWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Build" withStatus:@"Started"];
 	[self exec:@"build" withOptions:options withVariants:variants];
 }
 -(void)testWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Test" withStatus:@"Started"];
 	[self exec:@"test" withOptions:options withVariants:variants];	
 }
 -(void)destrootWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Destroot" withStatus:@"Started"];
 	[self exec:@"destroot" withOptions:options withVariants:variants];
 }
 -(void)installWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Install" withStatus:@"Started"];
 	[self exec:@"install" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Install" withStatus:@"Finished"];
 }
 -(void)archiveWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Archive" withStatus:@"Started"];
 	[self exec:@"archive" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Archive" withStatus:@"Finished"];
 }
 -(void)createDmgWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Dmg" withStatus:@"Started"];
 	[self exec:@"dmg" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Dmg" withStatus:@"Finished"];
 }
 -(void)createMdmgWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Mdmg" withStatus:@"Started"];
 	[self exec:@"mdmg" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Mdmg" withStatus:@"Finished"];
 }
 -(void)createPkgWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Pkg" withStatus:@"Started"];
 	[self exec:@"pkg" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Pkg" withStatus:@"Finished"];
 }
 -(void)createMpkgWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Mpkg" withStatus:@"Started"];
 	[self exec:@"mpkg" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Mpkg" withStatus:@"Finished"];
 }
 -(void)createRpmWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Rpm" withStatus:@"Started"];
 	[self exec:@"rpm" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Rpm" withStatus:@"Finished"];
 }
 -(void)createDpkgWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Dpkg" withStatus:@"Started"];
 	[self exec:@"dpkg" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Dpkg" withStatus:@"Finished"];
 }
 -(void)createSrpmWithOptions:(NSArray *)options withVariants:(NSArray *)variants {
+	[self sendGlobalExecNotification:@"Srpm" withStatus:@"Started"];
 	[self exec:@"srpm" withOptions:options withVariants:variants];
+	[self sendGlobalExecNotification:@"Srpm" withStatus:@"Finished"];
 }
 
+# pragma mark -
 
-#pragma MPMutableDictionary Protocal
 
+#pragma mark MPMutableDictionary Protocal
+
 - (id)objectForKey:(id)aKey {
 	if ([aKey isEqualToString:@"receipts"] && ![super objectForKey:aKey]) {
 		[self setObject:[[[MPRegistry sharedRegistry] installed:[self objectForKey:@"name"]] objectForKey:[self objectForKey:@"name"]]forKey:aKey];

Modified: branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/Armahg.mode1v3
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/Armahg.mode1v3	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/Armahg.mode1v3	2008-07-16 04:53:32 UTC (rev 38329)
@@ -197,7 +197,48 @@
 	<key>Notifications</key>
 	<array/>
 	<key>OpenEditors</key>
-	<array/>
+	<array>
+		<dict>
+			<key>Content</key>
+			<dict>
+				<key>PBXProjectModuleGUID</key>
+				<string>6E44A0040E2DAC0D007DE8EC</string>
+				<key>PBXProjectModuleLabel</key>
+				<string>MPMacPorts.m</string>
+				<key>PBXSplitModuleInNavigatorKey</key>
+				<dict>
+					<key>Split0</key>
+					<dict>
+						<key>PBXProjectModuleGUID</key>
+						<string>6E44A0050E2DAC0D007DE8EC</string>
+						<key>PBXProjectModuleLabel</key>
+						<string>MPMacPorts.m</string>
+						<key>_historyCapacity</key>
+						<integer>0</integer>
+						<key>bookmark</key>
+						<string>6E44A0060E2DAC0D007DE8EC</string>
+						<key>history</key>
+						<array>
+							<string>6E449FE20E2D9CD8007DE8EC</string>
+						</array>
+					</dict>
+					<key>SplitCount</key>
+					<string>1</string>
+				</dict>
+				<key>StatusBarVisibility</key>
+				<true/>
+			</dict>
+			<key>Geometry</key>
+			<dict>
+				<key>Frame</key>
+				<string>{{0, 20}, {865, 681}}</string>
+				<key>PBXModuleWindowStatusBarHidden2</key>
+				<false/>
+				<key>RubberWindowFrame</key>
+				<string>57 56 865 722 0 0 1152 778 </string>
+			</dict>
+		</dict>
+	</array>
 	<key>PerspectiveWidths</key>
 	<array>
 		<integer>-1</integer>
@@ -234,8 +275,6 @@
 			<key>Layout</key>
 			<array>
 				<dict>
-					<key>BecomeActive</key>
-					<true/>
 					<key>ContentConfiguration</key>
 					<dict>
 						<key>PBXBottomSmartGroupGIDs</key>
@@ -260,7 +299,7 @@
 						<dict>
 							<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
 							<array>
-								<real>266</real>
+								<real>276</real>
 							</array>
 							<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
 							<array>
@@ -273,9 +312,9 @@
 							<array>
 								<string>0867D691FE84028FC02AAC07</string>
 								<string>6EA293540E05C8C600902D12</string>
-								<string>6E88D1760DF46A2600684E9F</string>
 								<string>08FB77AEFE84172EC02AAC07</string>
 								<string>089C1665FE841158C02AAC07</string>
+								<string>4822AAD40D7EB39200C4D4D7</string>
 								<string>034768DFFF38A50411DB9C8B</string>
 								<string>1C37FBAC04509CD000000102</string>
 								<string>1C37FABC05509CD000000102</string>
@@ -283,13 +322,13 @@
 							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
 							<array>
 								<array>
-									<integer>28</integer>
-									<integer>27</integer>
+									<integer>20</integer>
+									<integer>8</integer>
 									<integer>0</integer>
 								</array>
 							</array>
 							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
-							<string>{{0, 354}, {266, 420}}</string>
+							<string>{{0, 184}, {276, 565}}</string>
 						</dict>
 						<key>PBXTopSmartGroupGIDs</key>
 						<array/>
@@ -301,30 +340,32 @@
 					<key>GeometryConfiguration</key>
 					<dict>
 						<key>Frame</key>
-						<string>{{0, 0}, {283, 438}}</string>
+						<string>{{0, 0}, {293, 583}}</string>
 						<key>GroupTreeTableConfiguration</key>
 						<array>
 							<string>MainColumn</string>
-							<real>266</real>
+							<real>276</real>
 						</array>
 						<key>RubberWindowFrame</key>
-						<string>180 28 1015 479 0 0 1152 778 </string>
+						<string>76 151 1013 624 0 0 1152 778 </string>
 					</dict>
 					<key>Module</key>
 					<string>PBXSmartGroupTreeModule</string>
 					<key>Proportion</key>
-					<string>283pt</string>
+					<string>293pt</string>
 				</dict>
 				<dict>
 					<key>Dock</key>
 					<array>
 						<dict>
+							<key>BecomeActive</key>
+							<true/>
 							<key>ContentConfiguration</key>
 							<dict>
 								<key>PBXProjectModuleGUID</key>
 								<string>1CE0B20306471E060097A5F4</string>
 								<key>PBXProjectModuleLabel</key>
-								<string>MPInterpreterTest.m</string>
+								<string>MPPort.m</string>
 								<key>PBXSplitModuleInNavigatorKey</key>
 								<dict>
 									<key>Split0</key>
@@ -332,48 +373,48 @@
 										<key>PBXProjectModuleGUID</key>
 										<string>1CE0B20406471E060097A5F4</string>
 										<key>PBXProjectModuleLabel</key>
-										<string>MPInterpreterTest.m</string>
+										<string>MPPort.m</string>
 										<key>_historyCapacity</key>
 										<integer>0</integer>
 										<key>bookmark</key>
-										<string>6EEB12000E2A9FBE00BFEC81</string>
+										<string>6E44A0030E2DAC0D007DE8EC</string>
 										<key>history</key>
 										<array>
 											<string>6E1AE7F20E22E34900F6D7BC</string>
-											<string>6EF770400E250CFA00E0115E</string>
-											<string>6EF2D9B70E25474100D896EC</string>
 											<string>6EF2D9CB0E254F6900D896EC</string>
 											<string>6EF2DA130E25763E00D896EC</string>
 											<string>6EF2DAC00E26BBD500D896EC</string>
 											<string>6EF2DAEC0E2809E400D896EC</string>
-											<string>6EF2DAED0E2809E400D896EC</string>
 											<string>6EF2DAEF0E2809E400D896EC</string>
-											<string>6EF2DB260E2902CF00D896EC</string>
-											<string>6EF2DB430E290A6D00D896EC</string>
-											<string>6EF2DB440E290A6D00D896EC</string>
 											<string>6EF2DB550E290E2C00D896EC</string>
-											<string>6EF2DB6E0E292BB500D896EC</string>
-											<string>6EF2DB700E292BB500D896EC</string>
 											<string>6EF2DBF50E29439200D896EC</string>
-											<string>6EF2DC530E29480500D896EC</string>
-											<string>6EF2DC680E294C7C00D896EC</string>
-											<string>6EF2DC690E294C7C00D896EC</string>
-											<string>6EF2DC6A0E294C7C00D896EC</string>
-											<string>6EF2DC6B0E294C7C00D896EC</string>
-											<string>6EF2DC6C0E294C7C00D896EC</string>
-											<string>6EF2DC9F0E29863700D896EC</string>
-											<string>6EEB11E50E2A945400BFEC81</string>
-											<string>6EEB11E60E2A945400BFEC81</string>
 											<string>6EEB11E70E2A945400BFEC81</string>
-											<string>6EEB11FB0E2A94E200BFEC81</string>
-											<string>6EEB11F80E2A94E000BFEC81</string>
+											<string>6EEB12B70E2BF43E00BFEC81</string>
+											<string>6EEB12B80E2BF43E00BFEC81</string>
+											<string>6EEB12B90E2BF43E00BFEC81</string>
+											<string>6EEB134F0E2C0AC900BFEC81</string>
+											<string>6EEB13780E2C336000BFEC81</string>
+											<string>6EEB13880E2C34EF00BFEC81</string>
+											<string>6EEB14300E2CAF3600BFEC81</string>
+											<string>6EEB14310E2CAF3600BFEC81</string>
+											<string>6EEB14320E2CAF3600BFEC81</string>
+											<string>6EEB14340E2CAF3600BFEC81</string>
+											<string>6EEB14350E2CAF3600BFEC81</string>
+											<string>6E27952A0E2D830600A52316</string>
+											<string>6E2B2FED0E2D85F4007CCF96</string>
+											<string>6E449FF30E2DAC0D007DE8EC</string>
+											<string>6E449FF40E2DAC0D007DE8EC</string>
+											<string>6E449FF50E2DAC0D007DE8EC</string>
+											<string>6E449FF60E2DAC0D007DE8EC</string>
+											<string>6E449FF70E2DAC0D007DE8EC</string>
+											<string>6E449FF80E2DAC0D007DE8EC</string>
+											<string>6E449FF90E2DAC0D007DE8EC</string>
 										</array>
 										<key>prevStack</key>
 										<array>
 											<string>6E1AE7F40E22E34900F6D7BC</string>
 											<string>6E1AE7F50E22E34900F6D7BC</string>
 											<string>6E1AE8130E23198900F6D7BC</string>
-											<string>6E1AE8140E23198900F6D7BC</string>
 											<string>6E1AE8260E231A6A00F6D7BC</string>
 											<string>6EF770480E250CFA00E0115E</string>
 											<string>6EF770490E250CFA00E0115E</string>
@@ -390,17 +431,25 @@
 											<string>6EF2DA150E25763E00D896EC</string>
 											<string>6EF2DA310E257ADF00D896EC</string>
 											<string>6EF2DAC70E26BBD500D896EC</string>
-											<string>6EF2DB2B0E2902CF00D896EC</string>
 											<string>6EF2DC000E29439200D896EC</string>
 											<string>6EF2DC010E29439200D896EC</string>
 											<string>6EF2DC040E29439200D896EC</string>
 											<string>6EF2DC790E294C7C00D896EC</string>
 											<string>6EF2DC890E294CE900D896EC</string>
-											<string>6EEB11E90E2A945400BFEC81</string>
-											<string>6EEB11EA0E2A945400BFEC81</string>
-											<string>6EEB11EB0E2A945400BFEC81</string>
 											<string>6EEB11EC0E2A945400BFEC81</string>
-											<string>6EEB11FC0E2A94E200BFEC81</string>
+											<string>6EEB12C90E2BF43E00BFEC81</string>
+											<string>6EEB12D00E2BF43E00BFEC81</string>
+											<string>6EEB130A0E2BFA7900BFEC81</string>
+											<string>6EEB132A0E2C021C00BFEC81</string>
+											<string>6E449FFA0E2DAC0D007DE8EC</string>
+											<string>6E449FFB0E2DAC0D007DE8EC</string>
+											<string>6E449FFC0E2DAC0D007DE8EC</string>
+											<string>6E449FFD0E2DAC0D007DE8EC</string>
+											<string>6E449FFE0E2DAC0D007DE8EC</string>
+											<string>6E449FFF0E2DAC0D007DE8EC</string>
+											<string>6E44A0000E2DAC0D007DE8EC</string>
+											<string>6E44A0010E2DAC0D007DE8EC</string>
+											<string>6E44A0020E2DAC0D007DE8EC</string>
 										</array>
 									</dict>
 									<key>SplitCount</key>
@@ -412,14 +461,14 @@
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 0}, {727, 240}}</string>
+								<string>{{0, 0}, {715, 372}}</string>
 								<key>RubberWindowFrame</key>
-								<string>180 28 1015 479 0 0 1152 778 </string>
+								<string>76 151 1013 624 0 0 1152 778 </string>
 							</dict>
 							<key>Module</key>
 							<string>PBXNavigatorGroup</string>
 							<key>Proportion</key>
-							<string>240pt</string>
+							<string>372pt</string>
 						</dict>
 						<dict>
 							<key>ContentConfiguration</key>
@@ -432,18 +481,18 @@
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 245}, {727, 193}}</string>
+								<string>{{0, 377}, {715, 206}}</string>
 								<key>RubberWindowFrame</key>
-								<string>180 28 1015 479 0 0 1152 778 </string>
+								<string>76 151 1013 624 0 0 1152 778 </string>
 							</dict>
 							<key>Module</key>
 							<string>XCDetailModule</string>
 							<key>Proportion</key>
-							<string>193pt</string>
+							<string>206pt</string>
 						</dict>
 					</array>
 					<key>Proportion</key>
-					<string>727pt</string>
+					<string>715pt</string>
 				</dict>
 			</array>
 			<key>Name</key>
@@ -458,9 +507,9 @@
 			</array>
 			<key>TableOfContents</key>
 			<array>
-				<string>6EEB11EE0E2A945400BFEC81</string>
+				<string>6E449FDA0E2D8FD0007DE8EC</string>
 				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>6EEB11EF0E2A945400BFEC81</string>
+				<string>6E449FDB0E2D8FD0007DE8EC</string>
 				<string>1CE0B20306471E060097A5F4</string>
 				<string>1CE0B20506471E060097A5F4</string>
 			</array>
@@ -594,11 +643,13 @@
 	<integer>5</integer>
 	<key>WindowOrderList</key>
 	<array>
+		<string>1C530D57069F1CE1000CFCEE</string>
 		<string>6E1AE7FA0E22E34900F6D7BC</string>
+		<string>6E44A0040E2DAC0D007DE8EC</string>
 		<string>/Users/Armahg/gsoc08/MacPorts_Framework/MacPorts.Framework.xcodeproj</string>
 	</array>
 	<key>WindowString</key>
-	<string>180 28 1015 479 0 0 1152 778 </string>
+	<string>76 151 1013 624 0 0 1152 778 </string>
 	<key>WindowToolsV3</key>
 	<array>
 		<dict>
@@ -619,21 +670,21 @@
 								<key>PBXProjectModuleGUID</key>
 								<string>1CD0528F0623707200166675</string>
 								<key>PBXProjectModuleLabel</key>
-								<string>MPInterpreterTest.m</string>
+								<string></string>
 								<key>StatusBarVisibility</key>
 								<true/>
 							</dict>
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 0}, {1001, 287}}</string>
+								<string>{{0, 0}, {925, 236}}</string>
 								<key>RubberWindowFrame</key>
-								<string>102 147 1001 608 0 0 1152 778 </string>
+								<string>144 150 925 597 0 0 1152 778 </string>
 							</dict>
 							<key>Module</key>
 							<string>PBXNavigatorGroup</string>
 							<key>Proportion</key>
-							<string>287pt</string>
+							<string>236pt</string>
 						</dict>
 						<dict>
 							<key>BecomeActive</key>
@@ -641,7 +692,7 @@
 							<key>ContentConfiguration</key>
 							<dict>
 								<key>PBXBuildLogShowsTranscriptDefaultKey</key>
-								<string>{{0, 189}, {1001, 86}}</string>
+								<string>{{0, 177}, {925, 138}}</string>
 								<key>PBXProjectModuleGUID</key>
 								<string>XCMainBuildResultsModuleGUID</string>
 								<key>PBXProjectModuleLabel</key>
@@ -654,18 +705,18 @@
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 292}, {1001, 275}}</string>
+								<string>{{0, 241}, {925, 315}}</string>
 								<key>RubberWindowFrame</key>
-								<string>102 147 1001 608 0 0 1152 778 </string>
+								<string>144 150 925 597 0 0 1152 778 </string>
 							</dict>
 							<key>Module</key>
 							<string>PBXBuildResultsModule</string>
 							<key>Proportion</key>
-							<string>275pt</string>
+							<string>315pt</string>
 						</dict>
 					</array>
 					<key>Proportion</key>
-					<string>567pt</string>
+					<string>556pt</string>
 				</dict>
 			</array>
 			<key>Name</key>
@@ -679,18 +730,18 @@
 			<key>TableOfContents</key>
 			<array>
 				<string>6E1AE7FA0E22E34900F6D7BC</string>
-				<string>6EEB11E20E2A944000BFEC81</string>
+				<string>6E449FDC0E2D8FD0007DE8EC</string>
 				<string>1CD0528F0623707200166675</string>
 				<string>XCMainBuildResultsModuleGUID</string>
 			</array>
 			<key>ToolbarConfiguration</key>
 			<string>xcode.toolbar.config.buildV3</string>
 			<key>WindowString</key>
-			<string>102 147 1001 608 0 0 1152 778 </string>
+			<string>144 150 925 597 0 0 1152 778 </string>
 			<key>WindowToolGUID</key>
 			<string>6E1AE7FA0E22E34900F6D7BC</string>
 			<key>WindowToolIsVisible</key>
-			<false/>
+			<true/>
 		</dict>
 		<dict>
 			<key>Identifier</key>
@@ -815,7 +866,7 @@
 										<key>PBXProjectModuleGUID</key>
 										<string>1CDD528C0622207200134675</string>
 										<key>PBXProjectModuleLabel</key>
-										<string>MPNotificationsListener.m</string>
+										<string>MPIndex.m</string>
 										<key>StatusBarVisibility</key>
 										<true/>
 									</dict>
@@ -873,8 +924,8 @@
 			<key>TableOfContents</key>
 			<array>
 				<string>1C530D57069F1CE1000CFCEE</string>
-				<string>6EF2DABD0E26B8ED00D896EC</string>
-				<string>6EF2DABE0E26B8ED00D896EC</string>
+				<string>6E449FF10E2DABDB007DE8EC</string>
+				<string>6E449FF20E2DABDB007DE8EC</string>
 				<string>1CDD528C0622207200134675</string>
 				<string>1CD0528E0623707200166675</string>
 			</array>

Modified: branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj	2008-07-16 04:53:32 UTC (rev 38329)
@@ -40,9 +40,11 @@
 		48E9939F0C82CEB000219DDF /* init.tcl in Resources */ = {isa = PBXBuildFile; fileRef = 48E9939E0C82CEB000219DDF /* init.tcl */; };
 		6E270D090E158CED00BAE687 /* MPNotificationsListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E270D070E158CED00BAE687 /* MPNotificationsListener.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		6E270D0A0E158CED00BAE687 /* MPNotificationsListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E270D080E158CED00BAE687 /* MPNotificationsListener.m */; };
+		6E44A00D0E2DAD66007DE8EC /* ToDo.txt in Resources */ = {isa = PBXBuildFile; fileRef = 6E44A00C0E2DAD66007DE8EC /* ToDo.txt */; };
 		6E49F37B0DFFAB0B0030C3AF /* MPInterpreterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 489DD92E0C94674B00595506 /* MPInterpreterTest.m */; };
 		6E49F37F0DFFAFF80030C3AF /* MacPorts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* MacPorts.framework */; };
 		6EA294590E080DEB00902D12 /* MPMacPortsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E88D1CB0DF4B90B00684E9F /* MPMacPortsTest.m */; };
+		6EEB13000E2BFA3000BFEC81 /* notifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EEB12FF0E2BFA3000BFEC81 /* notifications.h */; };
 		8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
 		8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
 /* End PBXBuildFile section */
@@ -89,11 +91,13 @@
 		6E270C080E148F4E00BAE687 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
 		6E270D070E158CED00BAE687 /* MPNotificationsListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPNotificationsListener.h; sourceTree = "<group>"; };
 		6E270D080E158CED00BAE687 /* MPNotificationsListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPNotificationsListener.m; sourceTree = "<group>"; };
+		6E44A00C0E2DAD66007DE8EC /* ToDo.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ToDo.txt; sourceTree = "<group>"; };
 		6E88D1CA0DF4B90B00684E9F /* MPMacPortsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPMacPortsTest.h; sourceTree = "<group>"; };
 		6E88D1CB0DF4B90B00684E9F /* MPMacPortsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPMacPortsTest.m; sourceTree = "<group>"; };
 		6EA0F56E0DFEB55E00C15082 /* Tcl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tcl.framework; path = System/Library/Frameworks/Tcl.framework; sourceTree = SDKROOT; };
 		6EA293570E05C8FC00902D12 /* notifications.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = notifications.m; sourceTree = "<group>"; };
 		6EAFD8B70DEC614E00E97270 /* dummycommit.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dummycommit.test; sourceTree = "<group>"; };
+		6EEB12FF0E2BFA3000BFEC81 /* notifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = notifications.h; sourceTree = "<group>"; };
 		8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
 		8DC2EF5B0486A6940098B216 /* MacPorts.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MacPorts.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
@@ -161,6 +165,7 @@
 				089C1666FE841158C02AAC07 /* InfoPlist.strings */,
 				489DD8F50C94365F00595506 /* Test-Info.plist */,
 				6EAFD8B70DEC614E00E97270 /* dummycommit.test */,
+				6E44A00C0E2DAD66007DE8EC /* ToDo.txt */,
 			);
 			name = Resources;
 			sourceTree = "<group>";
@@ -240,6 +245,7 @@
 				6EA293570E05C8FC00902D12 /* notifications.m */,
 				6E270D070E158CED00BAE687 /* MPNotificationsListener.h */,
 				6E270D080E158CED00BAE687 /* MPNotificationsListener.m */,
+				6EEB12FF0E2BFA3000BFEC81 /* notifications.h */,
 			);
 			name = "Tcl Notifications ";
 			sourceTree = "<group>";
@@ -260,6 +266,7 @@
 				48A866AA0CD364F700B521BC /* MPReceipt.h in Headers */,
 				481D04A20CDAAAFD00D4A550 /* MPMutableDictionary.h in Headers */,
 				6E270D090E158CED00BAE687 /* MPNotificationsListener.h in Headers */,
+				6EEB13000E2BFA3000BFEC81 /* notifications.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -289,7 +296,6 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "MacPorts" */;
 			buildPhases = (
-				6E270C870E14DF5C00BAE687 /* ShellScript */,
 				8DC2EF500486A6940098B216 /* Headers */,
 				8DC2EF520486A6940098B216 /* Resources */,
 				8DC2EF540486A6940098B216 /* Sources */,
@@ -343,6 +349,7 @@
 			files = (
 				8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
 				48E9939F0C82CEB000219DDF /* init.tcl in Resources */,
+				6E44A00D0E2DAD66007DE8EC /* ToDo.txt in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -360,21 +367,8 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\nrm -rf notifications.dylib\n";
+			shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\n#rm -rf notifications.dylib";
 		};
-		6E270C870E14DF5C00BAE687 /* ShellScript */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "if [ -e notifications.dylib ]\n\tthen echo \"Notifications library exists\"\nelse\n\tmake\nfi";
-		};
 		6E49F4F40E00DD520030C3AF /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -469,8 +463,10 @@
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
 				);
 				LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)\"";
 				PRODUCT_NAME = MacPorts;
 				SYMROOT = "~/Builds";
 				WRAPPER_EXTENSION = framework;
@@ -494,8 +490,10 @@
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
+					"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
 				);
 				LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\"";
+				LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)\"";
 				PRODUCT_NAME = MacPorts;
 				WRAPPER_EXTENSION = framework;
 				ZERO_LINK = NO;

Added: branches/gsoc08-framework/MacPorts_Framework/ToDo.txt
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/ToDo.txt	                        (rev 0)
+++ branches/gsoc08-framework/MacPorts_Framework/ToDo.txt	2008-07-16 04:53:32 UTC (rev 38329)
@@ -0,0 +1,21 @@
+TO DO LIST (because there seems to be too much to get done haha)
+
+
+
+Get feedback on Notifications idea and implementation
+
+
+
+Test Notifications Library ... how? ... use the Tester ...
+and see if the rest of the tests build
+
+Create my own branch of src ? Yes ... do that and add  your patches
+
+
+Guide like documentation
+
+Scrub Code
+
+Rearrange methods orderings in both .h and .m files
+and add appropriate pragma marks for more readablity
+


Property changes on: branches/gsoc08-framework/MacPorts_Framework/ToDo.txt
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: branches/gsoc08-framework/MacPorts_Framework/dummycommit.test
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/dummycommit.test	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/dummycommit.test	2008-07-16 04:53:32 UTC (rev 38329)
@@ -1,14 +0,0 @@
-TO DO LIST (because there seems to be too much to get done haha)
-
-
-
-Get feedback on Notifications idea and implementation
-
-
-
-Test Notifications Library ... how? ... use the Tester ...
-and see if the rest of the tests build
-
-Create my own branch of src ? Yes ... do that and add  your patches
-
-

Modified: branches/gsoc08-framework/MacPorts_Framework/init.tcl
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/init.tcl	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/init.tcl	2008-07-16 04:53:32 UTC (rev 38329)
@@ -1,14 +1,13 @@
-catch {source \
-	[file join "/Library/Tcl" macports1.0 macports_fastload.tcl]}
+#catch {source \
+#	[file join "/Library/Tcl" macports1.0 macports_fastload.tcl]}
 
 #Trying my own MacPorts build rather than default one on the system
-#catch {source \
-#	[file join "/Users/Armahg/macportsbuild/build1/Library/Tcl" macports1.0 macports_fastload.tcl]}
+catch {source \
+	[file join "/Users/Armahg/macportsbuild/build1/Library/Tcl" macports1.0 macports_fastload.tcl]}
 
+#load notifications.dylib
 
-load notifications.dylib
 
-
 package require macports
 package require notifications
 
@@ -75,11 +74,93 @@
 }
 
 
+#Helper function for sending notifications 
+#Action taken is based on priority
+#ui_msg - Sent as local notifications
+#ui_debug - Don't know what to do with this for now
+#ui_warn - Send as local notification ?
+#ui_error - Send as local notification ? 
+#ui_info - Also don't know what to do with this for now
+#Remember to strip possible possible preceding "--->" from message
+
+proc notify_system {priority prefix chan str} {
+	set newstr [string trimleft $str "--->"]
+	
+	#puts $newstr
+	
+	switch $priority {
+		#For now, send these as message notifications to
+		#client application. I really think we need some more
+		#granularity, how is someone suppose to know if the 
+		#message is coming from the result of a sync, selfupdate,
+		#exec call etc. ?
+		#Suggestion : We can either have user's modify a variable that
+		#indicates the current mport operation being performed or we can
+		#inquire from the interpreter and change the notification name
+		#based on that.
+		
+		msg {
+			notifications send "MPMsgNotification" \
+			"Channel $chan Prefix $prefix" $newstr 
+		}
+		debug {
+			#For now we don't need to do anything with these?
+			#The user can scrape stdout for them
+		}
+		warn {
+			notifications send "MPWarnNotification" \
+			"Channel $chan Prefix $prefix" $newstr
+		}
+		error {
+			notifications send global "MPErrorNotification" \
+			"Channel $chan Prefix $prefix" $newstr
+		}
+		info {
+			notifications send "MPInfoNotification" \
+			"Channel $chan Prefix $prefix" $newstr
+		}
+		default {
+			#Don't send anything for now
+		}			
+	}
+}
+
+
+
 #Modifying UI initialization to enable notifications
 #Redefine ui_$pritority to throw global notifications
 #This is currently under works ... a reasonable solution
 #should be coming up soon
 proc ui_init {priority prefix channels message} {
+	
+	switch $priority {
+		msg {
+			set nottype "MPMsgNotification" 
+			set sendNotification "true"
+		}
+		debug {
+			#For now we don't need to do anything with these?
+			#The user can scrape stdout for them
+			set sendNotification "false"
+		}
+		warn {
+			set nottype "MPWarnNotification"
+			set sendNotification "true"
+		}
+		error {
+			set nottype "MPErrorNotification"
+			set sendNotification "true"
+		}
+		info {
+			set nottype "MPInfoNotification"
+			set sendNotification "true"
+		}
+		default {
+			#Don't send anything for now
+			set nottype "MPDefaultNotification"
+			set sendNotification "false"
+		}	
+	}
     # Get the list of channels.
     try {
         set channels [ui_channels $priority]
@@ -91,8 +172,13 @@
     set nbchans [llength $channels]
     if {$nbchans == 0} {
         proc ::ui_$priority {str} [subst {
-        		notifications send global "MP $priority Notification" "Channel1 none \
-        		Prefix $prefix" "\$str"
+        		#notifications send global "MP $priority Notification" "Channel1 none \
+        		#Prefix $prefix" "\$str"
+        		#notify_system $priority $prefix "none" $message 
+				
+				if {$sendNotification == "true"} {
+					notifications send $nottype "Channel $chan Prefix $prefix" "\$str"
+				}
         }]
     } else {
         try {
@@ -109,21 +195,30 @@
                 
                 proc ::ui_$priority {str} [subst { 
                 	puts $chan "$prefix\$str"
-                	notifications send global "MP $priority Notifications" "Channel2 $chan \
-                	Prefix $prefix" "\$str" 
+                	#notifications send "MP $priority Notifications" "Channel2 $chan \
+                	#Prefix $prefix" "\$str"
+					#notify_system $priority $prefix $chan "\$str"
+					
+					if {$sendNotification == "true"} {
+						notifications send $nottype "Channel $chan Prefix $prefix" "\$str"
+					}
                 }]
             } else {
             		
                 proc ::ui_$priority {str} [subst {
                     foreach chan \$channels {
                         puts $chan "$prefix\$str"
+                        #notify_system $priority $prefix $chan $message
+						#notifications send global "MP $priority Notifications" "Channel3 $chan \
+						#Prefix $prefix" "\$str"
+						
+						if {$sendNotification == "true"} {
+							notifications send $nottype "Channel $chan Prefix $prefix" "\$str"
+						}
                     }
-                    notifications send global "MP $priority Notifications" "Channel3 $chan \
-                    Prefix $prefix" "\$str"
                 }]
             }
         }
-
         # Call ui_$priority
         ::ui_$priority $message
     }

Modified: branches/gsoc08-framework/MacPorts_Framework/notifications.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/notifications.m	2008-07-15 23:07:33 UTC (rev 38328)
+++ branches/gsoc08-framework/MacPorts_Framework/notifications.m	2008-07-16 04:53:32 UTC (rev 38329)
@@ -34,10 +34,9 @@
 
 
 
-#include <tcl.h>
-#include "MPNotificationsListener.h"
-#include <Cocoa/Cocoa.h>
 
+#import "notifications.h"
+
 int Notifications_Send(int objc, Tcl_Obj *CONST objv[], int global, Tcl_Interp *interpreter) {
 	NSString *name , *msg;
 	NSMutableDictionary *info = nil;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080715/1ca90a9f/attachment-0001.html 


More information about the macports-changes mailing list