Commits

Jens Alfke committed 28b5bf1

* Improved the "Hide/Show Unmodified" patch.
* Converted some tab characters that had snuck into the source.

  • Participants
  • Parent commits 844bb90

Comments (0)

Files changed (6)

File Source/HgConfigFile.m

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

File Source/ImageAndTextCell.m

 
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
     if (image != nil) {
-        NSRect	imageFrame;
+        NSRect imageFrame;
         NSSize imageSize = [image size];
         NSDivideRect(cellFrame, &imageFrame, &cellFrame, 3 + imageSize.width, NSMinXEdge);
         if ([self drawsBackground]) {

File Source/MercurialApp.m

     NSSavePanel *panel = [NSSavePanel savePanel];
     if( [panel runModalForDirectory: nil file: nil] == NSOKButton ) {
         NSString *path = [panel filename];
-		[[NSFileManager defaultManager] createDirectoryAtPath: path attributes:nil];
+        [[NSFileManager defaultManager] createDirectoryAtPath: path attributes:nil];
         [self openRepository: path remember: YES];
-	
-	}
+    
+    }
 
 }
 
 
 
 - (NSArray *)supportedTextEditors {
-	static NSArray *s_supportedTextEditors = nil;
-	if (!s_supportedTextEditors) {
+    static NSArray *s_supportedTextEditors = nil;
+    if (!s_supportedTextEditors) {
         NSString *path = [[NSBundle mainBundle] pathForResource: @"TextEditors" ofType: @"plist"];
         s_supportedTextEditors = [NSArray arrayWithContentsOfFile: path];
         Assert(s_supportedTextEditors);
-	}
-	return s_supportedTextEditors;
+    }
+    return s_supportedTextEditors;
 }
 
 - (IBAction) showPreferences:(id)sender {
-	// update popup
-	[_textEditorPreferenceButton removeAllItems];
-	[_textEditorPreferenceButton addItemsWithTitles:[[self supportedTextEditors] valueForKeyPath:@"@unionOfObjects.editorName"]];
-	NSString *selectedEditorID = [[NSUserDefaults standardUserDefaults] stringForKey:kPrefPreferredTextEditorID];
+    // update popup
+    [_textEditorPreferenceButton removeAllItems];
+    [_textEditorPreferenceButton addItemsWithTitles:[[self supportedTextEditors] valueForKeyPath:@"@unionOfObjects.editorName"]];
+    NSString *selectedEditorID = [[NSUserDefaults standardUserDefaults] stringForKey:kPrefPreferredTextEditorID];
     if (!selectedEditorID)
         selectedEditorID = @"com.apple.Xcode";
-	int selectedItemIndex = [[[self supportedTextEditors] valueForKeyPath:@"@unionOfObjects.editorID"] indexOfObject:selectedEditorID];
+    int selectedItemIndex = [[[self supportedTextEditors] valueForKeyPath:@"@unionOfObjects.editorID"] indexOfObject:selectedEditorID];
     if (selectedItemIndex == NSNotFound)
         selectedItemIndex = 0;
     [_textEditorPreferenceButton selectItemAtIndex:selectedItemIndex];
-	[[_textEditorPreferenceButton window] makeKeyAndOrderFront:self];
+    [[_textEditorPreferenceButton window] makeKeyAndOrderFront:self];
 }
 
 - (IBAction) selectTextEditor:(id)sender {
-	int selectedIndex = [_textEditorPreferenceButton indexOfSelectedItem];
+    int selectedIndex = [_textEditorPreferenceButton indexOfSelectedItem];
     NSString *editorID = [[[self supportedTextEditors] valueForKeyPath:@"@unionOfObjects.editorID"] objectAtIndex:selectedIndex];
-	[[NSUserDefaults standardUserDefaults] setObject: editorID
+    [[NSUserDefaults standardUserDefaults] setObject: editorID
                                               forKey: kPrefPreferredTextEditorID];
 }
 

File Source/RepoController.h

     IBOutlet NSProgressIndicator *_progressIndicator;
     IBOutlet NSButton *_progressStopButton;
 
-	IBOutlet NSToolbarItem *_hideShowUnmodifiedToolbarItem;
+    IBOutlet NSToolbarItem *_hideShowUnmodifiedToolbarItem;
 
     HgRepository *_repo;
     HgFile *_selectedFile;

File Source/RepoController.m

     if( showUnclean ) {
         //_tree.leafKeyPath = @"isNonRepository";
         contentPath =  @"selection.uncleanFiles";
+        [_hideShowUnmodifiedToolbarItem setLabel:@"Show Unmodified"];
+        [_hideShowUnmodifiedToolbarItem setPaletteLabel:@"Show Unmodified Files"];
     } else {
         //_tree.leafKeyPath = @"isFile";
         contentPath = @"selection.rootAsArray";
+        [_hideShowUnmodifiedToolbarItem setLabel:@"Hide Unmodified"];
+        [_hideShowUnmodifiedToolbarItem setPaletteLabel:@"Hide Unmodified Files"];      
     }
+    
     [_tree bind: @"content" toObject: _revisions withKeyPath: contentPath options: nil];
     [_tree rearrangeObjects];
     [self _setVisibility:  showUnclean ofColumnID: @"path"];
         color = containsFileColor;*/
     
     if( [tableView isRowSelected: row] )
-	color = normalColor;
+    color = normalColor;
 
     cell.textColor = color;
     if( ! [tableColumn.identifier isEqualToString: @"ID"] )

File Source/RepoController_Actions.m

 - (IBAction) toggleShowsOnlyUncleanFiles: (id)sender
 {
     self.showsOnlyUncleanFiles = ! self.showsOnlyUncleanFiles;
-
-	if (self.showsOnlyUncleanFiles) {
-		[_hideShowUnmodifiedToolbarItem setLabel:@"Show Unmodified"];
-		[_hideShowUnmodifiedToolbarItem setPaletteLabel:@"Show Unmodified Files"];
-	} else {
-		[_hideShowUnmodifiedToolbarItem setLabel:@"Hide Unmodified"];
-		[_hideShowUnmodifiedToolbarItem setPaletteLabel:@"Hide Unmodified Files"];		
-	}
 }
 
 
 
 - (IBAction) revealInFinder: (id) sender
 {
-	NSURL* fileURL = [NSURL fileURLWithPath: self.repository.absolutePath];
-	NSWorkspace* ws = [NSWorkspace sharedWorkspace];
-	[ws openURL:fileURL];	//use openURL instead of selectFile to support PathFinder. WD-rpw May 1, 2009
+    NSURL* fileURL = [NSURL fileURLWithPath: self.repository.absolutePath];
+    NSWorkspace* ws = [NSWorkspace sharedWorkspace];
+    [ws openURL:fileURL];   //use openURL instead of selectFile to support PathFinder. WD-rpw May 1, 2009
 }
 
 - (IBAction) refreshStatus: (id)sender
     [_pushURLField setStringValue: (defaultURL ?:@"")];
     [_pushURLField removeAllItems];
     if( defaultURL )
-	[_pushURLField addItemsWithObjectValues: [_repo.configFile URLsForStanza: @"paths"]];
+    [_pushURLField addItemsWithObjectValues: [_repo.configFile URLsForStanza: @"paths"]];
     
     [_pushDescriptionField setObjectValue: desc];
     [_pushButton setTitle: kTransferOpTitle[op] ];