diff options
author | stuconnolly <stuart02@gmail.com> | 2011-10-02 11:25:26 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-10-02 11:25:26 +0000 |
commit | e23ba5155a53c43a106ac9646f51321ccc7d86f4 (patch) | |
tree | ea3da3e76bf62b13696bee5cc4f0096107e9fb48 /Source/SPConnectionController.m | |
parent | d01474532b11014019d4d5a1197a8f8f7d683c0b (diff) | |
download | sequelpro-e23ba5155a53c43a106ac9646f51321ccc7d86f4.tar.gz sequelpro-e23ba5155a53c43a106ac9646f51321ccc7d86f4.tar.bz2 sequelpro-e23ba5155a53c43a106ac9646f51321ccc7d86f4.zip |
Favorites import progress.
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r-- | Source/SPConnectionController.m | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 937cb521..f5d02a61 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1138,17 +1138,21 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v */ - (void)importExportFavoritesSheetDidEnd:(NSOpenPanel *)panel returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo { - if (contextInfo == SPExportFavorites) { - SPFavoritesExporter *exporter = [[[SPFavoritesExporter alloc] init] autorelease]; - - [exporter setDelegate:self]; - - [exporter writeFavorites:[self selectedFavoriteNodes] toFile:[panel filename]]; - } - else if (contextInfo == SPImportFavorites) { - SPFavoritesImporter *importer = [[SPFavoritesImporter alloc] init]; - - [importer setDelegate:self]; + if (returnCode == NSOKButton) { + if (contextInfo == SPExportFavorites) { + SPFavoritesExporter *exporter = [[[SPFavoritesExporter alloc] init] autorelease]; + + [exporter setDelegate:self]; + + [exporter writeFavorites:[self selectedFavoriteNodes] toFile:[panel filename]]; + } + else if (contextInfo == SPImportFavorites) { + SPFavoritesImporter *importer = [[SPFavoritesImporter alloc] init]; + + [importer setDelegate:self]; + + [importer importFavoritesFromFileAtPath:[panel filename]]; + } } } |