[52520] branches/gsoc09-gui/MPGUI

juanger at macports.org juanger at macports.org
Wed Jun 17 22:32:35 PDT 2009


Revision: 52520
          http://trac.macports.org/changeset/52520
Author:   juanger at macports.org
Date:     2009-06-17 22:32:34 -0700 (Wed, 17 Jun 2009)
Log Message:
-----------
Adding StatePredicateTemplate (NSPredicateEditorRowTemplate subclass) to add state based search.

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

Added Paths:
-----------
    branches/gsoc09-gui/MPGUI/StatePredicateTemplate.h
    branches/gsoc09-gui/MPGUI/StatePredicateTemplate.m

Modified: branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib
===================================================================
--- branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-06-18 04:53:21 UTC (rev 52519)
+++ branches/gsoc09-gui/MPGUI/English.lproj/MainMenu.xib	2009-06-18 05:32:34 UTC (rev 52520)
@@ -8,7 +8,7 @@
 		<string key="IBDocument.HIToolboxVersion">353.00</string>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="420"/>
+			<integer value="378"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -766,7 +766,7 @@
 				<int key="NSWindowBacking">2</int>
 				<string key="NSWindowRect">{{335, 301}, {773, 449}}</string>
 				<int key="NSWTFlags">1946157056</int>
-				<string key="NSWindowTitle">SourceTablePred</string>
+				<string key="NSWindowTitle">MPGUI</string>
 				<string key="NSWindowClass">NSWindow</string>
 				<object class="NSToolbar" key="NSViewClass" id="978062640">
 					<object class="NSMutableString" key="NSToolbarIdentifier">
@@ -798,10 +798,9 @@
 								<string key="NSToolbarItemPaletteLabel">Search</string>
 								<nil key="NSToolbarItemToolTip"/>
 								<object class="NSSearchField" key="NSToolbarItemView" id="848482443">
-									<reference key="NSNextResponder"/>
+									<nil key="NSNextResponder"/>
 									<int key="NSvFlags">268</int>
 									<string key="NSFrame">{{0, 14}, {133, 22}}</string>
-									<reference key="NSSuperview"/>
 									<bool key="NSEnabled">YES</bool>
 									<object class="NSSearchFieldCell" key="NSCell" id="618193001">
 										<int key="NSCellFlags">343014976</int>
@@ -1271,7 +1270,7 @@
 																			<int key="NSvFlags">257</int>
 																			<string key="NSFrame">{{741, 4}, {18, 18}}</string>
 																			<reference key="NSSuperview" ref="696129103"/>
-																			<reference key="NSNextKeyView" ref="872100568"/>
+																			<reference key="NSNextKeyView" ref="820506859"/>
 																			<int key="NSTag">-1</int>
 																			<bool key="NSEnabled">YES</bool>
 																			<object class="NSRuleEditorButtonCell" key="NSCell">
@@ -1446,7 +1445,7 @@
 																							<reference key="NSOnImage" ref="35465992"/>
 																							<reference key="NSMixedImage" ref="566991132"/>
 																							<string key="NSAction">_popUpItemAction:</string>
-																							<integer value="4" key="NSRepObject"/>
+																							<integer value="4" key="NSRepObject" id="12"/>
 																							<reference key="NSTarget" ref="108954362"/>
 																						</object>
 																						<object class="NSMenuItem" id="294835276">
@@ -1556,7 +1555,7 @@
 																			</object>
 																			<object class="NSMutableArray" key="dict.values">
 																				<bool key="EncodedWithXMLCoder">YES</bool>
-																				<integer value="3"/>
+																				<integer value="3" id="11"/>
 																				<reference ref="755579174"/>
 																			</object>
 																		</object>
@@ -1571,8 +1570,347 @@
 																	<int key="NSRuleOptionPlusButtonRowType">0</int>
 																	<bool key="NSRuleOptionEditable">YES</bool>
 																</object>
+																<object class="NSRuleEditorViewSliceRow" id="820506859">
+																	<reference key="NSNextResponder" ref="887125716"/>
+																	<int key="NSvFlags">290</int>
+																	<object class="NSMutableArray" key="NSSubviews">
+																		<bool key="EncodedWithXMLCoder">YES</bool>
+																		<object class="NSButton" id="30199842">
+																			<reference key="NSNextResponder" ref="820506859"/>
+																			<int key="NSvFlags">257</int>
+																			<string key="NSFrame">{{741, 4}, {18, 18}}</string>
+																			<reference key="NSSuperview" ref="820506859"/>
+																			<reference key="NSNextKeyView" ref="872100568"/>
+																			<int key="NSTag">-1</int>
+																			<bool key="NSEnabled">YES</bool>
+																			<object class="NSRuleEditorButtonCell" key="NSCell">
+																				<int key="NSCellFlags">67239424</int>
+																				<int key="NSCellFlags2">134348800</int>
+																				<string key="NSContents">+</string>
+																				<reference key="NSSupport" ref="29"/>
+																				<string key="NSAction">_addOption:</string>
+																				<reference key="NSTarget" ref="820506859"/>
+																				<reference key="NSControlView" ref="30199842"/>
+																				<int key="NSButtonFlags">-2038284033</int>
+																				<int key="NSButtonFlags2">36</int>
+																				<reference key="NSAlternateImage" ref="28"/>
+																				<string key="NSKeyEquivalent"/>
+																				<int key="NSPeriodicDelay">400</int>
+																				<int key="NSPeriodicInterval">75</int>
+																			</object>
+																		</object>
+																		<object class="NSButton" id="741335170">
+																			<reference key="NSNextResponder" ref="820506859"/>
+																			<int key="NSvFlags">257</int>
+																			<string key="NSFrame">{{721, 4}, {18, 18}}</string>
+																			<reference key="NSSuperview" ref="820506859"/>
+																			<reference key="NSNextKeyView" ref="30199842"/>
+																			<int key="NSTag">-1</int>
+																			<bool key="NSEnabled">YES</bool>
+																			<object class="NSRuleEditorButtonCell" key="NSCell">
+																				<int key="NSCellFlags">67239424</int>
+																				<int key="NSCellFlags2">134348800</int>
+																				<string key="NSContents">-</string>
+																				<reference key="NSSupport" ref="29"/>
+																				<string key="NSAction">_deleteOption:</string>
+																				<reference key="NSTarget" ref="820506859"/>
+																				<reference key="NSControlView" ref="741335170"/>
+																				<int key="NSButtonFlags">-2038284033</int>
+																				<int key="NSButtonFlags2">36</int>
+																				<reference key="NSAlternateImage" ref="28"/>
+																				<string key="NSKeyEquivalent"/>
+																				<int key="NSPeriodicDelay">400</int>
+																				<int key="NSPeriodicInterval">75</int>
+																			</object>
+																		</object>
+																		<object class="NSPopUpButton" id="974900885">
+																			<reference key="NSNextResponder" ref="820506859"/>
+																			<int key="NSvFlags">256</int>
+																			<string key="NSFrame">{{37, 3}, {64, 19}}</string>
+																			<reference key="NSSuperview" ref="820506859"/>
+																			<reference key="NSNextKeyView" ref="207821348"/>
+																			<int key="NSTag">-1</int>
+																			<bool key="NSEnabled">YES</bool>
+																			<object class="NSPopUpButtonCell" key="NSCell" id="186778731">
+																				<int key="NSCellFlags">67239488</int>
+																				<int key="NSCellFlags2">4196352</int>
+																				<reference key="NSSupport" ref="26"/>
+																				<object class="NSKeyPathExpression" key="NSRepresentedObject" id="216417465">
+																					<int key="NSExpressionType">3</int>
+																					<string key="NSSelectorName">valueForKey:</string>
+																					<object class="NSSelfExpression" key="NSOperand">
+																						<int key="NSExpressionType">1</int>
+																					</object>
+																					<object class="NSMutableArray" key="NSArguments">
+																						<bool key="EncodedWithXMLCoder">YES</bool>
+																						<object class="NSKeyPathSpecifierExpression">
+																							<int key="NSExpressionType">10</int>
+																							<string key="NSKeyPath">state</string>
+																						</object>
+																					</object>
+																				</object>
+																				<reference key="NSControlView" ref="974900885"/>
+																				<int key="NSButtonFlags">-2038284033</int>
+																				<int key="NSButtonFlags2">36</int>
+																				<reference key="NSAlternateImage" ref="753190765"/>
+																				<string key="NSKeyEquivalent"/>
+																				<int key="NSPeriodicDelay">400</int>
+																				<int key="NSPeriodicInterval">75</int>
+																				<object class="NSMenuItem" key="NSMenuItem" id="316739235">
+																					<reference key="NSMenu" ref="137032907"/>
+																					<string key="NSTitle">state</string>
+																					<string key="NSKeyEquiv"/>
+																					<int key="NSKeyEquivModMask">1048576</int>
+																					<int key="NSMnemonicLoc">2147483647</int>
+																					<int key="NSState">1</int>
+																					<reference key="NSOnImage" ref="35465992"/>
+																					<reference key="NSMixedImage" ref="566991132"/>
+																					<string key="NSAction">_popUpItemAction:</string>
+																					<reference key="NSRepObject" ref="216417465"/>
+																					<reference key="NSTarget" ref="186778731"/>
+																				</object>
+																				<bool key="NSMenuItemRespectAlignment">YES</bool>
+																				<object class="NSMenu" key="NSMenu" id="137032907">
+																					<string key="NSTitle"/>
+																					<object class="NSMutableArray" key="NSMenuItems">
+																						<bool key="EncodedWithXMLCoder">YES</bool>
+																						<reference ref="316739235"/>
+																					</object>
+																				</object>
+																				<int key="NSPreferredEdge">3</int>
+																				<bool key="NSUsesItemFromMenu">YES</bool>
+																				<bool key="NSAltersState">YES</bool>
+																				<int key="NSArrowPosition">2</int>
+																			</object>
+																		</object>
+																		<object class="NSPopUpButton" id="207821348">
+																			<reference key="NSNextResponder" ref="820506859"/>
+																			<int key="NSvFlags">256</int>
+																			<string key="NSFrame">{{107, 3}, {46, 19}}</string>
+																			<reference key="NSSuperview" ref="820506859"/>
+																			<reference key="NSNextKeyView" ref="11724982"/>
+																			<int key="NSTag">-1</int>
+																			<bool key="NSEnabled">YES</bool>
+																			<object class="NSPopUpButtonCell" key="NSCell" id="898314192">
+																				<int key="NSCellFlags">67239488</int>
+																				<int key="NSCellFlags2">4196352</int>
+																				<reference key="NSSupport" ref="26"/>
+																				<reference key="NSRepresentedObject" ref="12"/>
+																				<reference key="NSControlView" ref="207821348"/>
+																				<int key="NSButtonFlags">-2038284033</int>
+																				<int key="NSButtonFlags2">36</int>
+																				<reference key="NSAlternateImage" ref="753190765"/>
+																				<string key="NSKeyEquivalent"/>
+																				<int key="NSPeriodicDelay">400</int>
+																				<int key="NSPeriodicInterval">75</int>
+																				<object class="NSMenuItem" key="NSMenuItem" id="694675644">
+																					<reference key="NSMenu" ref="410720919"/>
+																					<string key="NSTitle">is</string>
+																					<string key="NSKeyEquiv"/>
+																					<int key="NSKeyEquivModMask">1048576</int>
+																					<int key="NSMnemonicLoc">2147483647</int>
+																					<int key="NSState">1</int>
+																					<reference key="NSOnImage" ref="35465992"/>
+																					<reference key="NSMixedImage" ref="566991132"/>
+																					<string key="NSAction">_popUpItemAction:</string>
+																					<reference key="NSRepObject" ref="12"/>
+																					<reference key="NSTarget" ref="898314192"/>
+																				</object>
+																				<bool key="NSMenuItemRespectAlignment">YES</bool>
+																				<object class="NSMenu" key="NSMenu" id="410720919">
+																					<string key="NSTitle"/>
+																					<object class="NSMutableArray" key="NSMenuItems">
+																						<bool key="EncodedWithXMLCoder">YES</bool>
+																						<reference ref="694675644"/>
+																					</object>
+																				</object>
+																				<int key="NSPreferredEdge">3</int>
+																				<bool key="NSUsesItemFromMenu">YES</bool>
+																				<bool key="NSAltersState">YES</bool>
+																				<int key="NSArrowPosition">2</int>
+																			</object>
+																		</object>
+																		<object class="NSPopUpButton" id="11724982">
+																			<reference key="NSNextResponder" ref="820506859"/>
+																			<int key="NSvFlags">256</int>
+																			<string key="NSFrame">{{159, 3}, {155, 19}}</string>
+																			<reference key="NSSuperview" ref="820506859"/>
+																			<reference key="NSNextKeyView" ref="741335170"/>
+																			<int key="NSTag">-1</int>
+																			<bool key="NSEnabled">YES</bool>
+																			<object class="NSPopUpButtonCell" key="NSCell" id="923487559">
+																				<int key="NSCellFlags">67239488</int>
+																				<int key="NSCellFlags2">2048</int>
+																				<reference key="NSSupport" ref="26"/>
+																				<object class="NSConstantValueExpression" key="NSRepresentedObject" id="235441946">
+																					<int key="NSExpressionType">0</int>
+																					<string key="NSConstantValue">Any</string>
+																				</object>
+																				<reference key="NSControlView" ref="11724982"/>
+																				<int key="NSButtonFlags">-2038284033</int>
+																				<int key="NSButtonFlags2">36</int>
+																				<reference key="NSAlternateImage" ref="753190765"/>
+																				<string key="NSKeyEquivalent"/>
+																				<int key="NSPeriodicDelay">400</int>
+																				<int key="NSPeriodicInterval">75</int>
+																				<object class="NSMenuItem" key="NSMenuItem" id="352720977">
+																					<reference key="NSMenu" ref="761227369"/>
+																					<string key="NSTitle">Any</string>
+																					<string key="NSKeyEquiv"/>
+																					<int key="NSKeyEquivModMask">1048576</int>
+																					<int key="NSMnemonicLoc">2147483647</int>
+																					<int key="NSState">1</int>
+																					<reference key="NSOnImage" ref="35465992"/>
+																					<reference key="NSMixedImage" ref="566991132"/>
+																					<string key="NSAction">_popUpItemAction:</string>
+																					<reference key="NSRepObject" ref="235441946"/>
+																					<reference key="NSTarget" ref="923487559"/>
+																				</object>
+																				<bool key="NSMenuItemRespectAlignment">YES</bool>
+																				<object class="NSMenu" key="NSMenu" id="761227369">
+																					<string key="NSTitle"/>
+																					<object class="NSMutableArray" key="NSMenuItems">
+																						<bool key="EncodedWithXMLCoder">YES</bool>
+																						<reference ref="352720977"/>
+																						<object class="NSMenuItem" id="1012628434">
+																							<reference key="NSMenu" ref="761227369"/>
+																							<string key="NSTitle">Installed</string>
+																							<string key="NSKeyEquiv"/>
+																							<int key="NSKeyEquivModMask">1048576</int>
+																							<int key="NSMnemonicLoc">2147483647</int>
+																							<reference key="NSOnImage" ref="35465992"/>
+																							<reference key="NSMixedImage" ref="566991132"/>
+																							<string key="NSAction">_popUpItemAction:</string>
+																							<object class="NSConstantValueExpression" key="NSRepObject">
+																								<int key="NSExpressionType">0</int>
+																								<string key="NSConstantValue">Installed</string>
+																							</object>
+																							<reference key="NSTarget" ref="923487559"/>
+																						</object>
+																						<object class="NSMenuItem" id="512246893">
+																							<reference key="NSMenu" ref="761227369"/>
+																							<string key="NSTitle">Outdated</string>
+																							<string key="NSKeyEquiv"/>
+																							<int key="NSKeyEquivModMask">1048576</int>
+																							<int key="NSMnemonicLoc">2147483647</int>
+																							<reference key="NSOnImage" ref="35465992"/>
+																							<reference key="NSMixedImage" ref="566991132"/>
+																							<string key="NSAction">_popUpItemAction:</string>
+																							<object class="NSConstantValueExpression" key="NSRepObject">
+																								<int key="NSExpressionType">0</int>
+																								<string key="NSConstantValue">Outdated</string>
+																							</object>
+																							<reference key="NSTarget" ref="923487559"/>
+																						</object>
+																						<object class="NSMenuItem" id="296621711">
+																							<reference key="NSMenu" ref="761227369"/>
+																							<string key="NSTitle">Not Installed</string>
+																							<string key="NSKeyEquiv"/>
+																							<int key="NSKeyEquivModMask">1048576</int>
+																							<int key="NSMnemonicLoc">2147483647</int>
+																							<reference key="NSOnImage" ref="35465992"/>
+																							<reference key="NSMixedImage" ref="566991132"/>
+																							<string key="NSAction">_popUpItemAction:</string>
+																							<object class="NSConstantValueExpression" key="NSRepObject">
+																								<int key="NSExpressionType">0</int>
+																								<string key="NSConstantValue">Not Installed</string>
+																							</object>
+																							<reference key="NSTarget" ref="923487559"/>
+																						</object>
+																					</object>
+																				</object>
+																				<int key="NSPreferredEdge">3</int>
+																				<bool key="NSUsesItemFromMenu">YES</bool>
+																				<bool key="NSAltersState">YES</bool>
+																				<int key="NSArrowPosition">2</int>
+																			</object>
+																		</object>
+																	</object>
+																	<string key="NSFrame">{{0, 50}, {769, 25}}</string>
+																	<reference key="NSSuperview" ref="887125716"/>
+																	<reference key="NSNextKeyView" ref="974900885"/>
+																	<int key="NSRuleRowIndex">2</int>
+																	<int key="NSRuleIndentation">1</int>
+																	<reference key="NSContainingRuleEditorView" ref="872100568"/>
+																	<nil key="NSRuleBackgroundColor"/>
+																	<object class="NSMutableArray" key="NSRuleOptionViews">
+																		<bool key="EncodedWithXMLCoder">YES</bool>
+																		<reference ref="974900885"/>
+																		<reference ref="207821348"/>
+																		<reference ref="11724982"/>
+																	</object>
+																	<int key="NSRuleOptionFrames.count">3</int>
+																	<string key="NSRuleOptionFrames.0">{{37, 3}, {64, 19}}</string>
+																	<string key="NSRuleOptionFrames.1">{{107, 3}, {46, 19}}</string>
+																	<string key="NSRuleOptionFrames.2">{{159, 3}, {155, 19}}</string>
+																	<object class="NSMutableArray" key="NSRuleOptionItems">
+																		<bool key="EncodedWithXMLCoder">YES</bool>
+																		<object class="NSMutableDictionary" id="1009297403">
+																			<bool key="EncodedWithXMLCoder">YES</bool>
+																			<object class="NSMutableArray" key="dict.sortedKeys">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<string>depth</string>
+																				<string>pattern</string>
+																			</object>
+																			<object class="NSMutableArray" key="dict.values">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<reference ref="9"/>
+																				<object class="NSPredicateEditorRowTemplate" id="385089462">
+																					<int key="NSPredicateTemplateType">1</int>
+																					<int key="NSPredicateTemplateOptions">0</int>
+																					<int key="NSPredicateTemplateModifier">0</int>
+																					<int key="NSPredicateTemplateLeftAttributeType">0</int>
+																					<int key="NSPredicateTemplateRightAttributeType">0</int>
+																					<object class="NSArray" key="NSPredicateTemplateViews">
+																						<bool key="EncodedWithXMLCoder">YES</bool>
+																						<reference ref="974900885"/>
+																						<reference ref="207821348"/>
+																						<reference ref="11724982"/>
+																					</object>
+																					<bool key="NSPredicateTemplateLeftIsWildcard">NO</bool>
+																					<bool key="NSPredicateTemplateRightIsWildcard">NO</bool>
+																				</object>
+																			</object>
+																		</object>
+																		<object class="NSMutableDictionary" id="223514688">
+																			<bool key="EncodedWithXMLCoder">YES</bool>
+																			<object class="NSMutableArray" key="dict.sortedKeys">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<string>depth</string>
+																				<string>pattern</string>
+																			</object>
+																			<object class="NSMutableArray" key="dict.values">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<reference ref="10"/>
+																				<reference ref="385089462"/>
+																			</object>
+																		</object>
+																		<object class="NSMutableDictionary" id="210503436">
+																			<bool key="EncodedWithXMLCoder">YES</bool>
+																			<object class="NSMutableArray" key="dict.sortedKeys">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<string>depth</string>
+																				<string>pattern</string>
+																			</object>
+																			<object class="NSMutableArray" key="dict.values">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<reference ref="11"/>
+																				<reference ref="385089462"/>
+																			</object>
+																		</object>
+																	</object>
+																	<int key="NSRuleOptionInitialFrames.count">3</int>
+																	<string key="NSRuleOptionInitialFrames.0">{{37, 3}, {64, 19}}</string>
+																	<string key="NSRuleOptionInitialFrames.1">{{107, 3}, {46, 19}}</string>
+																	<string key="NSRuleOptionInitialFrames.2">{{159, 3}, {155, 19}}</string>
+																	<reference key="NSRuleOptionAddButton" ref="30199842"/>
+																	<reference key="NSRuleOptionSubtractButton" ref="741335170"/>
+																	<int key="NSRuleOptionRowType">0</int>
+																	<int key="NSRuleOptionPlusButtonRowType">0</int>
+																	<bool key="NSRuleOptionEditable">YES</bool>
+																</object>
 															</object>
-															<string key="NSFrame">{{1, 1}, {769, 48}}</string>
+															<string key="NSFrame">{{1, 1}, {769, 73}}</string>
 															<reference key="NSSuperview" ref="872100568"/>
 															<reference key="NSNextKeyView" ref="478303413"/>
 														</object>
@@ -1584,7 +1922,7 @@
 															<string>NSRuleEditorItemPBoardType</string>
 														</object>
 													</object>
-													<string key="NSFrameSize">{771, 50}</string>
+													<string key="NSFrameSize">{771, 75}</string>
 													<reference key="NSSuperview" ref="646625812"/>
 													<reference key="NSNextKeyView" ref="887125716"/>
 													<bool key="NSEnabled">YES</bool>
@@ -1652,12 +1990,41 @@
 																					<reference ref="855084085"/>
 																					<reference ref="309287992"/>
 																				</object>
-																				<integer value="0"/>
+																				<integer value="0" id="8"/>
 																				<object class="NSMutableArray">
 																					<bool key="EncodedWithXMLCoder">YES</bool>
 																				</object>
 																			</object>
 																		</object>
+																		<object class="NSMutableDictionary">
+																			<bool key="EncodedWithXMLCoder">YES</bool>
+																			<object class="NSMutableArray" key="dict.sortedKeys">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<string>criteria</string>
+																				<string>displayValues</string>
+																				<string>rowType</string>
+																				<string>subrows</string>
+																			</object>
+																			<object class="NSMutableArray" key="dict.values">
+																				<bool key="EncodedWithXMLCoder">YES</bool>
+																				<object class="NSMutableArray">
+																					<bool key="EncodedWithXMLCoder">YES</bool>
+																					<reference ref="1009297403"/>
+																					<reference ref="223514688"/>
+																					<reference ref="210503436"/>
+																				</object>
+																				<object class="NSMutableArray">
+																					<bool key="EncodedWithXMLCoder">YES</bool>
+																					<reference ref="974900885"/>
+																					<reference ref="207821348"/>
+																					<reference ref="11724982"/>
+																				</object>
+																				<reference ref="8"/>
+																				<object class="NSMutableArray">
+																					<bool key="EncodedWithXMLCoder">YES</bool>
+																				</object>
+																			</object>
+																		</object>
 																	</object>
 																</object>
 															</object>
@@ -1667,16 +2034,19 @@
 														<bool key="EncodedWithXMLCoder">YES</bool>
 														<reference ref="478303413"/>
 														<reference ref="696129103"/>
+														<reference ref="820506859"/>
 													</object>
 													<object class="NSArray" key="NSPredicateTemplates">
 														<bool key="EncodedWithXMLCoder">YES</bool>
 														<reference ref="715417482"/>
 														<reference ref="755579174"/>
+														<reference ref="385089462"/>
 													</object>
 													<nil key="NSPredicateEditorPredicate"/>
 												</object>
 											</object>
 											<string key="NSFrame">{{1, 1}, {771, 25}}</string>
+											<string key="NSBounds">{{0, 50}, {771, 25}}</string>
 											<reference key="NSSuperview" ref="815512319"/>
 											<reference key="NSNextKeyView" ref="872100568"/>
 											<reference key="NSDocView" ref="872100568"/>
@@ -1940,7 +2310,7 @@
 									<reference key="NSCornerView" ref="538338821"/>
 									<bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
 								</object>
-								<object class="NSProgressIndicator" id="228637178">
+								<object class="NSProgressIndicator" id="517575346">
 									<reference key="NSNextResponder" ref="169664854"/>
 									<int key="NSvFlags">1292</int>
 									<object class="NSPSMatrix" key="NSDrawMatrix"/>
@@ -2672,10 +3042,10 @@
 				<object class="IBConnectionRecord">
 					<object class="IBBindingConnection" key="connection">
 						<string key="label">animate: isLoading</string>
-						<reference key="source" ref="228637178"/>
+						<reference key="source" ref="517575346"/>
 						<reference key="destination" ref="1022824499"/>
 						<object class="NSNibBindingConnector" key="connector">
-							<reference key="NSSource" ref="228637178"/>
+							<reference key="NSSource" ref="517575346"/>
 							<reference key="NSDestination" ref="1022824499"/>
 							<string key="NSLabel">animate: isLoading</string>
 							<string key="NSBinding">animate</string>
@@ -3502,7 +3872,7 @@
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="815512319"/>
 							<reference ref="520202466"/>
-							<reference ref="228637178"/>
+							<reference ref="517575346"/>
 						</object>
 						<reference key="parent" ref="439893737"/>
 					</object>
@@ -3614,6 +3984,7 @@
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="715417482"/>
 							<reference ref="755579174"/>
+							<reference ref="385089462"/>
 						</object>
 						<reference key="parent" ref="815512319"/>
 					</object>
@@ -3740,9 +4111,80 @@
 					</object>
 					<object class="IBObjectRecord">
 						<int key="objectID">557</int>
-						<reference key="object" ref="228637178"/>
+						<reference key="object" ref="517575346"/>
 						<reference key="parent" ref="169664854"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">572</int>
+						<reference key="object" ref="385089462"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="137032907"/>
+							<reference ref="410720919"/>
+							<reference ref="761227369"/>
+						</object>
+						<reference key="parent" ref="872100568"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">573</int>
+						<reference key="object" ref="137032907"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="316739235"/>
+						</object>
+						<reference key="parent" ref="385089462"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">577</int>
+						<reference key="object" ref="410720919"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="694675644"/>
+						</object>
+						<reference key="parent" ref="385089462"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">581</int>
+						<reference key="object" ref="694675644"/>
+						<reference key="parent" ref="410720919"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">585</int>
+						<reference key="object" ref="316739235"/>
+						<reference key="parent" ref="137032907"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">614</int>
+						<reference key="object" ref="761227369"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="352720977"/>
+							<reference ref="1012628434"/>
+							<reference ref="512246893"/>
+							<reference ref="296621711"/>
+						</object>
+						<reference key="parent" ref="385089462"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">618</int>
+						<reference key="object" ref="352720977"/>
+						<reference key="parent" ref="761227369"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">619</int>
+						<reference key="object" ref="1012628434"/>
+						<reference key="parent" ref="761227369"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">620</int>
+						<reference key="object" ref="512246893"/>
+						<reference key="parent" ref="761227369"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">621</int>
+						<reference key="object" ref="296621711"/>
+						<reference key="parent" ref="761227369"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -3959,8 +4401,13 @@
 					<string>57.IBPluginDependency</string>
 					<string>57.ImportedFromIB2</string>
 					<string>57.editorWindowContentRectSynchronizationRect</string>
+					<string>572.CustomClassName</string>
+					<string>573.IBPluginDependency</string>
+					<string>577.IBPluginDependency</string>
 					<string>58.IBPluginDependency</string>
 					<string>58.ImportedFromIB2</string>
+					<string>581.IBPluginDependency</string>
+					<string>585.IBPluginDependency</string>
 					<string>72.IBPluginDependency</string>
 					<string>72.ImportedFromIB2</string>
 					<string>73.IBPluginDependency</string>
@@ -4126,9 +4573,9 @@
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
-					<string>{{56, 240}, {773, 449}}</string>
+					<string>{{22, 221}, {773, 449}}</string>
 					<reference ref="6"/>
-					<string>{{56, 240}, {773, 449}}</string>
+					<string>{{22, 221}, {773, 449}}</string>
 					<reference ref="9"/>
 					<string>{{33, 99}, {480, 360}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -4158,7 +4605,7 @@
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{134, 520}, {617, 169}}</string>
+					<string>{{134, 689}, {617, 0}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -4199,9 +4646,14 @@
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
 					<string>{{23, 794}, {245, 183}}</string>
+					<string>StatePredicateTemplate</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
@@ -4248,7 +4700,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">571</int>
+			<int key="maxID">621</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -4297,6 +4749,14 @@
 						<string key="minorKey">PortsTableController.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">StatePredicateTemplate</string>
+					<string key="superclassName">NSPredicateEditorRowTemplate</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">StatePredicateTemplate.h</string>
+					</object>
+				</object>
 			</object>
 		</object>
 		<int key="IBDocument.localizationMode">0</int>

Modified: branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj
===================================================================
--- branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj	2009-06-18 04:53:21 UTC (rev 52519)
+++ branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj	2009-06-18 05:32:34 UTC (rev 52520)
@@ -15,6 +15,7 @@
 		21FC226A0FE8895900B1E835 /* StateTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 21FC22690FE8895900B1E835 /* StateTransformer.m */; };
 		21FC226D0FE88A2A00B1E835 /* Installed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 21FC226B0FE88A2A00B1E835 /* Installed.tiff */; };
 		21FC226E0FE88A2A00B1E835 /* Outdated.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 21FC226C0FE88A2A00B1E835 /* Outdated.tiff */; };
+		21FC233B0FE8AB0400B1E835 /* StatePredicateTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = 21FC233A0FE8AB0400B1E835 /* StatePredicateTemplate.m */; };
 		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
 		8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
 		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
@@ -92,6 +93,8 @@
 		21FC22690FE8895900B1E835 /* StateTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StateTransformer.m; sourceTree = "<group>"; };
 		21FC226B0FE88A2A00B1E835 /* Installed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Installed.tiff; sourceTree = "<group>"; };
 		21FC226C0FE88A2A00B1E835 /* Outdated.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Outdated.tiff; sourceTree = "<group>"; };
+		21FC23390FE8AB0400B1E835 /* StatePredicateTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatePredicateTemplate.h; sourceTree = "<group>"; };
+		21FC233A0FE8AB0400B1E835 /* StatePredicateTemplate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatePredicateTemplate.m; sourceTree = "<group>"; };
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
@@ -174,6 +177,8 @@
 			children = (
 				21FC22680FE8895900B1E835 /* StateTransformer.h */,
 				21FC22690FE8895900B1E835 /* StateTransformer.m */,
+				21FC23390FE8AB0400B1E835 /* StatePredicateTemplate.h */,
+				21FC233A0FE8AB0400B1E835 /* StatePredicateTemplate.m */,
 			);
 			name = Helpers;
 			sourceTree = "<group>";
@@ -349,6 +354,7 @@
 				21F1675A0FE3382D00542AEE /* PortsTableController.m in Sources */,
 				214BAFE40FE7164200BD1B46 /* MPActionLauncher.m in Sources */,
 				21FC226A0FE8895900B1E835 /* StateTransformer.m in Sources */,
+				21FC233B0FE8AB0400B1E835 /* StatePredicateTemplate.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: branches/gsoc09-gui/MPGUI/PortsTableController.m
===================================================================
--- branches/gsoc09-gui/MPGUI/PortsTableController.m	2009-06-18 04:53:21 UTC (rev 52519)
+++ branches/gsoc09-gui/MPGUI/PortsTableController.m	2009-06-18 05:32:34 UTC (rev 52520)
@@ -38,19 +38,9 @@
 - (IBAction)advancedSearch:(id)sender {
     NSPredicate* newPredicate = [predicateEditor  objectValue];
     NSLog(@"Advanced Predicate: %@", [newPredicate predicateFormat]);    
-    // Ugly Hack. It would be better to subclass NSPredicateEditorRowTemplate
-    // to get custom predicates
+
     if([newPredicate isNotEqualTo:predicate]) {
-        NSString *transformedFormat = [newPredicate predicateFormat];
-        transformedFormat = [transformedFormat stringByReplacingOccurrencesOfString:@"state == \"Any\""
-                                                                         withString:@"state >= 2"];
-        transformedFormat = [transformedFormat stringByReplacingOccurrencesOfString:@"state == \"Installed\""
-                                                                         withString:@"(state == 2 OR state == 4)"];
-        transformedFormat = [transformedFormat stringByReplacingOccurrencesOfString:@"\"Outdated\""
-                                                                         withString:@"4"];
-        transformedFormat = [transformedFormat stringByReplacingOccurrencesOfString:@"\"Uninstalled\""
-                                                                         withString:@"5"];
-        [self setPredicate:[NSPredicate predicateWithFormat:transformedFormat]];
+        [self setPredicate:[NSPredicate predicateWithFormat:[newPredicate predicateFormat]]];
     }
 }
 

Added: branches/gsoc09-gui/MPGUI/StatePredicateTemplate.h
===================================================================
--- branches/gsoc09-gui/MPGUI/StatePredicateTemplate.h	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/StatePredicateTemplate.h	2009-06-18 05:32:34 UTC (rev 52520)
@@ -0,0 +1,16 @@
+//
+//  StatePredicateTemplate.h
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 6/16/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import <MacPorts/MPPort.h>
+
+ at interface StatePredicateTemplate : NSPredicateEditorRowTemplate {
+    NSDictionary *states;
+}
+
+ at end

Added: branches/gsoc09-gui/MPGUI/StatePredicateTemplate.m
===================================================================
--- branches/gsoc09-gui/MPGUI/StatePredicateTemplate.m	                        (rev 0)
+++ branches/gsoc09-gui/MPGUI/StatePredicateTemplate.m	2009-06-18 05:32:34 UTC (rev 52520)
@@ -0,0 +1,60 @@
+//
+//  StatePredicateTemplate.m
+//  MPGUI
+//
+//  Created by Juan Germán Castañeda Echevarría on 6/16/09.
+//  Copyright 2009 UNAM. All rights reserved.
+//
+
+#import "StatePredicateTemplate.h"
+
+
+ at implementation StatePredicateTemplate
+
+- (id)init {
+    [super init];
+    states = [NSDictionary dictionaryWithObjectsAndKeys:
+                [NSNumber numberWithInt:MPPortStateUnknown], @"Any",                // 0
+                [NSNumber numberWithInt:MPPortStateActive], @"Installed",           // 2
+                [NSNumber numberWithInt:MPPortStateOutdated], @"Outdated",          // 4
+                [NSNumber numberWithInt:MPPortStateNotInstalled], @"Not Installed", // 5
+                nil];
+    return self;
+}
+
+- (NSPredicate *)predicateWithSubpredicates:(NSArray *)subpredicates {
+    // Get the original comparison predicate
+    NSComparisonPredicate *predicate = (NSComparisonPredicate *)[super predicateWithSubpredicates:subpredicates];
+    // Transform the right expression to a constant int (see the states Dictionary)
+    int rightExpressionAsInt = [[states objectForKey:[[predicate rightExpression] constantValue]] intValue];
+    
+    NSExpression *rightExpression;
+    NSPredicateOperatorType type;
+    
+    if (rightExpressionAsInt == MPPortStateActive) { 
+        // "Installed" means Up-to-Date or Outdated (state == 2 OR state == 4)
+        NSArray *installedPredicates = [NSArray arrayWithObjects:
+                        [NSPredicate predicateWithFormat:@"state == %d", MPPortStateActive],
+                        [NSPredicate predicateWithFormat:@"state == %d", MPPortStateOutdated], 
+                        nil];
+        return [NSCompoundPredicate orPredicateWithSubpredicates:installedPredicates];
+        
+    } else if (rightExpressionAsInt == MPPortStateUnknown) {
+        // Any means state >= 2
+        rightExpression = [NSExpression expressionForConstantValue:[states objectForKey:@"Installed"]];
+        type = NSGreaterThanOrEqualToPredicateOperatorType;
+    } else {
+        // state == MPPortStateConstant
+        NSString *rightExpressionAsString = [[predicate rightExpression] constantValue];
+        rightExpression = [NSExpression expressionForConstantValue:[states objectForKey:rightExpressionAsString]];
+        type = [predicate predicateOperatorType];
+    }
+    
+    return [NSComparisonPredicate predicateWithLeftExpression:[predicate leftExpression]
+                                              rightExpression:rightExpression
+                                                     modifier:[predicate comparisonPredicateModifier]
+                                                         type:type
+                                                      options:[predicate options]];
+}
+
+ at end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090617/95cc8fef/attachment-0001.html>


More information about the macports-changes mailing list