aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPCustomQuery.m2
-rw-r--r--Source/SPDatabaseDocument.h1
-rw-r--r--Source/SPDatabaseDocument.m13
3 files changed, 16 insertions, 0 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 372fa512..5e1a85e4 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -667,6 +667,7 @@
// ask the user to continue after detecting an error
if (![mySQLConnection queryCancelled]) {
+ [tableDocumentInstance setTaskIndicatorShouldAnimate:NO];
SPBeginWaitingAlertSheet(@"title",
NSLocalizedString(@"Run All", @"run all button"), NSLocalizedString(@"Continue", @"continue button"), NSLocalizedString(@"Stop", @"stop button"),
NSWarningAlertStyle, [tableDocumentInstance parentWindow], self,
@@ -676,6 +677,7 @@
[mySQLConnection getLastErrorMessage],
runAllContinueStopSheetReturnCode
);
+ [tableDocumentInstance setTaskIndicatorShouldAnimate:YES];
switch (runAllContinueStopSheetReturnCode) {
case NSAlertDefaultReturn:
diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h
index 57131de8..e7fac8bf 100644
--- a/Source/SPDatabaseDocument.h
+++ b/Source/SPDatabaseDocument.h
@@ -254,6 +254,7 @@
- (BOOL)isWorking;
- (void)setDatabaseListIsSelectable:(BOOL)isSelectable;
- (void)centerTaskWindow;
+- (void)setTaskIndicatorShouldAnimate:(BOOL)shouldAnimate;
// Encoding methods
- (void)setConnectionEncoding:(NSString *)mysqlEncoding reloadingViews:(BOOL)reloadViews;
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 43d71b01..9f14c3ed 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -1223,6 +1223,19 @@
[taskProgressWindow setFrameOrigin:newBottomLeftPoint];
}
+/**
+ * Support pausing and restarting the task progress indicator.
+ * Only works while the indicator is in indeterminate mode.
+ */
+- (void) setTaskIndicatorShouldAnimate:(BOOL)shouldAnimate
+{
+ if (shouldAnimate) {
+ [[taskProgressIndicator onMainThread] startAnimation:self];
+ } else {
+ [[taskProgressIndicator onMainThread] stopAnimation:self];
+ }
+}
+
#pragma mark -
#pragma mark Encoding Methods