mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
CommitController: Add status messages for index operations
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user