Tweak the order that the image browser is loaded, make sure it's
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 8 May 2009 22:43:22 +0000 (18:43 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 8 May 2009 22:43:22 +0000 (18:43 -0400)
not still showing the last group of images when it's shown again.

iPhoto2Ansel/AnselExportController.m

index 3bb47b0..a21b99b 100644 (file)
@@ -82,6 +82,9 @@ NSString * const TURAnselServerPasswordKey = @"password";
                                              selector: @selector(exportWindowDidBecomeKey:)
                                                  name: NSWindowDidBecomeKeyNotification 
                                                object :nil];
+    
+    // Holds gallery's images info for the gallery preview 
+    browserData = [[NSMutableArray alloc] init];
 }
 -(void)dealloc
 {
@@ -101,20 +104,19 @@ NSString * const TURAnselServerPasswordKey = @"password";
 #pragma mark Actions
 - (IBAction)clickViewGallery: (id)sender
 {
-    [NSApp beginSheet: mviewGallerySheet
-       modalForWindow: [self window]
-        modalDelegate: nil
-       didEndSelector: nil
-          contextInfo: nil];
-    
+    [browserData removeAllObjects];
     NSMutableArray *images = [currentGallery listImages];
-    NSLog(@"%@", images);
-    browserData = [[NSMutableArray alloc] init];
     for (NSDictionary *image in images) {
         AnselGalleryViewItem *item = [[AnselGalleryViewItem alloc] initWithURL: [NSURL URLWithString: [image objectForKey:@"url"]]];
         [browserData addObject: item];
     }
-    
+
+    [NSApp beginSheet: mviewGallerySheet
+       modalForWindow: [self window]
+        modalDelegate: nil
+       didEndSelector: nil
+          contextInfo: nil];
+
     [browserView reloadData];
 }
 
@@ -224,7 +226,7 @@ NSString * const TURAnselServerPasswordKey = @"password";
     }
 
     [prefs synchronize];
-    
+
     [self updateServersPopupMenu];
     
     [newServer release];