diff options
author | rowanbeentje <rowan@beent.je> | 2009-11-21 22:18:27 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-11-21 22:18:27 +0000 |
commit | 7ead84b0868975752f445d1917bc693a5bf502b7 (patch) | |
tree | 8bb28e0a7b5482fc13276bc192e738d6e9761b8b /Source/TableDocument.m | |
parent | f184235a7f7996e68f4f6548ec8932b289e3d3c1 (diff) | |
download | sequelpro-7ead84b0868975752f445d1917bc693a5bf502b7.tar.gz sequelpro-7ead84b0868975752f445d1917bc693a5bf502b7.tar.bz2 sequelpro-7ead84b0868975752f445d1917bc693a5bf502b7.zip |
- Relocate the table changed notification, allowing table info pane to update early in the change process, but ensure the change notification occurs on the main thread for stability. Added NSNotificationAdditions from the Colloquy project for this.
- Change the design of the progress indicator layer, and tweak task progress for improved feedback and less flickering by correctly updating interface as appropriate, and delaying status changes for a short time. This partially addresses Issue #455.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 4e0f68fc..98a231ab 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1266,7 +1266,7 @@ [[NSNotificationCenter defaultCenter] postNotificationName:SPDocumentTaskStartNotification object:self]; // Schedule appearance of the task window in the near future - taskDrawTimer = [[NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(showTaskProgressWindow:) userInfo:nil repeats:NO] retain]; + taskDrawTimer = [[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(showTaskProgressWindow:) userInfo:nil repeats:NO] retain]; } } @@ -1306,6 +1306,7 @@ if (taskDisplayIsIndeterminate) { taskDisplayIsIndeterminate = NO; [taskProgressIndicator stopAnimation:self]; + [taskProgressIndicator setDoubleValue:0.5]; } taskProgressValue = taskPercentage; @@ -1319,10 +1320,17 @@ /** * Sets the task progress indicator back to indeterminate (also performed - * automatically whenever a new task is started) + * automatically whenever a new task is started). + * This can optionally be called with afterDelay set, in which case the intederminate + * switch will be made a fter a short pause to minimise flicker for short actions. */ -- (void) setTaskProgressToIndeterminate +- (void) setTaskProgressToIndeterminateAfterDelay:(BOOL)afterDelay { + if (afterDelay) { + [self performSelector:@selector(setTaskProgressToIndeterminateAfterDelay:) withObject:nil afterDelay:0.5]; + return; + } + if (taskDisplayIsIndeterminate) return; taskDisplayIsIndeterminate = YES; [taskProgressIndicator setIndeterminate:YES]; @@ -1354,9 +1362,11 @@ [taskFadeAnimator release], taskFadeAnimator = nil; } - // Hide the task interface + // Hide the task interface and reset to indeterminate if (taskDisplayIsIndeterminate) [taskProgressIndicator stopAnimation:self]; [taskProgressWindow setAlphaValue:0.0]; + taskDisplayIsIndeterminate = YES; + [taskProgressIndicator setIndeterminate:YES]; // Re-enable window interface [historyControl setEnabled:YES]; |