CommitController: Add status messages for index operations

This commit is contained in:
Pieter de Bie
2009-09-13 03:20:42 +02:00
parent ff263c6717
commit c6d2b61020
2 changed files with 13 additions and 8 deletions
+2
View File
@@ -24,6 +24,7 @@
IBOutlet PBWebChangesController *webController;
NSString *status;
BOOL busy;
NSDictionary *amendEnvironment;
@@ -31,6 +32,7 @@
@property(copy) NSString *status;
@property(readonly) PBGitIndex *index;
@property(assign) BOOL busy;
// FIXME: redo 0823ff859dc65db238951c16e49293ea411c2b5a
- (IBAction) refresh:(id) sender;
+11 -8
View File
@@ -14,13 +14,13 @@
#import "NSString_RegEx.h"
@interface PBGitCommitController (PrivateMethods)
- (void)processHunk:(NSString *)hunk stage:(BOOL)stage reverse:(BOOL)reverse;
@interface PBGitCommitController ()
- (void)refreshFinished:(NSNotification *)notification;
@end
@implementation PBGitCommitController
@synthesize status, index;
@synthesize status, index, busy;
- (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller
{
@@ -29,14 +29,10 @@
index = [[PBGitIndex alloc] initWithRepository:theRepository workingDirectory:[NSURL fileURLWithPath:[theRepository workingDirectory]]];
[index refresh];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshFinished:) name:PBGitIndexFinishedIndexRefresh object:index];
return self;
}
- (BOOL)busy
{
return NO;
}
- (void)awakeFromNib
{
[super awakeFromNib];
@@ -80,6 +76,8 @@
- (void) refresh:(id) sender
{
self.busy = YES;
self.status = @"Refreshing index…";
[index refresh];
// Reload refs (in case HEAD changed)
@@ -128,4 +126,9 @@
}
- (void)refreshFinished:(NSNotification *)notification
{
self.busy = NO;
self.status = @"Index refresh finished";
}
@end