[57190] branches/gsoc09-gui/MPGUI

juanger at macports.org juanger at macports.org
Sun Sep 6 22:42:42 PDT 2009


Revision: 57190
          http://trac.macports.org/changeset/57190
Author:   juanger at macports.org
Date:     2009-09-06 22:42:42 -0700 (Sun, 06 Sep 2009)
Log Message:
-----------
Code cleanup

Modified Paths:
--------------
    branches/gsoc09-gui/MPGUI/ActivityController.h
    branches/gsoc09-gui/MPGUI/ActivityController.m
    branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib
    branches/gsoc09-gui/MPGUI/MPActionLauncher.m
    branches/gsoc09-gui/MPGUI/PortsTableController.m

Modified: branches/gsoc09-gui/MPGUI/ActivityController.h
===================================================================
--- branches/gsoc09-gui/MPGUI/ActivityController.h	2009-09-07 05:41:49 UTC (rev 57189)
+++ branches/gsoc09-gui/MPGUI/ActivityController.h	2009-09-07 05:42:42 UTC (rev 57190)
@@ -21,5 +21,8 @@
 
 - (void)subscribeToNotifications;
 - (void)gotMPMSG:(NSNotification *)notification;
+- (void)gotMPINFO:(NSNotification *)notification;
+- (void)gotMPDEFAULT:(NSNotification *)notification;
+- (void)gotMPERROR:(NSNotification *)notification;
 
 @end

Modified: branches/gsoc09-gui/MPGUI/ActivityController.m
===================================================================
--- branches/gsoc09-gui/MPGUI/ActivityController.m	2009-09-07 05:41:49 UTC (rev 57189)
+++ branches/gsoc09-gui/MPGUI/ActivityController.m	2009-09-07 05:42:42 UTC (rev 57190)
@@ -14,27 +14,12 @@
 @synthesize busy;
 
 - (void)awakeFromNib {
+    [progress setUsesThreadedAnimation:YES];
     [self setBusy:NO];
     [self subscribeToNotifications];
 }
 
 - (void)subscribeToNotifications {
-    //  [[NSNotificationCenter defaultCenter] addObserver:self
-    //                                           selector:@selector()
-    //                                               name:MPINFO object:nil];
-    //	[[NSNotificationCenter defaultCenter] addObserver:self
-    //											 selector:@selector()
-    //												 name:MPERROR object:nil];
-    //	[[NSNotificationCenter defaultCenter] addObserver:self
-    //											 selector:@selector()
-    //												 name:MPWARN object:nil];
-    //	[[NSNotificationCenter defaultCenter] addObserver:self
-    //											 selector:@selector()
-    //												 name:MPDEBUG object:nil];
-    //	[[NSNotificationCenter defaultCenter] addObserver:self
-    //											 selector:@selector()
-    //												 name:MPDEFAULT object:nil];
-    // This is for MPPortProcess
     [[NSNotificationCenter defaultCenter] addObserver:self
                                              selector:@selector(gotMPMSG:)
                                                  name:MPMSG object:nil];
@@ -44,17 +29,27 @@
     [[NSNotificationCenter defaultCenter] addObserver:self
                                              selector:@selector(gotMPINFO:)
                                                  name:MPINFO object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self
+    										 selector:@selector(gotMPERROR:)
+    											 name:MPERROR object:nil];
+    //	[[NSNotificationCenter defaultCenter] addObserver:self
+    //											 selector:@selector()
+    //												 name:MPWARN object:nil];
+    //	[[NSNotificationCenter defaultCenter] addObserver:self
+    //											 selector:@selector()
+    //												 name:MPDEBUG object:nil];
 }
 
 - (void)gotMPINFO:(NSNotification *)notification {
     NSString *msg = [[notification userInfo] objectForKey:MPMESSAGE];
     NSLog(@"GOT MPINFO NOTIFICATION: %@", msg);
+    // Starting up: A port command has been started
     if ([msg isEqual:@"Starting up"]) {
         [currentTask setStringValue:[[notification userInfo] objectForKey:MPMETHOD]];
         [self setBusy:YES];
         return;
     }
-    
+    // Shutting down: The command has finished
     if ([msg isEqual:@"Shutting down"]) {
         [currentTask setStringValue:@"" ];
         [self setBusy:NO];
@@ -72,4 +67,10 @@
     NSLog(@"GOT MPDEFAULT NOTIFICATION: %@", msg);
 }
 
+- (void)gotMPERROR:(NSNotification *)notification {
+    NSString *msg = [[notification userInfo] objectForKey:MPMESSAGE];
+    NSLog(@"GOT ERROR NOTIFICATION: %@", msg);
+    //TODO: Display an alert
+}
+
 @end

Modified: branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib
===================================================================
--- branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-09-07 05:41:49 UTC (rev 57189)
+++ branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-09-07 05:42:42 UTC (rev 57190)
@@ -8,7 +8,7 @@
 		<string key="IBDocument.HIToolboxVersion">353.00</string>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="371"/>
+			<integer value="372"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2059,7 +2059,7 @@
 																				<reference ref="385089462"/>
 																			</object>
 																		</object>
-																		<object class="NSMutableDictionary" id="193271997">
+																		<object class="NSMutableDictionary" id="247503625">
 																			<bool key="EncodedWithXMLCoder">YES</bool>
 																			<object class="NSMutableArray" key="dict.sortedKeys">
 																				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2185,7 +2185,7 @@
 																					<bool key="EncodedWithXMLCoder">YES</bool>
 																					<reference ref="375100135"/>
 																					<reference ref="1016684085"/>
-																					<reference ref="193271997"/>
+																					<reference ref="247503625"/>
 																				</object>
 																				<object class="NSMutableArray">
 																					<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2509,8 +2509,7 @@
 							<object class="NSPSMatrix" key="NSDrawMatrix"/>
 							<string key="NSFrame">{{6, 6}, {63, 12}}</string>
 							<reference key="NSSuperview" ref="439893737"/>
-							<int key="NSpiFlags">16650</int>
-							<double key="NSMinValue">1.600000e+01</double>
+							<int key="NSpiFlags">24842</int>
 							<double key="NSMaxValue">1.000000e+02</double>
 						</object>
 						<object class="NSTextField" id="1009077985">
@@ -3812,22 +3811,6 @@
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBBindingConnection" key="connection">
-						<string key="label">animate: busy</string>
-						<reference key="source" ref="269595080"/>
-						<reference key="destination" ref="245714563"/>
-						<object class="NSNibBindingConnector" key="connector">
-							<reference key="NSSource" ref="269595080"/>
-							<reference key="NSDestination" ref="245714563"/>
-							<string key="NSLabel">animate: busy</string>
-							<string key="NSBinding">animate</string>
-							<string key="NSKeyPath">busy</string>
-							<int key="NSNibBindingConnectorVersion">2</int>
-						</object>
-					</object>
-					<int key="connectionID">772</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBBindingConnection" key="connection">
 						<string key="label">enabled: busy</string>
 						<reference key="source" ref="650498606"/>
 						<reference key="destination" ref="245714563"/>
@@ -3910,6 +3893,30 @@
 					</object>
 					<int key="connectionID">787</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBBindingConnection" key="connection">
+						<string key="label">animate: busy</string>
+						<reference key="source" ref="269595080"/>
+						<reference key="destination" ref="245714563"/>
+						<object class="NSNibBindingConnector" key="connector">
+							<reference key="NSSource" ref="269595080"/>
+							<reference key="NSDestination" ref="245714563"/>
+							<string key="NSLabel">animate: busy</string>
+							<string key="NSBinding">animate</string>
+							<string key="NSKeyPath">busy</string>
+							<int key="NSNibBindingConnectorVersion">2</int>
+						</object>
+					</object>
+					<int key="connectionID">791</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">progress</string>
+						<reference key="source" ref="245714563"/>
+						<reference key="destination" ref="269595080"/>
+					</object>
+					<int key="connectionID">792</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -5709,9 +5716,9 @@
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
-					<string>{{298, 246}, {773, 449}}</string>
+					<string>{{300, 235}, {773, 449}}</string>
 					<reference ref="6"/>
-					<string>{{298, 246}, {773, 449}}</string>
+					<string>{{300, 235}, {773, 449}}</string>
 					<reference ref="9"/>
 					<string>{{33, 99}, {480, 360}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5883,7 +5890,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">789</int>
+			<int key="maxID">792</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">

Modified: branches/gsoc09-gui/MPGUI/MPActionLauncher.m
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionLauncher.m	2009-09-07 05:41:49 UTC (rev 57189)
+++ branches/gsoc09-gui/MPGUI/MPActionLauncher.m	2009-09-07 05:42:42 UTC (rev 57190)
@@ -75,7 +75,6 @@
 
 - (void)cancelPortProcess {
     //  TODO: display confirmation dialog
-    //        send a "Shutting down" notification
     [[MPMacPorts sharedInstance] cancelCurrentCommand];
 }
 

Modified: branches/gsoc09-gui/MPGUI/PortsTableController.m
===================================================================
--- branches/gsoc09-gui/MPGUI/PortsTableController.m	2009-09-07 05:41:49 UTC (rev 57189)
+++ branches/gsoc09-gui/MPGUI/PortsTableController.m	2009-09-07 05:42:42 UTC (rev 57190)
@@ -30,6 +30,7 @@
 
 - (void)ruleEditorRowsDidChange:(NSNotification *)notification {
     [self changePredicateEditorSize:[predicateEditor numberOfRows]];
+    NSLog(@"rileEditorRowsDidChange");
 }
 
 #pragma mark Search
@@ -46,11 +47,21 @@
 - (IBAction)basicSearch:(id)sender {
     // Change internal NSPredicate and the NSPredicateEditor to match the basic query
     NSString *name = [sender stringValue];
-    NSArray *subpredicates = [NSArray arrayWithObject:[NSPredicate predicateWithFormat:@"name CONTAINS %@", name]];
-    NSPredicate *newPredicate = [NSCompoundPredicate orPredicateWithSubpredicates:subpredicates];
-    [predicateEditor setObjectValue:newPredicate];
-    NSLog(@"Basic Predicate: %@", [newPredicate predicateFormat]);
-    [self setPredicate:newPredicate];
+    if([name isEqual:@""]) {
+        [self setPredicate:nil];
+        [predicateEditor setObjectValue:nil];
+    } else {
+        NSArray *subpredicates = [NSArray arrayWithObject:[NSPredicate predicateWithFormat:@"name CONTAINS %@", name]];
+        NSPredicate *newPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:subpredicates];
+        // I know what I am doing to you, so I dont want to be your delegate for now
+        [predicateEditor setDelegate:nil];
+        [predicateEditor setObjectValue:newPredicate];
+        [self setPredicate:newPredicate];
+        [self changePredicateEditorSize:[predicateEditor numberOfRows]];
+        // Now I want to know what you do :)
+        [predicateEditor setDelegate:self];
+        NSLog(@"Basic Predicate: %@", [newPredicate predicateFormat]);
+    }
 }
 
 - (IBAction)hidePredicateEditor:(id)sender {
@@ -60,6 +71,7 @@
 #pragma mark Private Methods
 
 - (void)changePredicateEditorSize:(NSInteger) newRowCount {
+    NSLog(@"ROWS: %d", newRowCount);
     if (newRowCount == rowCount)
         return;
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090906/c2c343c2/attachment.html>


More information about the macports-changes mailing list