diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-12-14 15:19:37 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-12-14 15:19:37 +0000 |
commit | 956bb607e5b74391129ab214eff9f5c83884538d (patch) | |
tree | 9338d5c7a9356b143197b44f546809a1692a05f5 | |
parent | 71394ef3837299457b1a5b65ff562c3be6985bba (diff) | |
download | sequelpro-956bb607e5b74391129ab214eff9f5c83884538d.tar.gz sequelpro-956bb607e5b74391129ab214eff9f5c83884538d.tar.bz2 sequelpro-956bb607e5b74391129ab214eff9f5c83884538d.zip |
• Bundle support
- fixed updating of a Bundle with the same UUID
- fixed issue of Output action "Replace Selection"
-rw-r--r-- | Source/SPAppController.m | 10 | ||||
-rw-r--r-- | Source/SPTextViewAdditions.m | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 043ea9bf..2dbf60bd 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -544,16 +544,16 @@ defaultButton:NSLocalizedString(@"Update", @"Update button") alternateButton:NSLocalizedString(@"Cancel", @"Cancel button") otherButton:nil - informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"A bundle ‘%@’ is already installed. Do you want to update it?", @"a bundle ‘%@’ is already installed. do you want to update it?"), [installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]]]]; + informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"A bundle ‘%@’ is already installed. Do you want to update it?", @"a bundle ‘%@’ is already installed. do you want to update it?"), [[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"name"]]]; [alert setAlertStyle:NSCriticalAlertStyle]; NSInteger answer = [alert runModal]; if(answer == NSAlertDefaultReturn) { NSError *error = nil; - NSString *moveToTrashCommand = [NSString stringWithFormat:@"osascript -e 'tell application \"Finder\" to move (POSIX file \"%@\") to the trash'", newPath]; + NSString *moveToTrashCommand = [NSString stringWithFormat:@"osascript -e 'tell application \"Finder\" to move (POSIX file \"%@\") to the trash'", infoPath]; [moveToTrashCommand runBashCommandWithEnvironment:nil atCurrentDirectoryPath:nil error:&error]; if(error != nil) { - NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Error while moving “%@” to Trash.", @"error while moving “%@” to trash"), newPath] + NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Error while moving “%@” to Trash.", @"error while moving “%@” to trash"), [[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"path"]] defaultButton:NSLocalizedString(@"OK", @"OK button") alternateButton:nil otherButton:nil @@ -1421,7 +1421,9 @@ } if([cmdData objectForKey:SPBundleFileUUIDKey] && [[cmdData objectForKey:SPBundleFileUUIDKey] length]) - [installedBundleUUIDs setObject:[NSString stringWithFormat:@"%@ (%@)", bundle, [cmdData objectForKey:SPBundleFileNameKey]] forKey:[cmdData objectForKey:SPBundleFileUUIDKey]]; + [installedBundleUUIDs setObject:[NSDictionary dictionaryWithObjectsAndKeys: + [NSString stringWithFormat:@"%@ (%@)", bundle, [cmdData objectForKey:SPBundleFileNameKey]], @"name", + infoPath, @"path", nil] forKey:[cmdData objectForKey:SPBundleFileUUIDKey]]; if([cmdData objectForKey:SPBundleFileTooltipKey] && [[cmdData objectForKey:SPBundleFileTooltipKey] length]) [aDict setObject:[cmdData objectForKey:SPBundleFileTooltipKey] forKey:SPBundleFileTooltipKey]; diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m index 3eeb46ce..f04c6684 100644 --- a/Source/SPTextViewAdditions.m +++ b/Source/SPTextViewAdditions.m @@ -553,7 +553,7 @@ if(!currentQueryRange.length) currentQueryRange = currentSelectionRange; - NSRange replaceRange = NSMakeRange(currentSelectionRange.location, 0); + NSRange replaceRange = currentSelectionRange; if([inputAction isEqualToString:SPBundleInputSourceSelectedText]) { if(!currentSelectionRange.length) { if([inputFallBackAction isEqualToString:SPBundleInputSourceCurrentWord]) |