aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-10-02 11:25:26 +0000
committerstuconnolly <stuart02@gmail.com>2011-10-02 11:25:26 +0000
commite23ba5155a53c43a106ac9646f51321ccc7d86f4 (patch)
treeea3da3e76bf62b13696bee5cc4f0096107e9fb48 /Source/SPConnectionController.m
parentd01474532b11014019d4d5a1197a8f8f7d683c0b (diff)
downloadsequelpro-e23ba5155a53c43a106ac9646f51321ccc7d86f4.tar.gz
sequelpro-e23ba5155a53c43a106ac9646f51321ccc7d86f4.tar.bz2
sequelpro-e23ba5155a53c43a106ac9646f51321ccc7d86f4.zip
Favorites import progress.
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m26
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]];
+ }
}
}