From 39e3175ef614a1e26ff2a27fbd536aa816c7d4e6 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Mon, 31 Aug 2009 23:51:06 -0400 Subject: [PATCH] Make sure we have a selected gallery/server before attempting to export --- ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m index b4dd7f0a6..e255af13e 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m @@ -209,6 +209,13 @@ NSString * const TURAnselServerPasswordKey = @"password"; - (void)exportManagerShouldBeginExport { // You must call [_exportManager shouldBeginExport] here or elsewhere before Aperture will begin the export process NSLog(@"exportManagerShouldBeginExport"); + if (_currentGallery == nil) { + NSLog(@"No gallery selected."); + NSBeginAlertSheet(@"Export failed", nil, nil, nil, + [_exportManager window], nil, nil, + nil, nil, @"No gallery selected"); + return; + } [self lockProgress]; exportProgress.totalValue = [_exportManager imageCount]; exportProgress.currentValue = 0; @@ -341,7 +348,6 @@ NSString * const TURAnselServerPasswordKey = @"password"; { // Remember the previous selection before it changes. // The 'clickServer' action will handle what to do with the selection. - NSLog(@"test"); mIndexOfPreviouslySelectedServer = [mServersPopUp indexOfSelectedItem]; } @@ -638,10 +644,11 @@ NSString * const TURAnselServerPasswordKey = @"password"; [galleryCombo setDataSource:_anselController]; [galleryCombo setDelegate:self]; [spinner startAnimation:self]; + [_anselController connect]; // Detach to a new thread and do the actual login/retrieval of gallery list - [NSApplication detachDrawingThread: @selector(connect) - toTarget: self - withObject: nil]; +// [NSApplication detachDrawingThread: @selector(connect) +// toTarget: self +// withObject: nil]; [p release]; [pool drain]; } -- 2.11.0