diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPAppController.m | 26 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.h | 4 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 33 |
3 files changed, 63 insertions, 0 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index a38dc631..b0f5693e 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1166,6 +1166,19 @@ YY_BUFFER_STATE yy_scan_string (const char *); { [runningActivitiesArray addObject:commandDict]; [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:nil]; + + SPDatabaseDocument* frontMostDoc = [self frontDocument]; + if(frontMostDoc) { + if([runningActivitiesArray count] || [[frontMostDoc runningActivities] count]) + [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + else { + [NSObject cancelPreviousPerformRequestsWithTarget:frontMostDoc + selector:@selector(setActivityPaneHidden:) + object:[NSNumber numberWithInteger:0]]; + [frontMostDoc setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + } + } + } - (void)removeRegisteredActivity:(NSInteger)pid @@ -1176,7 +1189,20 @@ YY_BUFFER_STATE yy_scan_string (const char *); break; } } + [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:nil]; + + SPDatabaseDocument* frontMostDoc = [self frontDocument]; + if(frontMostDoc) { + if([runningActivitiesArray count] || [[frontMostDoc runningActivities] count]) + [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + else { + [NSObject cancelPreviousPerformRequestsWithTarget:frontMostDoc + selector:@selector(setActivityPaneHidden:) + object:[NSNumber numberWithInteger:0]]; + [frontMostDoc setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + } + } } - (NSArray*)runningActivities diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h index bcd92d59..3459b9b8 100644 --- a/Source/SPDatabaseDocument.h +++ b/Source/SPDatabaseDocument.h @@ -65,6 +65,9 @@ IBOutlet NSSearchField *listFilterField; + IBOutlet NSScrollView *tableInfoScrollView; + IBOutlet NSScrollView *activitiesScrollView; + IBOutlet NSView *parentView; IBOutlet id titleAccessoryView; @@ -363,6 +366,7 @@ - (void)handleSchemeCommand:(NSDictionary*)commandDict; - (void)registerActivity:(NSDictionary*)commandDict; - (void)removeRegisteredActivity:(NSInteger)pid; +- (void)setActivityPaneHidden:(NSNumber*)hide; - (NSArray*)runningActivities; - (NSDictionary*)shellVariables; 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 |