Anonymous avatar Anonymous committed 9828157

Combo box for selection of push/pull URL from available URLs.

Comments (0)

Files changed (5)

English.lproj/Repo.xib

 		<string key="IBDocument.HIToolboxVersion">353.00</string>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="300036"/>
+			<integer value="300194"/>
+			<integer value="300144"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
 				<string key="NSWindowContentMaxSize">{2000, 124}</string>
 				<string key="NSWindowContentMinSize">{300, 124}</string>
 				<object class="NSView" key="NSWindowView" id="192347478">
-					<nil key="NSNextResponder"/>
+					<reference key="NSNextResponder"/>
 					<int key="NSvFlags">256</int>
 					<object class="NSMutableArray" key="NSSubviews">
 						<bool key="EncodedWithXMLCoder">YES</bool>
 								<int key="NSPeriodicInterval">25</int>
 							</object>
 						</object>
-						<object class="NSTextField" id="811129738">
-							<reference key="NSNextResponder" ref="192347478"/>
-							<int key="NSvFlags">266</int>
-							<string key="NSFrame">{{20, 60}, {365, 19}}</string>
-							<reference key="NSSuperview" ref="192347478"/>
-							<bool key="NSEnabled">YES</bool>
-							<object class="NSTextFieldCell" key="NSCell" id="401840741">
-								<int key="NSCellFlags">-1804468671</int>
-								<int key="NSCellFlags2">272630784</int>
-								<string key="NSContents"/>
-								<reference key="NSSupport" ref="44865239"/>
-								<reference key="NSControlView" ref="811129738"/>
-								<bool key="NSDrawsBackground">YES</bool>
-								<object class="NSColor" key="NSBackgroundColor">
-									<int key="NSColorSpace">6</int>
-									<string key="NSCatalogName">System</string>
-									<string key="NSColorName">textBackgroundColor</string>
-									<reference key="NSColor" ref="1027376210"/>
-								</object>
-								<object class="NSColor" key="NSTextColor">
-									<int key="NSColorSpace">6</int>
-									<string key="NSCatalogName">System</string>
-									<string key="NSColorName">textColor</string>
-									<reference key="NSColor" ref="102226568"/>
-								</object>
-							</object>
-						</object>
 						<object class="NSButton" id="240632173">
 							<reference key="NSNextResponder" ref="192347478"/>
 							<int key="NSvFlags">292</int>
 								<int key="NSPeriodicInterval">75</int>
 							</object>
 						</object>
+						<object class="NSComboBox" id="793096682">
+							<reference key="NSNextResponder" ref="192347478"/>
+							<int key="NSvFlags">268</int>
+							<string key="NSFrame">{{20, 57}, {368, 22}}</string>
+							<reference key="NSSuperview" ref="192347478"/>
+							<bool key="NSEnabled">YES</bool>
+							<object class="NSComboBoxCell" key="NSCell" id="632133748">
+								<int key="NSCellFlags">343014976</int>
+								<int key="NSCellFlags2">272761856</int>
+								<string key="NSContents"/>
+								<reference key="NSSupport" ref="26"/>
+								<reference key="NSControlView" ref="793096682"/>
+								<bool key="NSDrawsBackground">YES</bool>
+								<object class="NSColor" key="NSBackgroundColor">
+									<int key="NSColorSpace">6</int>
+									<string key="NSCatalogName">System</string>
+									<string key="NSColorName">textBackgroundColor</string>
+									<reference key="NSColor" ref="1027376210"/>
+								</object>
+								<reference key="NSTextColor" ref="306507377"/>
+								<int key="NSVisibleItemCount">5</int>
+								<bool key="NSHasVerticalScroller">YES</bool>
+								<bool key="NSCompletes">YES</bool>
+								<reference key="NSDelegate" ref="793096682"/>
+								<object class="NSComboTableView" key="NSTableView" id="301170926">
+									<reference key="NSNextResponder"/>
+									<int key="NSvFlags">274</int>
+									<string key="NSFrameSize">{15, 0}</string>
+									<reference key="NSSuperview"/>
+									<reference key="NSWindow"/>
+									<bool key="NSEnabled">YES</bool>
+									<object class="NSMutableArray" key="NSTableColumns">
+										<bool key="EncodedWithXMLCoder">YES</bool>
+										<object class="NSTableColumn">
+											<reference key="NSIdentifier" ref="8"/>
+											<double key="NSWidth">1.200000e+01</double>
+											<double key="NSMinWidth">1.000000e+01</double>
+											<double key="NSMaxWidth">1.000000e+03</double>
+											<object class="NSTableHeaderCell" key="NSHeaderCell">
+												<int key="NSCellFlags">75628032</int>
+												<int key="NSCellFlags2">0</int>
+												<string key="NSContents"/>
+												<object class="NSFont" key="NSSupport">
+													<string key="NSName">LucidaGrande</string>
+													<double key="NSSize">1.200000e+01</double>
+													<int key="NSfFlags">16</int>
+												</object>
+												<object class="NSColor" key="NSBackgroundColor">
+													<int key="NSColorSpace">3</int>
+													<bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
+												</object>
+												<reference key="NSTextColor" ref="1027376210"/>
+											</object>
+											<object class="NSTextFieldCell" key="NSDataCell">
+												<int key="NSCellFlags">338820672</int>
+												<int key="NSCellFlags2">1024</int>
+												<reference key="NSSupport" ref="26"/>
+												<reference key="NSControlView" ref="301170926"/>
+												<bool key="NSDrawsBackground">YES</bool>
+												<reference key="NSBackgroundColor" ref="131218211"/>
+												<reference key="NSTextColor" ref="306507377"/>
+											</object>
+											<int key="NSResizingMask">3</int>
+											<bool key="NSIsResizeable">YES</bool>
+											<reference key="NSTableView" ref="301170926"/>
+										</object>
+									</object>
+									<double key="NSIntercellSpacingWidth">3.000000e+00</double>
+									<double key="NSIntercellSpacingHeight">2.000000e+00</double>
+									<reference key="NSBackgroundColor" ref="131218211"/>
+									<reference key="NSGridColor" ref="982455738"/>
+									<double key="NSRowHeight">1.600000e+01</double>
+									<string key="NSAction">tableViewAction:</string>
+									<int key="NSTvFlags">-767524864</int>
+									<reference key="NSDelegate" ref="632133748"/>
+									<reference key="NSDataSource" ref="632133748"/>
+									<reference key="NSTarget" ref="632133748"/>
+									<int key="NSColumnAutoresizingStyle">1</int>
+									<int key="NSDraggingSourceMaskForLocal">15</int>
+									<int key="NSDraggingSourceMaskForNonLocal">0</int>
+									<bool key="NSAllowsTypeSelect">YES</bool>
+								</object>
+							</object>
+						</object>
 					</object>
 					<string key="NSFrameSize">{478, 124}</string>
+					<reference key="NSSuperview"/>
 				</object>
 				<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
 				<string key="NSMinSize">{300, 146}</string>
 					<int key="connectionID">300158</int>
 				</object>
 				<object class="IBConnectionRecord">
-					<object class="IBOutletConnection" key="connection">
-						<string key="label">_pushURLField</string>
-						<reference key="source" ref="798535885"/>
-						<reference key="destination" ref="811129738"/>
-					</object>
-					<int key="connectionID">300159</int>
-				</object>
-				<object class="IBConnectionRecord">
 					<object class="IBActionConnection" key="connection">
 						<string key="label">endCommitSheet:</string>
 						<reference key="source" ref="798535885"/>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBOutletConnection" key="connection">
-						<string key="label">formatter</string>
-						<reference key="source" ref="811129738"/>
-						<reference key="destination" ref="1046306411"/>
-					</object>
-					<int key="connectionID">300170</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBOutletConnection" key="connection">
 						<string key="label">delegate</string>
 						<reference key="source" ref="392325734"/>
 						<reference key="destination" ref="798535885"/>
 					</object>
 					<int key="connectionID">300265</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">formatter</string>
+						<reference key="source" ref="793096682"/>
+						<reference key="destination" ref="1046306411"/>
+					</object>
+					<int key="connectionID">300268</int>
+				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">_pushURLField</string>
+						<reference key="source" ref="798535885"/>
+						<reference key="destination" ref="793096682"/>
+					</object>
+					<int key="connectionID">300269</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
 							<reference ref="266557275"/>
 							<reference ref="666051614"/>
 							<reference ref="812645157"/>
-							<reference ref="811129738"/>
 							<reference ref="240632173"/>
 							<reference ref="37735140"/>
+							<reference ref="793096682"/>
 						</object>
 						<reference key="parent" ref="672842318"/>
 					</object>
 						<reference key="parent" ref="266557275"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">300156</int>
-						<reference key="object" ref="811129738"/>
-						<object class="NSMutableArray" key="children">
-							<bool key="EncodedWithXMLCoder">YES</bool>
-							<reference ref="401840741"/>
-						</object>
-						<reference key="parent" ref="192347478"/>
-					</object>
-					<object class="IBObjectRecord">
-						<int key="objectID">300157</int>
-						<reference key="object" ref="401840741"/>
-						<reference key="parent" ref="811129738"/>
-					</object>
-					<object class="IBObjectRecord">
 						<int key="objectID">300164</int>
 						<reference key="object" ref="982530493"/>
 						<reference key="parent" ref="46956025"/>
 						<reference key="object" ref="338000762"/>
 						<reference key="parent" ref="300751437"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">300266</int>
+						<reference key="object" ref="793096682"/>
+						<object class="NSMutableArray" key="children">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<reference ref="632133748"/>
+						</object>
+						<reference key="parent" ref="192347478"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">300267</int>
+						<reference key="object" ref="632133748"/>
+						<reference key="parent" ref="793096682"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
 					<string>300136.IBPluginDependency</string>
 					<string>300138.IBPluginDependency</string>
 					<string>300139.IBPluginDependency</string>
+					<string>300143.IBEditorWindowLastContentRect</string>
 					<string>300143.IBWindowTemplateEditedContentRect</string>
 					<string>300143.NSWindowTemplate.visibleAtLaunch</string>
 					<string>300143.editorWindowContentRectSynchronizationRect</string>
 					<string>300149.IBPluginDependency</string>
 					<string>300150.IBPluginDependency</string>
 					<string>300151.IBPluginDependency</string>
-					<string>300156.IBPluginDependency</string>
-					<string>300157.IBPluginDependency</string>
 					<string>300164.IBPluginDependency</string>
 					<string>300167.IBPluginDependency</string>
 					<string>300169.IBPluginDependency</string>
 					<string>300255.IBPluginDependency</string>
 					<string>300256.IBPluginDependency</string>
 					<string>300257.IBPluginDependency</string>
+					<string>300266.IBPluginDependency</string>
+					<string>300267.IBPluginDependency</string>
 					<string>6.IBPluginDependency</string>
 					<string>6.ImportedFromIB2</string>
 					<string>8.IBPluginDependency</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{373, 518}, {478, 124}}</string>
+					<string>{{21, 687}, {478, 124}}</string>
+					<string>{{21, 687}, {478, 124}}</string>
 					<reference ref="8"/>
 					<string>{{373, 518}, {478, 124}}</string>
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>RevisionGraphCell</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</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>
 					<reference ref="9"/>
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">300265</int>
+			<int key="maxID">300269</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
 							<string>NSButton</string>
 							<string>NSTextField</string>
 							<string>NSPanel</string>
-							<string>NSTextField</string>
+							<string>NSComboBox</string>
 							<string>NSTableView</string>
 							<string>NSArrayController</string>
 							<string>NSSplitView</string>

Source/HgConfigFile.h

 - (void) sync;
 
 - (NSDictionary*) valueForStanza: (NSString*)name;
+- (NSArray*) URLsForStanza: (NSString*)stanza;
 - (NSString*) valueForKey: (NSString*)key inStanza: (NSString*)stanza;
 
 @end

Source/HgConfigFile.m

     return [_stanzas objectForKey: stanza];
 }
 
+- (NSArray*) URLsForStanza: (NSString*)stanza
+{
+    NSDictionary* values = [self valueForStanza: stanza];
+    if( ! values )
+	return nil;
+    NSMutableArray *urls = [[NSMutableArray alloc] initWithCapacity: [values count]];
+    NSEnumerator* urlStrings = [values objectEnumerator];
+    NSString* urlString;
+    while( ( urlString = [urlStrings nextObject] ) ) {
+	[urls addObject: [NSURL URLWithString: urlString]];
+    }
+    return [urls autorelease];
+}
+
 - (NSString*) valueForKey: (NSString*)key inStanza: (NSString*)stanza
 {
     return [[_stanzas objectForKey: stanza] objectForKey: key];

Source/RepoController.h

     IBOutlet NSTextView *_commitMessageField;
     
     IBOutlet NSPanel *_pushSheet;
-    IBOutlet NSTextField *_pushURLField, *_pushDescriptionField;
+    IBOutlet NSComboBox *_pushURLField;
+    IBOutlet NSTextField *_pushDescriptionField;
     IBOutlet NSButton *_pullUpdateCheckbox;
     IBOutlet NSButton *_pushButton;
     

Source/RepoController_Actions.m

             return;
     }
     [_pushURLField setStringValue: (defaultURL ?:@"")];
+    [_pushURLField removeAllItems];
+    if( defaultURL )
+	[_pushURLField addItemsWithObjectValues: [_repo.configFile URLsForStanza: @"paths"]];
+    
     [_pushDescriptionField setObjectValue: desc];
     [_pushButton setTitle: kTransferOpTitle[op] ];
     [_pullUpdateCheckbox setHidden: (op==kHgPush)];
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.