diff options
author | Bibiko <bibiko@eva.mpg.de> | 2011-01-20 09:10:57 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2011-01-20 09:10:57 +0000 |
commit | 79d5e103501c799c22dcb880e33fed0457d6ccd0 (patch) | |
tree | 14f53c3ebf0d4a4c3516680ff63db9437a13e529 /Source/SPDatabaseDocument.m | |
parent | 4ef4c1f288938e8f281dbd238d853926941b570c (diff) | |
download | sequelpro-79d5e103501c799c22dcb880e33fed0457d6ccd0.tar.gz sequelpro-79d5e103501c799c22dcb880e33fed0457d6ccd0.tar.bz2 sequelpro-79d5e103501c799c22dcb880e33fed0457d6ccd0.zip |
• show activity pane for running Bundle process automatically if the process runs longer than 1 sec and hide it if no process runs anymore to inform the user better
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 9e239cef..96bfbf39 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5048,17 +5048,50 @@ { [runningActivitiesArray addObject:commandDict]; [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:nil]; + + if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) + [self performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + else { + [NSObject cancelPreviousPerformRequestsWithTarget:self + selector:@selector(setActivityPaneHidden:) + object:[NSNumber numberWithInteger:0]]; + [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + } + } - (void)removeRegisteredActivity:(NSInteger)pid { + for(id cmd in runningActivitiesArray) { if([[cmd objectForKey:@"pid"] integerValue] == pid) { [runningActivitiesArray removeObject:cmd]; break; } } + + if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) + [self performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + else { + [NSObject cancelPreviousPerformRequestsWithTarget:self + selector:@selector(setActivityPaneHidden:) + object:[NSNumber numberWithInteger:0]]; + [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + } + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:nil]; + +} + +- (void)setActivityPaneHidden:(NSNumber*)hide +{ + if(![hide integerValue] == 1) { + [tableInfoScrollView setHidden:YES]; + [activitiesScrollView setHidden:NO]; + } else { + [activitiesScrollView setHidden:YES]; + [tableInfoScrollView setHidden:NO]; + } } - (NSArray*)runningActivities |