From: Michael J. Rubinsky Date: Tue, 1 Sep 2009 03:51:06 +0000 (-0400) Subject: Make sure we have a selected gallery/server before attempting to export X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=39e3175ef614a1e26ff2a27fbd536aa816c7d4e6;p=horde.git Make sure we have a selected gallery/server before attempting to export --- 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]; }