[38217] branches/gsoc08-framework/MacPorts_Framework
armahg at macports.org
armahg at macports.org
Sat Jul 12 13:38:37 PDT 2008
Revision: 38217
http://trac.macosforge.org/projects/macports/changeset/38217
Author: armahg at macports.org
Date: 2008-07-12 13:38:36 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
Coded most sane solution for MacPorts.Framework <-> MacPorts Tcl API notifications yet. Need to check with Randall on why so many Error msgs are being logged for mportsync
Modified Paths:
--------------
branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h
branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m
branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.h
branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m
branches/gsoc08-framework/MacPorts_Framework/MPMutableDictionary.h
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/MPReceipt.h
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/Makefile
branches/gsoc08-framework/MacPorts_Framework/dummycommit.test
branches/gsoc08-framework/MacPorts_Framework/init.tcl
branches/gsoc08-framework/MacPorts_Framework/notifications.m
Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.h 2008-07-12 20:38:36 UTC (rev 38217)
@@ -75,7 +75,7 @@
- (void)sync;
/*!
@brief Synchronizes the ports tree and checks for upgrades to MacPorts base.
- @discussion The selfupdate port command is available only on Mac OS X systems.s
+ @discussion The selfupdate port command is available only on Mac OS X systems.
*/
- (void)selfUpdate;
@@ -88,17 +88,17 @@
*/
- (NSDictionary *)search:(NSString *)query;
/*!
- @brief Returns an NSDictionary of ports. Calls [self search:query caseSensitive:sensitivity matchStyle:@"regex"].
+ @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
*/
- (NSDictionary *)search:(NSString *)query caseSensitive:(BOOL)sensitivity;
/*!
- @brief Returns an NSDictionary of ports. Calls [self search:query caseSensitive:sensitivity matchStyle:style field:@"name"].
+ @brief Returns an NSDictionary of ports. Calls [self search:query caseSensitive:sensitivity matchStyle:style field:\@"name"].
@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 TALK TO RANDALL ABOUT WHAT THIS IS
+ @param style Search style for query
@discussion The keys are NSString names of the ports whilst the values are the respective MPPort objects
*/
- (NSDictionary *)search:(NSString *)query caseSensitive:(BOOL)sensitivity matchStyle:(NSString *)style;
@@ -106,8 +106,8 @@
@brief Returns an NSDictionary of ports
@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 TALK TO RANDALL ABOUT WHAT THIS IS
- @param fieldName TALK TO RANDALL ABOUT WHAT THIS IS
+ @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
*/
- (NSDictionary *)search:(NSString *)query caseSensitive:(BOOL)sensitivity matchStyle:(NSString *)style field:(NSString *)fieldName;
@@ -119,9 +119,7 @@
*/
- (NSArray *)depends:(MPPort *)port;
-/*
- PRIVATE METHOD USED AS DEFAULT FOR METHOD BELOW
- */
+
- (void)exec:(MPPort *)port withTarget:(NSString *)target;
/*!
@@ -130,7 +128,7 @@
@param target The NSString representing a given target
@param options An NSArray of NSStrings of options for executing this target
@param variants An NSArray of NSStrings of variants for executing this target
- @Discussion See -exec: withOptions: withVariants: in @link MPPort MPPort @\link for discussion
+ @Discussion See -exec: withOptions: withVariants: in @link //apple_ref/doc/header/MPPort.h MPPort @/link for discussion
of this method.
*/
- (void)exec:(MPPort *)port withTarget:(NSString *)target withOptions:(NSArray *)options withVariants:(NSArray *)variants;
@@ -166,4 +164,10 @@
@brief Returns an NSString indicating the version of the currently running MacPorts system
*/
- (NSString *)version;
+
+
+//Notifications stuff
+-(void)registerForLocalNotification;
+-(void)respondToLocalNotification:(NSNotification *) notification;
+
@end
Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m 2008-07-12 20:38:36 UTC (rev 38217)
@@ -41,6 +41,7 @@
- (id) init {
if (self = [super init]) {
interpreter = [MPInterpreter sharedInterpreter];
+ [self registerForLocalNotification];
}
return self;
}
@@ -188,4 +189,22 @@
return version;
}
+
+-(void) registerForLocalNotification {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(respondToLocalNotification:)
+ name:@"testMacPortsNotification"
+ object:nil];
+}
+
+-(void) respondToLocalNotification:(NSNotification *)notification {
+ id sentObject = [notification object];
+
+ //Just NSLog it for now
+ if(sentObject == nil)
+ NSLog(@"Looooo caaaaal");
+ else
+ NSLog(@"%@" , NSStringFromClass([sentObject class]));
+}
+
@end
Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.h 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.h 2008-07-12 20:38:36 UTC (rev 38217)
@@ -51,9 +51,9 @@
-(void) testSources;
-(void) testPathToPortIndex;
//-(void) testDepends;
--(void) testSearch;
+//-(void) testSearch;
-(void) testSync;
-(void) testVersion;
--(void) testInstall;
+//-(void) testInstall;
@end
Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPortsTest.m 2008-07-12 20:38:36 UTC (rev 38217)
@@ -75,7 +75,7 @@
}
-(void) testSearch {
- NSDictionary *searchResults = [testPort search:@"Notification"];
+ NSDictionary *searchResults = [testPort search:@"/Users/Armahg"];
STAssertNotNil(searchResults, @"This dictionary should have at least %d key value pairs", [searchResults count]);
}
@@ -85,14 +85,19 @@
//and take actions as appropriate
[testPort sync];
+
}
+/*
-(void) testSelfupdate {
//The only way to test this that I know of is to listen for the posted notifications
//and take actions as appropriate
[testPort selfUpdate];
}
+*/
+
+
-(void) listenForPortSync {
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(actOnPortSync:)
Modified: branches/gsoc08-framework/MacPorts_Framework/MPMutableDictionary.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMutableDictionary.h 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMutableDictionary.h 2008-07-12 20:38:36 UTC (rev 38217)
@@ -6,6 +6,12 @@
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
+/*!
+ @header
+ MPMutableDictionary is a customized NSMutableDictionary object that
+ serves as the base of most MacPort Framework objects.
+ */
+
#import <Cocoa/Cocoa.h>
/*!
Modified: branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.h 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.h 2008-07-12 20:38:36 UTC (rev 38217)
@@ -1,5 +1,5 @@
/*
- * $Id:$
+ * $Id$
* MacPorts.Framework
*
* Authors:
@@ -43,12 +43,18 @@
*/
@interface MPNotificationsListener : NSObject {
-
+
}
+//Testing Key Value Compliance
+-(void)setInfoString:(NSString *)string;
+-(NSString *)infoString;
+
+/*/This same class will observe its infoString key value
+//- (void) observeInfoString;
-(void)registerForGlobalNotification;
-(void)registerForLocalNotification;
-(void)respondToGlobalNotification:(NSNotification*) notification;
-(void)respondToLocalNotification:(NSNotification *) notification;
-
+*/
@end
Modified: branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.m 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPNotificationsListener.m 2008-07-12 20:38:36 UTC (rev 38217)
@@ -1,5 +1,5 @@
/*
- * $Id:$
+ * $Id$
* MacPorts.Framework
*
* Authors:
@@ -39,11 +39,53 @@
@implementation MPNotificationsListener
+static MPNotificationsListener *sharedMPListener = nil;
+static NSString *infoString;
+
++ (MPNotificationsListener *)sharedListener {
+ @synchronized(self) {
+ if (sharedMPListener == nil) {
+ [[self alloc] init];
+ }
+ }
+ return sharedMPListener;
+}
+
++ (id)allocWithZone:(NSZone *)zone {
+ @synchronized(self) {
+ if (sharedMPListener == nil) {
+ sharedMPListener = [super allocWithZone:zone];
+ return sharedMPListener;
+ }
+ }
+ return nil;
+}
+
+- (id)copyWithZone:(NSZone *)zone {
+ return self;
+}
+
+- (id)retain {
+ return self;
+}
+
+- (unsigned)retainCount {
+ return UINT_MAX;
+}
+
+-(void) release {
+ //do nothing
+}
+
+- (id) autorelease {
+ return self;
+}
+
- (id)init {
- self = [super init];
- if (self != nil) {
- [self registerForLocalNotification];
- [self registerForGlobalNotification];
+ if (self = [super init]) {
+ //[self registerForLocalNotification];
+ //[self registerForGlobalNotification];
+ //[self observeInfoString];
}
return self;
}
@@ -52,6 +94,45 @@
[super dealloc];
}
+- (void) setInfoString:(NSString *) string {
+ infoString = [NSString stringWithString:string];
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"testMacPortsNotification"
+ object:self];
+ //NSLog(@"infoString has been set to %@", infoString);
+}
+
+- (NSString *) infoString {
+ return infoString;
+}
+
+/*
+-(void) observeInfoString {
+ [self addObserver:self
+ forKeyPath:@"infoString"
+ options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
+ context:NULL];
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath
+ ofObject:(id)object
+ change:(NSDictionary *)change
+ context:(void *)context {
+
+ if ([keyPath isEqual:@"infoString"]) {
+ NSLog(@"InfoString changed from \n \
+ %@ \n \
+ to \n \
+ %@ ", [change objectForKey:NSKeyValueChangeOldKey] ,
+ [change objectForKey:NSKeyValueChangeNewKey]);
+ }
+ else
+ NSLog (@"HOW DID INFOSTRING CHANGE WITHOUT CHANGING AN INFOSTRING?!");
+
+ //There's no super implementation AFAIK
+}
+
+
-(void) registerForLocalNotification {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(respondToLocalNotification:)
@@ -85,4 +166,5 @@
else
NSLog(@"%@", NSStringFromClass([sentObject class]));
}
+*/
@end
Modified: branches/gsoc08-framework/MacPorts_Framework/MPPort.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPPort.h 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPPort.h 2008-07-12 20:38:36 UTC (rev 38217)
@@ -109,19 +109,37 @@
*/
- (NSArray *)depends;
+//Wrapper method for the 3 functions below
+- (void)execPortProc:(NSString *)procedure withOptions:(NSArray *)options withVersion:(NSString *)version;
+//Even more generic method to execute a Tcl command with any given number of args
+- (void)execPortProc:(NSString *)procedure withParams:(NSArray *)params;
+
+
/*!
@brief Deactivates and uninstalls this MPPort from the MacPorts system
@param options An NSArray of NSStrings of options for this uninstallation execution
+ @param version An NSString indicating which version of this port to uninstall
+ @discussion version should NOT be nil
*/
-- (void)uninstallWithOptions:(NSArray *)options;
+- (void)uninstallWithOptions:(NSArray *)options withVersion:(NSString *)version;
/*!
@brief Activates an installed MPPort.
+ @param options An NSArray of NSStrings of options for port activation
+ @param version An NSString indicating which version of this port to activate
+ @discussion version should NOT be nil. The activated port should have been
+ already installed. This happens automatically during a default installation
+ of a port. This means activation of a port should occur only if the port
+ had been previously deactivated after a default installation.
*/
-- (void)activate;
+- (void)activateWithOptions:(NSArray *)options withVersion:(NSString *)version;
/*!
@brief Deactivates an installed MPPort.
+ @param options An NSArray of NSStrings of options for port deactivation
+ @param version An NSString indicating which version of this port to deactivate
+ @discussion version should NOT be nil. Only installed and active ports
+ should be deactivated
*/
-- (void)deactivate;
+- (void)deactivateWithOptions:(NSArray *)options withVersion:(NSString *)version;
#pragma mark --exec: and its convenience methods--
Modified: branches/gsoc08-framework/MacPorts_Framework/MPPort.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPPort.m 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPPort.m 2008-07-12 20:38:36 UTC (rev 38217)
@@ -155,28 +155,67 @@
nil]];
}
-- (void)uninstallWithOptions:(NSArray *)options {
- NSString *opts;
+
+-(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 (options != NULL) {
- opts = [NSString stringWithString:[options componentsJoinedByString:@" "]];
- }
+ 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:
- //Is this the correct way to call the Tcl command?
- //uninstall isn't one of the target options for mportexec so I should
- //double check with Randall about this call. For quick reference
- //here is the procedure signature -> proc uninstall {portname {v ""} optionslist}
- //located in /registry 1.0/portuninstall.tcl
- @"[portuninstall::uninstall %@ %@ %@]",
- [self name], [self version], opts]];
+ @"[%@ %@ %@ %@]" ,
+ procedure, [self name], v, opts]];
}
+
+- (void)execPortProc:(NSString *)procedure withParams:(NSArray *)params {
+ //params can contain either NSStrings or NSArrays
+ NSString * sparams = [NSString stringWithString:@" "];
+ NSEnumerator * penums = [params objectEnumerator];
+ MPInterpreter *interpreter = [MPInterpreter sharedInterpreter];
+
+ id elem;
+
+ while (elem = [penums nextObject]) {
+ if ([elem isMemberOfClass:[NSString class]]) {
+ sparams = [sparams stringByAppendingString:elem];
+ sparams = [sparams stringByAppendingString:@" "];
+ }
+
+ else if ([elem isKindOfClass:[NSArray class]]) {
+ //Maybe I should be more careful in the above if statement and
+ //explicitly check for the classes i'm interested in?
+ sparams = [sparams stringByAppendingString:[elem componentsJoinedByString:@" "]];
+ sparams = [sparams stringByAppendingString:@" "];
+ }
+ }
+
+ [interpreter evaluateStringAsString:
+ [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];
+}
+
+- (void)deactivateWithOptions:(NSArray *)options withVersion:(NSString *)version {
+ [self execPortProc:@"mportdeactivate" withOptions:options withVersion:version];
+}
+
-(void)exec:(NSString *)target withOptions:(NSArray *)options withVariants:(NSArray *)variants {
NSString *opts;
NSString *vrnts;
Modified: branches/gsoc08-framework/MacPorts_Framework/MPReceipt.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPReceipt.h 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MPReceipt.h 2008-07-12 20:38:36 UTC (rev 38217)
@@ -33,6 +33,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+/*!
+ @header
+ MPReceipt provides a programatic interface to the receipt(s) for installed ports.
+ */
+
#import <Cocoa/Cocoa.h>
#import "MPInterpreter.h"
#import "MPRegistry.h"
Modified: branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/Armahg.mode1v3
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/Armahg.mode1v3 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/Armahg.mode1v3 2008-07-12 20:38:36 UTC (rev 38217)
@@ -202,24 +202,24 @@
<key>Content</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>6EF2D9E40E2568E600D896EC</string>
+ <string>6EF2DC140E29439200D896EC</string>
<key>PBXProjectModuleLabel</key>
- <string>MPPort.m</string>
+ <string>notifications.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>6EF2D9E50E2568E600D896EC</string>
+ <string>6EF2DC150E29439200D896EC</string>
<key>PBXProjectModuleLabel</key>
- <string>MPPort.m</string>
+ <string>notifications.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>6EF2DA420E257B5100D896EC</string>
+ <string>6EF2DC8B0E294CE900D896EC</string>
<key>history</key>
<array>
- <string>6EF2DA2A0E2577FB00D896EC</string>
+ <string>6EF2DC640E29488600D896EC</string>
</array>
</dict>
<key>SplitCount</key>
@@ -231,35 +231,35 @@
<key>Geometry</key>
<dict>
<key>Frame</key>
- <string>{{0, 20}, {853, 532}}</string>
+ <string>{{0, 20}, {865, 452}}</string>
<key>PBXModuleWindowStatusBarHidden2</key>
<false/>
<key>RubberWindowFrame</key>
- <string>296 205 853 573 0 0 1152 778 </string>
+ <string>135 248 865 493 0 0 1152 778 </string>
</dict>
</dict>
<dict>
<key>Content</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>6EF2D9D70E254F6900D896EC</string>
+ <string>6EF2DC110E29439200D896EC</string>
<key>PBXProjectModuleLabel</key>
- <string>MPPort.h</string>
+ <string>init.tcl</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
- <string>6EF2D9D80E254F6900D896EC</string>
+ <string>6EF2DC120E29439200D896EC</string>
<key>PBXProjectModuleLabel</key>
- <string>MPPort.h</string>
+ <string>init.tcl</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>6EF2DA430E257B5100D896EC</string>
+ <string>6EF2DC8C0E294CE900D896EC</string>
<key>history</key>
<array>
- <string>6EF2D9CA0E25488A00D896EC</string>
+ <string>6EF2DBF40E29421400D896EC</string>
</array>
</dict>
<key>SplitCount</key>
@@ -275,7 +275,7 @@
<key>PBXModuleWindowStatusBarHidden2</key>
<false/>
<key>RubberWindowFrame</key>
- <string>502 205 853 573 0 0 1152 778 </string>
+ <string>170 95 853 573 0 0 1152 778 </string>
</dict>
</dict>
</array>
@@ -315,6 +315,8 @@
<key>Layout</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -339,7 +341,7 @@
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
- <real>208</real>
+ <real>266</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
@@ -352,24 +354,24 @@
<array>
<string>0867D691FE84028FC02AAC07</string>
<string>6EA293540E05C8C600902D12</string>
+ <string>6E88D1760DF46A2600684E9F</string>
<string>08FB77AEFE84172EC02AAC07</string>
<string>089C1665FE841158C02AAC07</string>
<string>034768DFFF38A50411DB9C8B</string>
<string>1C37FBAC04509CD000000102</string>
- <string>6EF2D9B30E25474100D896EC</string>
- <string>6EF2D9B40E25474100D896EC</string>
+ <string>6EF2DBE00E293FF500D896EC</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>28</integer>
- <integer>23</integer>
+ <integer>3</integer>
+ <integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 155}, {208, 638}}</string>
+ <string>{{0, 12}, {266, 420}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -381,32 +383,30 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {225, 656}}</string>
+ <string>{{0, 0}, {283, 438}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
- <real>208</real>
+ <real>266</real>
</array>
<key>RubberWindowFrame</key>
- <string>72 81 994 697 0 0 1152 778 </string>
+ <string>102 283 1015 479 0 0 1152 778 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>225pt</string>
+ <string>283pt</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>dummycommit.test</string>
+ <string>notifications.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -414,33 +414,40 @@
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>dummycommit.test</string>
+ <string>notifications.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>6EF2DA410E257B5100D896EC</string>
+ <string>6EF2DC8A0E294CE900D896EC</string>
<key>history</key>
<array>
<string>6E1AE7F20E22E34900F6D7BC</string>
- <string>6E1AE82F0E23206700F6D7BC</string>
- <string>6E1AE8B40E23CE0D00F6D7BC</string>
- <string>6EF7703D0E250CFA00E0115E</string>
<string>6EF770400E250CFA00E0115E</string>
- <string>6EF770410E250CFA00E0115E</string>
- <string>6EF770440E250CFA00E0115E</string>
- <string>6EF2D9B50E25474100D896EC</string>
- <string>6EF2D9B60E25474100D896EC</string>
<string>6EF2D9B70E25474100D896EC</string>
<string>6EF2D9CB0E254F6900D896EC</string>
- <string>6EF2D9CC0E254F6900D896EC</string>
- <string>6EF2D9CD0E254F6900D896EC</string>
- <string>6EF2D9F40E256FB100D896EC</string>
- <string>6EF2DA120E25763E00D896EC</string>
<string>6EF2DA130E25763E00D896EC</string>
- <string>6EF2DA370E257B3000D896EC</string>
- <string>6EF2DA3D0E257B5100D896EC</string>
- <string>6EF2DA3E0E257B5100D896EC</string>
- <string>6EF2D9B80E25474100D896EC</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>6EF2DB710E292BB500D896EC</string>
+ <string>6EF2DBF50E29439200D896EC</string>
+ <string>6EF2DBF60E29439200D896EC</string>
+ <string>6EF2DBFA0E29439200D896EC</string>
+ <string>6EF2DC530E29480500D896EC</string>
+ <string>6EF2DC680E294C7C00D896EC</string>
+ <string>6EF2DC690E294C7C00D896EC</string>
+ <string>6EF2DC6A0E294C7C00D896EC</string>
+ <string>6EF2DC6B0E294C7C00D896EC</string>
+ <string>6EF2DC6C0E294C7C00D896EC</string>
+ <string>6EF2DC870E294CE900D896EC</string>
+ <string>6EF2DC880E294CE900D896EC</string>
</array>
<key>prevStack</key>
<array>
@@ -452,36 +459,104 @@
<string>6EF770480E250CFA00E0115E</string>
<string>6EF770490E250CFA00E0115E</string>
<string>6EF7704A0E250CFA00E0115E</string>
- <string>6EF7704B0E250CFA00E0115E</string>
<string>6EF7704D0E250CFA00E0115E</string>
<string>6EF7704E0E250CFA00E0115E</string>
<string>6EF770500E250CFA00E0115E</string>
<string>6EF2D9BE0E25474100D896EC</string>
<string>6EF2D9BF0E25474100D896EC</string>
- <string>6EF2D9C00E25474100D896EC</string>
- <string>6EF2D9C10E25474100D896EC</string>
- <string>6EF2D9C20E25474100D896EC</string>
<string>6EF2D9C40E25474100D896EC</string>
- <string>6EF2D9C50E25474100D896EC</string>
<string>6EF2D9D00E254F6900D896EC</string>
- <string>6EF2D9D10E254F6900D896EC</string>
<string>6EF2D9D20E254F6900D896EC</string>
- <string>6EF2D9D30E254F6900D896EC</string>
- <string>6EF2D9D50E254F6900D896EC</string>
- <string>6EF2D9E10E2568E600D896EC</string>
- <string>6EF2D9EA0E25694100D896EC</string>
- <string>6EF2D9F70E256FB100D896EC</string>
<string>6EF2D9F80E256FB100D896EC</string>
- <string>6EF2D9F90E256FB100D896EC</string>
- <string>6EF2DA140E25763E00D896EC</string>
<string>6EF2DA150E25763E00D896EC</string>
- <string>6EF2DA280E2577FB00D896EC</string>
- <string>6EF2DA300E257ADF00D896EC</string>
<string>6EF2DA310E257ADF00D896EC</string>
- <string>6EF2DA320E257ADF00D896EC</string>
- <string>6EF2DA390E257B3000D896EC</string>
- <string>6EF2DA3F0E257B5100D896EC</string>
- <string>6EF2DA400E257B5100D896EC</string>
+ <string>6EF2DA970E25A2D100D896EC</string>
+ <string>6EF2DAC40E26BBD500D896EC</string>
+ <string>6EF2DAC50E26BBD500D896EC</string>
+ <string>6EF2DAC60E26BBD500D896EC</string>
+ <string>6EF2DAC70E26BBD500D896EC</string>
+ <string>6EF2DAC80E26BBD500D896EC</string>
+ <string>6EF2DAC90E26BBD500D896EC</string>
+ <string>6EF2DADE0E26E0CD00D896EC</string>
+ <string>6EF2DAE50E274FA600D896EC</string>
+ <string>6EF2DAE60E274FA600D896EC</string>
+ <string>6EF2DAF20E2809E400D896EC</string>
+ <string>6EF2DAF30E2809E400D896EC</string>
+ <string>6EF2DAF40E2809E400D896EC</string>
+ <string>6EF2DAF50E2809E400D896EC</string>
+ <string>6EF2DAF60E2809E400D896EC</string>
+ <string>6EF2DAF70E2809E400D896EC</string>
+ <string>6EF2DAF80E2809E400D896EC</string>
+ <string>6EF2DAF90E2809E400D896EC</string>
+ <string>6EF2DB080E280D3800D896EC</string>
+ <string>6EF2DB140E285EBB00D896EC</string>
+ <string>6EF2DB150E285EBB00D896EC</string>
+ <string>6EF2DB160E285EBB00D896EC</string>
+ <string>6EF2DB170E285EBB00D896EC</string>
+ <string>6EF2DB180E285EBB00D896EC</string>
+ <string>6EF2DB190E285EBB00D896EC</string>
+ <string>6EF2DB1A0E285EBB00D896EC</string>
+ <string>6EF2DB1B0E285EBB00D896EC</string>
+ <string>6EF2DB1C0E285EBB00D896EC</string>
+ <string>6EF2DB1D0E285EBB00D896EC</string>
+ <string>6EF2DB290E2902CF00D896EC</string>
+ <string>6EF2DB2B0E2902CF00D896EC</string>
+ <string>6EF2DB460E290A6D00D896EC</string>
+ <string>6EF2DB480E290A6D00D896EC</string>
+ <string>6EF2DB490E290A6D00D896EC</string>
+ <string>6EF2DB4A0E290A6D00D896EC</string>
+ <string>6EF2DB4B0E290A6D00D896EC</string>
+ <string>6EF2DB580E290E2C00D896EC</string>
+ <string>6EF2DB590E290E2C00D896EC</string>
+ <string>6EF2DB740E292BB500D896EC</string>
+ <string>6EF2DB760E292BB500D896EC</string>
+ <string>6EF2DB770E292BB500D896EC</string>
+ <string>6EF2DB780E292BB500D896EC</string>
+ <string>6EF2DB7A0E292BB500D896EC</string>
+ <string>6EF2DB7C0E292BB500D896EC</string>
+ <string>6EF2DB7E0E292BB500D896EC</string>
+ <string>6EF2DB7F0E292BB500D896EC</string>
+ <string>6EF2DB810E292BB500D896EC</string>
+ <string>6EF2DB820E292BB500D896EC</string>
+ <string>6EF2DB840E292BB500D896EC</string>
+ <string>6EF2DB8F0E292F6100D896EC</string>
+ <string>6EF2DB900E292F6100D896EC</string>
+ <string>6EF2DB920E292F6100D896EC</string>
+ <string>6EF2DB980E292FD000D896EC</string>
+ <string>6EF2DB9D0E292FFE00D896EC</string>
+ <string>6EF2DBA60E29373B00D896EC</string>
+ <string>6EF2DBCC0E293EF500D896EC</string>
+ <string>6EF2DBFD0E29439200D896EC</string>
+ <string>6EF2DBFE0E29439200D896EC</string>
+ <string>6EF2DC000E29439200D896EC</string>
+ <string>6EF2DC010E29439200D896EC</string>
+ <string>6EF2DC020E29439200D896EC</string>
+ <string>6EF2DC040E29439200D896EC</string>
+ <string>6EF2DC060E29439200D896EC</string>
+ <string>6EF2DC070E29439200D896EC</string>
+ <string>6EF2DC090E29439200D896EC</string>
+ <string>6EF2DC0B0E29439200D896EC</string>
+ <string>6EF2DC0C0E29439200D896EC</string>
+ <string>6EF2DC0D0E29439200D896EC</string>
+ <string>6EF2DC0F0E29439200D896EC</string>
+ <string>6EF2DC3B0E2946AD00D896EC</string>
+ <string>6EF2DC570E29480500D896EC</string>
+ <string>6EF2DC580E29480500D896EC</string>
+ <string>6EF2DC620E29488600D896EC</string>
+ <string>6EF2DC6E0E294C7C00D896EC</string>
+ <string>6EF2DC6F0E294C7C00D896EC</string>
+ <string>6EF2DC700E294C7C00D896EC</string>
+ <string>6EF2DC710E294C7C00D896EC</string>
+ <string>6EF2DC720E294C7C00D896EC</string>
+ <string>6EF2DC730E294C7C00D896EC</string>
+ <string>6EF2DC740E294C7C00D896EC</string>
+ <string>6EF2DC750E294C7C00D896EC</string>
+ <string>6EF2DC760E294C7C00D896EC</string>
+ <string>6EF2DC770E294C7C00D896EC</string>
+ <string>6EF2DC780E294C7C00D896EC</string>
+ <string>6EF2DC790E294C7C00D896EC</string>
+ <string>6EF2DC7A0E294C7C00D896EC</string>
+ <string>6EF2DC890E294CE900D896EC</string>
</array>
</dict>
<key>SplitCount</key>
@@ -493,14 +568,14 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {764, 458}}</string>
+ <string>{{0, 0}, {727, 240}}</string>
<key>RubberWindowFrame</key>
- <string>72 81 994 697 0 0 1152 778 </string>
+ <string>102 283 1015 479 0 0 1152 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>458pt</string>
+ <string>240pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
@@ -513,9 +588,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 463}, {764, 193}}</string>
+ <string>{{0, 245}, {727, 193}}</string>
<key>RubberWindowFrame</key>
- <string>72 81 994 697 0 0 1152 778 </string>
+ <string>102 283 1015 479 0 0 1152 778 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -524,7 +599,7 @@
</dict>
</array>
<key>Proportion</key>
- <string>764pt</string>
+ <string>727pt</string>
</dict>
</array>
<key>Name</key>
@@ -539,9 +614,9 @@
</array>
<key>TableOfContents</key>
<array>
- <string>6EF2D9C80E25474100D896EC</string>
+ <string>6EF2DA920E25A2A900D896EC</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>6EF2D9C90E25474100D896EC</string>
+ <string>6EF2DA930E25A2A900D896EC</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
@@ -675,14 +750,14 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>6E1AE7FA0E22E34900F6D7BC</string>
<string>1C530D57069F1CE1000CFCEE</string>
- <string>6EF2D9D70E254F6900D896EC</string>
- <string>6EF2D9E40E2568E600D896EC</string>
+ <string>6EF2DC110E29439200D896EC</string>
+ <string>6EF2DC140E29439200D896EC</string>
<string>/Users/Armahg/gsoc08/MacPorts_Framework/MacPorts.Framework.xcodeproj</string>
+ <string>6E1AE7FA0E22E34900F6D7BC</string>
</array>
<key>WindowString</key>
- <string>72 81 994 697 0 0 1152 778 </string>
+ <string>102 283 1015 479 0 0 1152 778 </string>
<key>WindowToolsV3</key>
<array>
<dict>
@@ -698,34 +773,34 @@
<key>Dock</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
- <string>MPPort.m</string>
+ <string>MPNotificationsListener.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {1036, 314}}</string>
+ <string>{{0, 0}, {1001, 287}}</string>
<key>RubberWindowFrame</key>
- <string>116 56 1036 676 0 0 1152 778 </string>
+ <string>226 157 1001 608 0 0 1152 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>314pt</string>
+ <string>287pt</string>
</dict>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBuildLogShowsTranscriptDefaultKey</key>
- <string>{{0, 196}, {1036, 120}}</string>
+ <string>{{0, 182}, {1001, 93}}</string>
<key>PBXProjectModuleGUID</key>
<string>XCMainBuildResultsModuleGUID</string>
<key>PBXProjectModuleLabel</key>
@@ -738,18 +813,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 319}, {1036, 316}}</string>
+ <string>{{0, 292}, {1001, 275}}</string>
<key>RubberWindowFrame</key>
- <string>116 56 1036 676 0 0 1152 778 </string>
+ <string>226 157 1001 608 0 0 1152 778 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
<key>Proportion</key>
- <string>316pt</string>
+ <string>275pt</string>
</dict>
</array>
<key>Proportion</key>
- <string>635pt</string>
+ <string>567pt</string>
</dict>
</array>
<key>Name</key>
@@ -763,18 +838,18 @@
<key>TableOfContents</key>
<array>
<string>6E1AE7FA0E22E34900F6D7BC</string>
- <string>6EF2D9A60E25472600D896EC</string>
+ <string>6EF2DAB20E26B8ED00D896EC</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildV3</string>
<key>WindowString</key>
- <string>116 56 1036 676 0 0 1152 778 </string>
+ <string>226 157 1001 608 0 0 1152 778 </string>
<key>WindowToolGUID</key>
<string>6E1AE7FA0E22E34900F6D7BC</string>
<key>WindowToolIsVisible</key>
- <false/>
+ <true/>
</dict>
<dict>
<key>Identifier</key>
@@ -899,25 +974,25 @@
<key>PBXProjectModuleGUID</key>
<string>1CDD528C0622207200134675</string>
<key>PBXProjectModuleLabel</key>
- <string>MPInterpreter.m</string>
+ <string>MPNotificationsListener.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {781, 212}}</string>
+ <string>{{0, 0}, {878, 341}}</string>
<key>RubberWindowFrame</key>
- <string>246 300 781 470 0 0 1152 778 </string>
+ <string>122 59 878 715 0 0 1152 778 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>781pt</string>
+ <string>878pt</string>
</dict>
</array>
<key>Proportion</key>
- <string>212pt</string>
+ <string>341pt</string>
</dict>
<dict>
<key>BecomeActive</key>
@@ -932,18 +1007,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 217}, {781, 212}}</string>
+ <string>{{0, 346}, {878, 328}}</string>
<key>RubberWindowFrame</key>
- <string>246 300 781 470 0 0 1152 778 </string>
+ <string>122 59 878 715 0 0 1152 778 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
<key>Proportion</key>
- <string>212pt</string>
+ <string>328pt</string>
</dict>
</array>
<key>Proportion</key>
- <string>429pt</string>
+ <string>674pt</string>
</dict>
</array>
<key>Name</key>
@@ -957,17 +1032,17 @@
<key>TableOfContents</key>
<array>
<string>1C530D57069F1CE1000CFCEE</string>
- <string>6EF2D9AD0E25472600D896EC</string>
- <string>6EF2D9AE0E25472600D896EC</string>
+ <string>6EF2DABD0E26B8ED00D896EC</string>
+ <string>6EF2DABE0E26B8ED00D896EC</string>
<string>1CDD528C0622207200134675</string>
<string>1CD0528E0623707200166675</string>
</array>
<key>WindowString</key>
- <string>246 300 781 470 0 0 1152 778 </string>
+ <string>122 59 878 715 0 0 1152 778 </string>
<key>WindowToolGUID</key>
<string>1C530D57069F1CE1000CFCEE</string>
<key>WindowToolIsVisible</key>
- <true/>
+ <false/>
</dict>
<dict>
<key>Identifier</key>
Modified: branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj 2008-07-12 20:38:36 UTC (rev 38217)
@@ -360,7 +360,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
+ shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\nrm -rf notifications.dylib\n";
};
6E270C870E14DF5C00BAE687 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Modified: branches/gsoc08-framework/MacPorts_Framework/Makefile
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/Makefile 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/Makefile 2008-07-12 20:38:36 UTC (rev 38217)
@@ -7,7 +7,7 @@
DESTDIR =
PREFIX = /Library/Tcl/notifications1.0
-OBJS = notifications.o
+OBJS = notifications.o MPNotificationsListener.o
TARGET = notifications.dylib
CC = gcc
Modified: branches/gsoc08-framework/MacPorts_Framework/dummycommit.test
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/dummycommit.test 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/dummycommit.test 2008-07-12 20:38:36 UTC (rev 38217)
@@ -1,11 +1,14 @@
TO DO LIST (because there seems to be too much to get done haha)
-Test mportexec rewrites
+
Get feedback on Notifications idea and implementation
-Test notifications package some more
-Create my own branch of src ?
+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-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/init.tcl 2008-07-12 20:38:36 UTC (rev 38217)
@@ -11,7 +11,6 @@
package require macports
package require notifications
-package require portuninstall 1.0
# ui_options accessor
proc ui_isset {val} {
@@ -77,12 +76,10 @@
#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} {
-
- #notifications send global "MP $message Notification" "INSIDE UI_INIT"
- #notifications send global "MP $priority Notification" "Channel none \
- Prefix $prefix" $message
-
# Get the list of channels.
try {
set channels [ui_channels $priority]
@@ -93,54 +90,80 @@
# Simplify ui_$priority.
set nbchans [llength $channels]
if {$nbchans == 0} {
- proc ::ui_$priority {str} [
- subst {
- notifications send global "MP $priority Notification" "Channel none \
- Prefix $prefix" "\$str
- }
- ]
+ proc ::ui_$priority {str} [subst {
+ notifications send global "MP $priority Notification" "Channel1 none \
+ Prefix $prefix" "\$str"
+ }]
} else {
try {
set prefix [ui_prefix $priority]
} catch * {
set prefix [ui_prefix_default $priority]
}
-
- if {$nbchans == 1} {
+
+ try {
+ ::ui_init $priority $prefix $channels $message
+ } catch * {
+ if {$nbchans == 1} {
set chan [lindex $channels 0]
-
- #Redefine ui_$priority here to also throw notifications of some sort
- proc ::ui_$priority {str} [
- subst {
- puts $chan "$prefix\$str"
-
- #Send notifications using NSDistributedNotificationCenter for now
- #We need a way to name notifications based on given input, using
- #testMacPortsNotification for now
- notifications send global "MP $priority Notification5" "Channel $chan \
- Prefix $prefix" "\$str"
- }
- ]
-
+
+ proc ::ui_$priority {str} [subst {
+ puts $chan "$prefix\$str"
+ notifications send global "MP $priority Notifications" "Channel2 $chan \
+ Prefix $prefix" "\$str"
+ }]
} else {
- proc ::ui_$priority {str} [
- subst {
- foreach chan \$channels {
- puts $chan "$prefix\$str"
- }
- notifications send global "MP $priority Notification" "Channel $chan \
- Prefix $prefix" "\$str"
- }
- ]
+
+ proc ::ui_$priority {str} [subst {
+ foreach chan \$channels {
+ puts $chan "$prefix\$str"
+ }
+ notifications send global "MP $priority Notifications" "Channel3 $chan \
+ Prefix $prefix" "\$str"
+ }]
}
-
+ }
+
# Call ui_$priority
::ui_$priority $message
}
}
+#Wrapping the following API routines to catch errors
+#and log error Information in a similar fashion to code
+#in macports.tcl.
+proc mportuninstall {portname {v ""} optionslist} {
+ if {[catch {portuninstall::uninstall $portname $v $optionslist} result]} {
+
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Uninstall $portname $v failed: $result"
+ return 1
+ }
+}
+proc mportactivate {portname v optionslist} {
+ if {[catch {portimage::activate $portname $v $optionslist} result]} {
+
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Activate $portname $v failed: $result"
+ return 1
+ }
+}
+
+proc mportdeactivate {portname v optionslist} {
+ if {[catch {portimage::deactivate $portname $v $optionslist} result]} {
+
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Deactivate $portname $v failed: $result"
+ return 1
+ }
+}
+
+
# Initialize dport
# This must be done following parse of global options, as some options are
# evaluated by dportinit.
Modified: branches/gsoc08-framework/MacPorts_Framework/notifications.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/notifications.m 2008-07-12 19:51:41 UTC (rev 38216)
+++ branches/gsoc08-framework/MacPorts_Framework/notifications.m 2008-07-12 20:38:36 UTC (rev 38217)
@@ -35,12 +35,13 @@
#include <tcl.h>
-
+#include "MPNotificationsListener.h"
#include <Cocoa/Cocoa.h>
int Notifications_Send(int objc, Tcl_Obj *CONST objv[], int global, Tcl_Interp *interpreter) {
- NSString *name = nil;
+ NSString *name , *msg;
NSMutableDictionary *info = nil;
+ MPNotificationsListener *mln = [MPNotificationsListener sharedListener];
int tclCount;
int tclResult;
@@ -54,36 +55,42 @@
if (tclResult == TCL_OK) {
/*/For now we return a single element dictionary containing the ui_* log message
- info = [NSMutableDictionary dictionaryWithCapacity:1];
- [info setObject:[NSString stringWithUTF8String:Tcl_GetString(*objv)] forKey:[NSString stringWithString:@"ui_notification"]];
+ info = [NSMutableDictionary dictionaryWithCapacity:1];
+ [info setObject:[NSString stringWithUTF8String:Tcl_GetString(*objv)] forKey:[NSString stringWithString:@"ui_notification"]];
+
+ //Afaik local notifications don't work. I'm keeping code for it in case we find a work around
+ if (global != 0) {
+ [[NSDistributedNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+ } else {
+ [[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+ }*/
- //Afaik local notifications don't work. I'm keeping code for it in case we find a work around
- if (global != 0) {
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
- } else {
- [[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
- }*/
+ //I don't understand what Randall's original intent was for parsing the ui_msg as an NSDictionary.
+ //I'll keep this code here till further notice.
- //I don't understand what Randall's original intent was for parsing the ui_msg as an NSDictionary.
- //I'll keep this code here till further notice.
-
- info = [NSMutableDictionary dictionaryWithCapacity:(tclCount / 2)];
- for (i = 0; i < tclCount; i +=2) {
+ 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)
- [info setObject:[NSString stringWithUTF8String:Tcl_GetString(*objv)] forKey:[NSString stringWithString:@"Message"]];
+ if(objv != NULL) {
+ msg = [NSString stringWithUTF8String:Tcl_GetString(*objv)];
+ [info setObject:msg forKey:[NSString stringWithString:@"Message"]];
+ //[mln setValue:name forKey:@"infoString"];
+ [mln setInfoString:name];
+ }
- if (global != 0) {
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
- } else {
- [[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
- }
+ if (global != 0) {
+ [[NSDistributedNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+ } else {
+ [[NSNotificationCenter defaultCenter] postNotificationName:name object:nil userInfo:info];
+ }
+
+
} else {
return TCL_ERROR;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080712/ff733f87/attachment-0001.html
More information about the macports-changes
mailing list