[55020] branches/gsoc09-gui/MPGUI

juanger at macports.org juanger at macports.org
Wed Aug 5 20:00:38 PDT 2009


Revision: 55020
          http://trac.macports.org/changeset/55020
Author:   juanger at macports.org
Date:     2009-08-05 20:00:37 -0700 (Wed, 05 Aug 2009)
Log Message:
-----------
Validating the toolbar items according to the status given by notifications

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

Modified: branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib
===================================================================
--- branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-08-06 02:58:56 UTC (rev 55019)
+++ branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-08-06 03:00:37 UTC (rev 55020)
@@ -2034,7 +2034,7 @@
 																				<reference ref="385089462"/>
 																			</object>
 																		</object>
-																		<object class="NSMutableDictionary" id="218651735">
+																		<object class="NSMutableDictionary" id="290592459">
 																			<bool key="EncodedWithXMLCoder">YES</bool>
 																			<object class="NSMutableArray" key="dict.sortedKeys">
 																				<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2160,7 +2160,7 @@
 																					<bool key="EncodedWithXMLCoder">YES</bool>
 																					<reference ref="375100135"/>
 																					<reference ref="1016684085"/>
-																					<reference ref="218651735"/>
+																					<reference ref="290592459"/>
 																				</object>
 																				<object class="NSMutableArray">
 																					<bool key="EncodedWithXMLCoder">YES</bool>
@@ -3784,6 +3784,62 @@
 					</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"/>
+						<object class="NSNibBindingConnector" key="connector">
+							<reference key="NSSource" ref="650498606"/>
+							<reference key="NSDestination" ref="245714563"/>
+							<string key="NSLabel">enabled: busy</string>
+							<string key="NSBinding">enabled</string>
+							<string key="NSKeyPath">busy</string>
+							<object class="NSDictionary" key="NSOptions">
+								<string key="NS.key.0">NSValueTransformerName</string>
+								<string key="NS.object.0">NSNegateBoolean</string>
+							</object>
+							<int key="NSNibBindingConnectorVersion">2</int>
+						</object>
+					</object>
+					<int key="connectionID">775</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">activityController</string>
+						<reference key="source" ref="800227439"/>
+						<reference key="destination" ref="245714563"/>
+					</object>
+					<int key="connectionID">776</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">cancel</string>
+						<reference key="source" ref="800227439"/>
+						<reference key="destination" ref="651362317"/>
+					</object>
+					<int key="connectionID">777</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBBindingConnection" key="connection">
+						<string key="label">hidden: 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">hidden: busy</string>
+							<string key="NSBinding">hidden</string>
+							<string key="NSKeyPath">busy</string>
+							<object class="NSDictionary" key="NSOptions">
+								<string key="NS.key.0">NSValueTransformerName</string>
+								<string key="NS.object.0">NSNegateBoolean</string>
+							</object>
+							<int key="NSNibBindingConnectorVersion">2</int>
+						</object>
+					</object>
+					<int key="connectionID">780</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -5559,9 +5615,9 @@
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
-					<string>{{1576, 251}, {773, 449}}</string>
+					<string>{{298, 246}, {773, 449}}</string>
 					<reference ref="6"/>
-					<string>{{1576, 251}, {773, 449}}</string>
+					<string>{{298, 246}, {773, 449}}</string>
 					<reference ref="9"/>
 					<string>{{33, 99}, {480, 360}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5593,7 +5649,7 @@
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{1654, 700}, {617, 0}}</string>
+					<string>{{324, 693}, {617, 0}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5730,7 +5786,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">772</int>
+			<int key="maxID">780</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -5802,11 +5858,15 @@
 						<bool key="EncodedWithXMLCoder">YES</bool>
 						<object class="NSMutableArray" key="dict.sortedKeys">
 							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>activityController</string>
+							<string>cancel</string>
 							<string>ports</string>
 							<string>tableController</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>ActivityController</string>
+							<string>NSToolbarItem</string>
 							<string>NSArrayController</string>
 							<string>PortsTableController</string>
 						</object>

Modified: branches/gsoc09-gui/MPGUI/MPActionsController.h
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionsController.h	2009-08-06 02:58:56 UTC (rev 55019)
+++ branches/gsoc09-gui/MPGUI/MPActionsController.h	2009-08-06 03:00:37 UTC (rev 55020)
@@ -9,11 +9,15 @@
 #import <Cocoa/Cocoa.h>
 #import "MPActionLauncher.h"
 #import "PortsTableController.h"
+#import "ActivityController.h"
 
 
 @interface MPActionsController : NSObject {
     IBOutlet NSArrayController *ports;
     IBOutlet PortsTableController *tableController;
+    IBOutlet ActivityController *activityController;
+    
+    IBOutlet NSToolbarItem *cancel;
 }
 
 - (IBAction)openPreferences:(id)sender;

Modified: branches/gsoc09-gui/MPGUI/MPActionsController.m
===================================================================
--- branches/gsoc09-gui/MPGUI/MPActionsController.m	2009-08-06 02:58:56 UTC (rev 55019)
+++ branches/gsoc09-gui/MPGUI/MPActionsController.m	2009-08-06 03:00:37 UTC (rev 55020)
@@ -50,13 +50,17 @@
 }
 
 - (IBAction)cancel:(id)sender {
+    [activityController setBusy:NO]; // TODO: Should I set this with a notification?
     [[MPActionLauncher sharedInstance] cancelPortProcess];
 }
 
-//-(BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem {
-//    BOOL enable = ![[MPActionLauncher sharedInstance] isBusy];
-//    return enable;
-//}
+-(BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem {
+    BOOL enable = ![activityController busy];
+    if ([[toolbarItem itemIdentifier] isEqual:[cancel itemIdentifier]]) {
+        enable = !enable;
+    } 
+    return enable;
+}
 
 #pragma mark App Delegate
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090805/beb19355/attachment.html>


More information about the macports-changes mailing list