Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CommitController: Add status messages for index operations

  • Loading branch information...
commit c6d2b61020455875fabe45a6f7e97d369e916858 1 parent ff263c6
@pieter authored
Showing with 13 additions and 8 deletions.
  1. +2 −0  PBGitCommitController.h
  2. +11 −8 PBGitCommitController.m
View
2  PBGitCommitController.h
@@ -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;
View
19 PBGitCommitController.m
@@ -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 @@ - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGit
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 @@ - (IBAction)signOff:(id)sender
- (void) refresh:(id) sender
{
+ self.busy = YES;
+ self.status = @"Refreshing index…";
[index refresh];
// Reload refs (in case HEAD changed)
@@ -128,4 +126,9 @@ - (IBAction) commit:(id) sender
}
+- (void)refreshFinished:(NSNotification *)notification
+{
+ self.busy = NO;
+ self.status = @"Index refresh finished";
+}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.