aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-01 12:23:22 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-01 12:23:22 +0000
commit019a1015546ab203eb366a71811d6c75b130fd40 (patch)
tree6d93981dd3340eeb6586ae35a1a4720c48f854f5 /Source/SPAppController.m
parent8e9f5d343c0128c06a018fb58751ac67ec1dfa6f (diff)
downloadsequelpro-019a1015546ab203eb366a71811d6c75b130fd40.tar.gz
sequelpro-019a1015546ab203eb366a71811d6c75b130fd40.tar.bz2
sequelpro-019a1015546ab203eb366a71811d6c75b130fd40.zip
• added chance to cancel an activity - up to now a running Bundle command - from the Activities pane (toggable via double-clicking at Table Information header); it's still tentative and the correct cancel icon will follow asap
• added notification system for updating the activities pane (SPActivitiesUpdateNotification)
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m31
1 files changed, 19 insertions, 12 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index ad456b89..67d0427f 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -57,7 +57,7 @@
bundleUsedScopes = [[NSMutableArray alloc] initWithCapacity:1];
bundleKeyEquivalents = [[NSMutableDictionary alloc] initWithCapacity:1];
installedBundleUUIDs = [[NSMutableDictionary alloc] initWithCapacity:1];
- runningBASHprocesses = [[NSMutableArray alloc] init];
+ runningActivitiesArray = [[NSMutableArray alloc] init];
[NSApp setDelegate:self];
}
@@ -781,7 +781,14 @@
return;
}
- NSString *output = [cmd runBashCommandWithEnvironment:env atCurrentDirectoryPath:nil callerDocument:self withName:([cmdData objectForKey:SPBundleFileNameKey])?[cmdData objectForKey:SPBundleFileNameKey]:@"" error:&err];
+ NSString *output = [cmd runBashCommandWithEnvironment:env
+ atCurrentDirectoryPath:nil
+ callerInstance:self
+ contextInfo:[NSDictionary dictionaryWithObjectsAndKeys:
+ ([cmdData objectForKey:SPBundleFileNameKey])?:@"-", @"name",
+ NSLocalizedString(@"General", @"general menu item label"), @"scope",
+ nil]
+ error:&err];
[[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil];
@@ -832,24 +839,24 @@
}
-- (void)registerBASHCommand:(NSDictionary*)commandDict
+- (void)registerActivity:(NSDictionary*)commandDict
{
- [runningBASHprocesses addObject:commandDict];
+ [runningActivitiesArray addObject:commandDict];
}
-- (void)unRegisterBASHCommand:(NSInteger)pid
+- (void)removeRegisteredActivity:(NSInteger)pid
{
- for(id cmd in runningBASHprocesses) {
+ for(id cmd in runningActivitiesArray) {
if([[cmd objectForKey:@"pid"] integerValue] == pid) {
- [runningBASHprocesses removeObject:cmd];
+ [runningActivitiesArray removeObject:cmd];
break;
}
}
}
-- (NSArray*)runningBASHProcesses
+- (NSArray*)runningActivities
{
- return (NSArray*)runningBASHprocesses;
+ return (NSArray*)runningActivitiesArray;
}
#pragma mark -
@@ -1538,7 +1545,7 @@
for (NSWindow *aWindow in [NSApp orderedWindows]) {
if([[aWindow windowController] isMemberOfClass:[SPWindowController class]]) {
for(SPDatabaseDocument *doc in [[aWindow windowController] documents]) {
- for(NSDictionary* cmd in [doc runningBASHProcesses]) {
+ for(NSDictionary* cmd in [doc runningActivities]) {
NSInteger pid = [[cmd objectForKey:@"pid"] intValue];
NSTask *killTask = [[NSTask alloc] init];
[killTask setLaunchPath:@"/bin/sh"];
@@ -1550,7 +1557,7 @@
}
}
}
- for(NSDictionary* cmd in [self runningBASHProcesses]) {
+ for(NSDictionary* cmd in [self runningActivities]) {
NSInteger pid = [[cmd objectForKey:@"pid"] intValue];
NSTask *killTask = [[NSTask alloc] init];
[killTask setLaunchPath:@"/bin/sh"];
@@ -1577,7 +1584,7 @@
if(bundleCategories) [bundleCategories release];
if(bundleKeyEquivalents) [bundleKeyEquivalents release];
if(installedBundleUUIDs) [installedBundleUUIDs release];
- if (runningBASHprocesses) [runningBASHprocesses release];
+ if (runningActivitiesArray) [runningActivitiesArray release];
[prefsController release], prefsController = nil;