Source

Murky / Source / RepoController.h

//
//  RepoController.h
//  Murky
//
//  Copyright 2008-2009 Jens Alfke. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <ScriptingBridge/ScriptingBridge.h>

@class HgRepository, HgFile, HgRevision, HgTempDir, HgOperation;


/** The controller for a repository window. */
@interface RepoController : NSWindowController 
{
    IBOutlet NSOutlineView *_outline;
    IBOutlet NSTableView *_revisionTable;
    IBOutlet NSTreeController *_tree;
    IBOutlet NSArrayController *_revisions;
    
    IBOutlet NSSegmentedControl *_infoChooser;
    IBOutlet NSTextView *_infoView;
    IBOutlet NSImageView *_infoImageView;
    
    IBOutlet NSPanel *_commitSheet;
	IBOutlet NSTextField *_commitTypeField;
    IBOutlet NSTextView *_commitPanelMessageField;
    
    IBOutlet NSPanel *_pushSheet;
    IBOutlet NSComboBox *_pushURLField;
    IBOutlet NSTextField *_pushDescriptionField;
    IBOutlet NSButton *_pullUpdateCheckbox;
    IBOutlet NSButton *_pushButton;
    
    IBOutlet NSPanel *_progressSheet;
    IBOutlet NSTextField *_progressMessageField, *_progressOutputField;
    IBOutlet NSProgressIndicator *_progressIndicator;
    IBOutlet NSButton *_progressStopButton;

    IBOutlet NSSegmentedControl *_hideShowUnmodifiedToolbarItem;
    IBOutlet NSButton *_viewModeButton;
    
	IBOutlet NSTextView *_commitView;
	
    HgRepository *_repo;
    HgFile *_selectedFile;
    HgTempDir *_tempDir;
    NSMutableDictionary *_settings;
    BOOL _settingsChanged;
    NSMutableArray *_expandedPaths;
    HgOperation *_currentOperation;
}

+ (NSArray*) allRepoControllers;
+ (RepoController*) existingRepoControllerWithDirectory: (NSString*)directory;
+ (RepoController*) repoControllerWithDirectory: (NSString*)directory 
                                          error: (NSError**)error;
- (id) initWithDirectory: (NSString*)path 
                   error: (NSError**)error;
- (id) initWithRepository: (HgRepository*)repo;

@property (readonly,nonatomic) NSString* directory;
@property (readonly,nonatomic) HgRepository* repository;

- (HgFile*) selectedFile;
- (NSArray*) selectedFiles;
@property (retain) HgRevision* selectedRevision;

/** Returns the file that's actually selected in the file tree.
    This will be the same as -selectedFile, except while handling a right-click contextual menu
    (where -selectedFile returns the file right-clicked, but this returns the selected file.) */
- (HgFile*) actuallySelectedFile;

@property BOOL showsOnlyUncleanFiles;

- (void) setValue: (id)value forSetting: (NSString*)setting;
- (void) saveSettings;

- (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn;

// internal:
@property (readonly) HgTempDir* tempDir;
@property (retain) HgOperation *currentOperation;
- (void) _updateInfoViewAndCommitView;

@end


/** These are implemented in RepoController_Actions.m. */
@interface RepoController (Actions)

- (IBAction) revealInFinder: (id) sender;
- (IBAction) openInTerminal: (id) sender;
- (IBAction) refreshStatus: (id)sender;
- (IBAction) toggleShowsOnlyUncleanFiles: (id)sender;   // sent by menu command
- (IBAction) viewModeSelectorChanged: (id)sender;       // sent by seg. control
- (IBAction) chooseRevisionFromPopUp: (id)sender;

- (IBAction) openSelectedFile: (id)sender;

- (IBAction) showRevision: (id)sender;
- (IBAction) showDiff: (id)sender;
- (IBAction) showComparison: (id)sender;

- (IBAction) addRemove: (id)sender;
- (IBAction) addToRepository: (id)sender;
- (IBAction) removeFromRepository: (id)sender;
- (IBAction) discardChanges: (id)sender;

- (IBAction) commitChanges: (id)sender;
- (IBAction) commitAllChanges: (id)sender;
- (IBAction) pushPullRevisions: (id)sender;         // sender.tag is a HgTransferOp

- (IBAction) endCommitSheet: (id)sender;
- (IBAction) beginPushSheetFilePicker: (id)sender;

- (IBAction) updateToLatest: (id)sender;
- (IBAction) updateToSelectedRevision: (id)sender;

- (IBAction) stopProgress: (id)sender;

@end
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.