#2791 show a progress indicator when verifying local data in the add window

This commit is contained in:
Mitchell Livingston
2010-01-31 23:36:48 +00:00
parent 54c9331258
commit 404b845590
3 changed files with 61 additions and 7 deletions

View File

@@ -34,6 +34,8 @@
@interface AddWindowController (Private)
- (void) updateFiles;
- (void) confirmAdd;
- (void) setDestinationPath: (NSString *) destination;
@@ -105,8 +107,9 @@
[fLocationImageView setImage: nil];
}
fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: fFileController
selector: @selector(reloadData) userInfo: nil repeats: YES];
fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self
selector: @selector(updateFiles) userInfo: nil repeats: YES];
[self updateFiles];
}
- (void) windowDidLoad
@@ -191,7 +194,7 @@
- (void) verifyLocalData: (id) sender
{
[fTorrent resetCache];
[fFileController reloadData];
[self updateFiles];
}
- (void) updateStatusField: (NSNotification *) notification
@@ -229,6 +232,21 @@
@implementation AddWindowController (Private)
- (void) updateFiles
{
[fTorrent update];
[fFileController reloadData];
if ([fTorrent isChecking])
{
[fVerifyIndicator setHidden: NO];
[fVerifyIndicator setDoubleValue: [fTorrent checkingProgress]];
}
else
[fVerifyIndicator setHidden: YES];
}
- (void) confirmAdd
{
[fTimer invalidate];