From: Michael J. Rubinsky Date: Fri, 8 May 2009 20:55:32 +0000 (-0400) Subject: Start adding support for browsing each remote gallery's thumbnails X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4c6d0a72c2d269b2dd78f31712cb91922248edcb;p=horde.git Start adding support for browsing each remote gallery's thumbnails from within the export interface. Basically works, but needs tweaking. --- diff --git a/iPhoto2Ansel/AnselExportController.h b/iPhoto2Ansel/AnselExportController.h index 14c885225..9b3321efe 100644 --- a/iPhoto2Ansel/AnselExportController.h +++ b/iPhoto2Ansel/AnselExportController.h @@ -7,6 +7,7 @@ // #import +#import #import "ExportPluginProtocol.h" @class TURAnsel, TURAnselGallery; @@ -43,6 +44,14 @@ extern NSString * const TURAnselServerPasswordKey; IBOutlet NSPopUpButton *mServersPopUp; IBOutlet NSButton *mCancelConnect; + // Gallery View + IBOutlet NSButton *viewGallery; + IBOutlet NSWindow *mviewGallerySheet; + IBOutlet NSButton *closeGalleryView; + IBOutlet IKImageBrowserView *browserView; + NSMutableArray *browserData; + + // New Server sheet IBOutlet NSWindow *newServerSheet; IBOutlet NSTextField *mServerSheetHostURL; @@ -50,6 +59,7 @@ extern NSString * const TURAnselServerPasswordKey; IBOutlet NSSecureTextField *mServerSheetPassword; IBOutlet NSTextField *mServerSheetServerNickName; IBOutlet NSButton *mMakeNewServerDefault; + // Server list IBOutlet NSPanel *serverListPanel; @@ -77,6 +87,7 @@ extern NSString * const TURAnselServerPasswordKey; // Remembers the selected server before it changes. Used to reselect the // proper server if necessary when server panels are closed. int mIndexOfPreviouslySelectedServer; + } @property (readwrite, retain) TURAnselGallery *currentGallery; @@ -91,6 +102,9 @@ extern NSString * const TURAnselServerPasswordKey; - (IBAction) clickServer: (id)sender; - (IBAction) clickCancelConnect: (id)sender; +- (IBAction) clickViewGallery: (id)sender; +- (IBAction) closeGalleryView: (id)sender; + // Server List - (IBAction) closeServerList: (id)sender; - (IBAction) removeServer: (id)sender; diff --git a/iPhoto2Ansel/AnselExportController.m b/iPhoto2Ansel/AnselExportController.m index 3dc633c1a..bb0125d7a 100644 --- a/iPhoto2Ansel/AnselExportController.m +++ b/iPhoto2Ansel/AnselExportController.m @@ -11,6 +11,7 @@ #import "TURAnselGalleryPanelController.h"; #import "FBProgressController.h"; #import "ImageResizer.h"; +#import "AnselGalleryViewItem.h"; @interface AnselExportController (PrivateAPI) - (void)showNewServerSheet; @@ -88,6 +89,7 @@ NSString * const TURAnselServerPasswordKey = @"password"; [progressController release]; [anselServers release]; [currentServer release]; + [browserData release]; [super dealloc]; } @@ -97,6 +99,31 @@ NSString * const TURAnselServerPasswordKey = @"password"; } #pragma mark Actions +- (IBAction)clickViewGallery: (id)sender +{ + [NSApp beginSheet: mviewGallerySheet + modalForWindow: [self window] + modalDelegate: nil + didEndSelector: nil + contextInfo: nil]; + + 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]; + } + + [browserView reloadData]; +} + +- (IBAction) closeGalleryView: (id)sender +{ + [NSApp endSheet: mviewGallerySheet]; + [mviewGallerySheet orderOut: nil]; +} + // Put up the newGallerySheet NSPanel - (IBAction)showNewGallery: (id)sender { @@ -737,4 +764,18 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn { return [[anselServers objectAtIndex: rowIndex] objectForKey: [aTableColumn identifier]]; } + +#pragma mark +#pragma mark IKImageBrowserView Datasource methods +- (NSUInteger)numberOfItemsInImageBrowser:(IKImageBrowserView *) aBrowser +{ + //NSLog(@"%@", [browserData count]); + return [browserData count]; +} + +- (id)imageBrowser:(IKImageBrowserView *) aBrowser itemAtIndex:(NSUInteger)index +{ + // NSLog(@"%@", [[browserData objectAtIndex:index] path]); + return [browserData objectAtIndex:index]; +} @end \ No newline at end of file diff --git a/iPhoto2Ansel/AnselGalleryViewItem.h b/iPhoto2Ansel/AnselGalleryViewItem.h new file mode 100644 index 000000000..29729a9ff --- /dev/null +++ b/iPhoto2Ansel/AnselGalleryViewItem.h @@ -0,0 +1,28 @@ +// +// AnselGalleryViewItem.h +// iPhoto2Ansel +// +// Created by Michael Rubinsky on 5/7/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// +#import +#import + +@interface AnselGalleryViewItem: NSObject +{ + NSURL * image; + NSString * imageID; +} + +@property(readwrite,copy) NSURL * image; +@property(readwrite,copy) NSString * imageID; + +- (id)initWithURL: (NSURL *)theUrl; + +#pragma mark - +#pragma mark Required Methods IKImageBrowserItem Informal Protocol +- (NSString *) imageUID; +- (NSString *) imageRepresentationType; +- (id) imageRepresentation; + +@end diff --git a/iPhoto2Ansel/AnselGalleryViewItem.m b/iPhoto2Ansel/AnselGalleryViewItem.m new file mode 100644 index 000000000..b5bde8a97 --- /dev/null +++ b/iPhoto2Ansel/AnselGalleryViewItem.m @@ -0,0 +1,44 @@ +// +// AnselGalleryViewItem.m +// iPhoto2Ansel +// +// Created by Michael Rubinsky on 5/7/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "AnselGalleryViewItem.h" + +@implementation AnselGalleryViewItem +@synthesize image; +@synthesize imageID; + +- (id)initWithURL:(NSURL *)theURL +{ + [super init]; + image = [theURL retain]; + imageID = [[theURL absoluteString] retain]; + return self; +} + +- (void)dealloc +{ + [image release]; + [imageID release]; + [super dealloc]; +} + +- (NSString *)imageUID +{ + return imageID; +} + +- (NSString *)imageRepresentationType +{ + return IKImageBrowserNSURLRepresentationType; +} + +- (id)imageRepresentation +{ + return image; +} +@end diff --git a/iPhoto2Ansel/English.lproj/Panel.nib/designable.nib b/iPhoto2Ansel/English.lproj/Panel.nib/designable.nib index 95db7426d..971e1811d 100644 --- a/iPhoto2Ansel/English.lproj/Panel.nib/designable.nib +++ b/iPhoto2Ansel/English.lproj/Panel.nib/designable.nib @@ -8,11 +8,12 @@ 353.00 YES - - + + YES + com.apple.imagekit.ibplugin com.apple.InterfaceBuilder.CocoaPlugin @@ -26,657 +27,17 @@ NSApplication - - 15 + + 23 2 - {{220, 358}, {548, 406}} - 1886912512 - - Window - - - NSWindow - - - View - + {{196, 315}, {455, 195}} + -1543503872 + Add Server + NSPanel + {3.40282e+38, 3.40282e+38} - {213, 107} - - - 256 - - YES - - - 256 - - YES - - - 256 - - YES - - - 268 - - YES - - - 256 - - YES - - - 268 - {{15, 71}, {81, 17}} - - YES - - 68288064 - 272630784 - Server - - LucidaGrande - 1.200000e+01 - 16 - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2OQA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 268 - {{76, 66}, {382, 26}} - - YES - - -2076049856 - 2048 - - LucidaGrande - 1.300000e+01 - 1044 - - - 109199615 - 129 - - - 400 - 75 - - - (None) - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - 1 - YES - YES - 2 - - - - - 268 - {{77, 33}, {117, 17}} - - YES - - 68288064 - 272761856 - Not Logged In - - LucidaGrande - 1.100000e+01 - 3100 - - - - - - - - - 1292 - - {{439, 33}, {16, 16}} - - 28938 - 1.600000e+01 - 1.000000e+02 - - - - 268 - {{15, 37}, {43, 16}} - - YES - - 68288064 - 272630784 - Status - - - - - - - - - 268 - {{367, 32}, {65, 16}} - - YES - - 67239424 - 134479872 - Cancel - - LucidaGrande - 9.000000e+00 - 3614 - - - -2038284033 - 129 - - - 200 - 25 - - - - {{1, 1}, {480, 94}} - - - - {{7, 253}, {482, 110}} - - {0, 0} - - 67239424 - 0 - Connection - - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 3 - MCAwLjgwMDAwMDAxAA - - - - 1 - 0 - 2 - NO - - - - 268 - - YES - - - 256 - - YES - - - 268 - {{135, 144}, {92, 32}} - - YES - - 67239424 - 134479872 - Create New - - - -2038284033 - 129 - - LucidaGrande - 9.000000e+00 - 16 - - - - 200 - 25 - - - - - 268 - {{18, 122}, {211, 26}} - - YES - - 879885888 - 272630784 - - - - YES - - - 5 - YES - - - - 274 - {15, 0} - - - YES - - YES - - - 1.200000e+01 - 1.000000e+01 - 1.000000e+03 - - 75628032 - 0 - - - - 3 - MC4zMzMzMzI5OQA - - - - - 338820672 - 1024 - - - YES - - 6 - System - controlBackgroundColor - - - - - 3 - YES - - - - 3.000000e+00 - 2.000000e+00 - - - 6 - System - gridColor - - 3 - MC41AA - - - 1.900000e+01 - tableViewAction: - -767524864 - - - - 1 - 15 - 0 - YES - - - - - - 268 - {{15, 152}, {103, 16}} - - YES - - 68288064 - 272630784 - Gallery - - - - - - - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{258, 38}, {214, 118}} - - YES - - 130560 - 33554432 - 0 - 0 - 1 - NO - - YES - - - - 268 - {{258, 154}, {158, 16}} - - YES - - 68288064 - 272630784 - Gallery Default Image - - - - - - - - - 256 - {{15, 100}, {114, 17}} - - YES - - 67239424 - 272629760 - Image Size: - - - - - - - - - 256 - {{15, 72}, {130, 26}} - - YES - - -2076049856 - 2048 - - - 109199615 - 1 - - LucidaGrande - 1.300000e+01 - 16 - - - - - - 400 - 75 - - - Large - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - 2 - - - YES - - - OtherViews - - - YES - - - Small - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Medium - - 1048576 - 2147483647 - - - _popUpItemAction: - 1 - - - - - - Full Size - - 1048576 - 2147483647 - - - _popUpItemAction: - 3 - - - - - 2 - 3 - YES - YES - 1 - - - - - 268 - {{363, 10}, {112, 28}} - - YES - - 604110336 - 134348800 - Choose Default - - - -2038284033 - 129 - - - 200 - 25 - - - - - 268 - {{256, 10}, {96, 28}} - - YES - - 604110336 - 134348800 - View Gallery - - - -2038284033 - 129 - - - 200 - 25 - - - - - 12 - {{237, 9}, {5, 161}} - - {0, 0} - - 67239424 - 0 - Box - - - - 3 - MCAwLjgwMDAwMDAxAA - - - 3 - 2 - 0 - NO - - - {{1, 1}, {480, 176}} - - - - {{14, 57}, {482, 192}} - - {0, 0} - - 67239424 - 0 - Export Options - - - - 3 - MCAwLjgwMDAwMDAxAA - - - - 1 - 0 - 2 - NO - - - {{2, 2}, {510, 373}} - - - - {{17, 16}, {514, 390}} - - {0, 0} - - 67239424 - 0 - Ansel - - - - 3 - MCAwLjgwMDAwMDAxAA - - - - 3 - 0 - 2 - NO - - - {548, 406} - - - {{0, 0}, {1920, 1178}} - {213, 129} - {3.40282e+38, 3.40282e+38} - - - 23 - 2 - {{196, 315}, {455, 195}} - -1543503872 - Add Server - NSPanel - - {3.40282e+38, 3.40282e+38} - - + + 256 YES @@ -690,15 +51,30 @@ -1804468671 272630784 - + + LucidaGrande + 1.300000e+01 + 1044 + YES - + + 6 + System + textBackgroundColor + + 3 + MQA + + 6 System textColor - + + 3 + MAA + @@ -714,8 +90,21 @@ Path to rpc.php - - + + 6 + System + controlColor + + 3 + MC42NjY2NjY2OQA + + + + 6 + System + controlTextColor + + @@ -824,15 +213,106 @@ 268 - {{345, 12}, {96, 32}} - + {{345, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Save + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{244, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{18, 18}, {145, 18}} + + YES + + 67239424 + 0 + Make Default + + + 1211912703 + 130 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {455, 195} + + {{0, 0}, {1920, 1178}} + {3.40282e+38, 3.40282e+38} + + + 23 + 2 + {{196, 152}, {679, 358}} + -1543503872 + Servers + NSPanel + + {3.40282e+38, 3.40282e+38} + + + 256 + + YES + + + 268 + {{568, 28}, {96, 28}} + YES - + 67239424 - 134217728 - Save - - + 134348800 + Done + + LucidaGrande + 1.100000e+01 + 3100 + + -2038284033 129 @@ -841,18 +321,220 @@ 25 - - + + 268 - {{244, 12}, {96, 32}} - + + YES + + + 2304 + + YES + + + 256 + {626, 247} + + YES + + + 256 + {626, 17} + + + + + + 256 + {{627, 0}, {16, 17}} + + + + YES + + nickname + 1.010000e+02 + 4.000000e+01 + 1.000000e+03 + + 75628032 + 0 + Server Name + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 337772096 + 2048 + Text Cell + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + username + 1.410000e+02 + 4.000000e+01 + 1.000000e+03 + + 75628032 + 0 + Login Name + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + endpoint + 3.750000e+02 + 1.000000e+01 + 3.402823e+38 + + 75628032 + 0 + URL + + + 6 + System + headerColor + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + 3.000000e+00 + 2.000000e+00 + + + 6 + System + gridColor + + 3 + MC41AA + + + 1.700000e+01 + -700448768 + 4 + 15 + 0 + YES + + + {{1, 17}, {626, 247}} + + + + 4 + + + + 256 + {{627, 17}, {15, 247}} + + + _doScroller: + 1.000000e+00 + 1.947368e-01 + + + + 256 + {{1, 264}, {626, 15}} + + 1 + + _doScroller: + 9.984051e-01 + + + + 2304 + + YES + + + {{1, 0}, {626, 17}} + + + + 4 + + + + {{20, 60}, {643, 280}} + + 50 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 268 + {{15, 28}, {96, 28}} + YES - + 67239424 - 134217728 - Cancel - - + 134348800 + Remove + + -2038284033 129 @@ -861,27 +543,20 @@ 25 - - + + 268 - {{18, 18}, {145, 18}} - + {{109, 28}, {123, 28}} + YES - - 67239424 - 0 - Make Default - - - 1211912703 - 130 - - NSImage - NSSwitch - - - NSSwitch - + + 67239424 + 134348800 + Make Default + + + -2038284033 + 129 200 @@ -889,38 +564,37 @@ - {455, 195} - + {679, 358} {{0, 0}, {1920, 1178}} {3.40282e+38, 3.40282e+38} - + 23 2 - {{196, 152}, {679, 358}} + {{196, 240}, {480, 270}} -1543503872 - Servers + Window NSPanel {3.40282e+38, 3.40282e+38} - - + + 256 YES - - + + 268 - {{568, 28}, {96, 28}} - + {{370, 12}, {96, 32}} + YES - + 67239424 - 134348800 - Done - - + 134217728 + Close + + -2038284033 129 @@ -929,242 +603,740 @@ 25 - - - 268 + + + 18 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + NSFilenamesPboardType + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6Jy5TR0knA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6JzhCUFMnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J0JNUGYnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J0VQU0YnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J0ZQaXgnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J0dJRmYnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J0lDTyAnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J0pQRUcnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J1BERiAnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J1BJQ1QnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J1BOR2YnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J1BOVEcnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J1RJRkYnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J1RQSUMnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J2pwMiAnA + TlNUeXBlZEZpbGVuYW1lc1Bib2FyZFR5cGU6J3F0aWYnA + NSTypedFilenamesPboardType:BMP + NSTypedFilenamesPboardType:CR2 + NSTypedFilenamesPboardType:CRW + NSTypedFilenamesPboardType:CUR + NSTypedFilenamesPboardType:DCR + NSTypedFilenamesPboardType:DNG + NSTypedFilenamesPboardType:EPI + NSTypedFilenamesPboardType:EPS + NSTypedFilenamesPboardType:EPSF + NSTypedFilenamesPboardType:EPSI + NSTypedFilenamesPboardType:EXR + NSTypedFilenamesPboardType:FAX + NSTypedFilenamesPboardType:FPIX + NSTypedFilenamesPboardType:FPX + NSTypedFilenamesPboardType:GIF + NSTypedFilenamesPboardType:HDR + NSTypedFilenamesPboardType:ICNS + NSTypedFilenamesPboardType:ICO + NSTypedFilenamesPboardType:JP2 + NSTypedFilenamesPboardType:JPEG + NSTypedFilenamesPboardType:JPG + NSTypedFilenamesPboardType:MAC + NSTypedFilenamesPboardType:MRW + NSTypedFilenamesPboardType:NEF + NSTypedFilenamesPboardType:ORF + NSTypedFilenamesPboardType:PCT + NSTypedFilenamesPboardType:PDF + NSTypedFilenamesPboardType:PIC + NSTypedFilenamesPboardType:PICT + NSTypedFilenamesPboardType:PNG + NSTypedFilenamesPboardType:PNT + NSTypedFilenamesPboardType:PNTG + NSTypedFilenamesPboardType:PS + NSTypedFilenamesPboardType:PSD + NSTypedFilenamesPboardType:QTI + NSTypedFilenamesPboardType:QTIF + NSTypedFilenamesPboardType:RAF + NSTypedFilenamesPboardType:RGB + NSTypedFilenamesPboardType:SGI + NSTypedFilenamesPboardType:SRF + NSTypedFilenamesPboardType:TARGA + NSTypedFilenamesPboardType:TGA + NSTypedFilenamesPboardType:TIF + NSTypedFilenamesPboardType:TIFF + NSTypedFilenamesPboardType:XBM + NSTypedFilenamesPboardType:bmp + NSTypedFilenamesPboardType:cr2 + NSTypedFilenamesPboardType:crw + NSTypedFilenamesPboardType:cur + NSTypedFilenamesPboardType:dcr + NSTypedFilenamesPboardType:dng + NSTypedFilenamesPboardType:epi + NSTypedFilenamesPboardType:eps + NSTypedFilenamesPboardType:epsf + NSTypedFilenamesPboardType:epsi + NSTypedFilenamesPboardType:exr + NSTypedFilenamesPboardType:fax + NSTypedFilenamesPboardType:fpix + NSTypedFilenamesPboardType:fpx + NSTypedFilenamesPboardType:gif + NSTypedFilenamesPboardType:hdr + NSTypedFilenamesPboardType:icns + NSTypedFilenamesPboardType:ico + NSTypedFilenamesPboardType:jp2 + NSTypedFilenamesPboardType:jpeg + NSTypedFilenamesPboardType:jpg + NSTypedFilenamesPboardType:mac + NSTypedFilenamesPboardType:mrw + NSTypedFilenamesPboardType:nef + NSTypedFilenamesPboardType:orf + NSTypedFilenamesPboardType:pct + NSTypedFilenamesPboardType:pdf + NSTypedFilenamesPboardType:pic + NSTypedFilenamesPboardType:pict + NSTypedFilenamesPboardType:png + NSTypedFilenamesPboardType:pnt + NSTypedFilenamesPboardType:pntg + NSTypedFilenamesPboardType:ps + NSTypedFilenamesPboardType:psd + NSTypedFilenamesPboardType:qti + NSTypedFilenamesPboardType:qtif + NSTypedFilenamesPboardType:raf + NSTypedFilenamesPboardType:rgb + NSTypedFilenamesPboardType:sgi + NSTypedFilenamesPboardType:srf + NSTypedFilenamesPboardType:targa + NSTypedFilenamesPboardType:tga + NSTypedFilenamesPboardType:tif + NSTypedFilenamesPboardType:tiff + NSTypedFilenamesPboardType:xbm + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{15, 52}, {445, 239}} + + NO + NO + NO + NO + YES + NO + NO + 1.000000e+02 + 1.000000e+02 + + + + + {480, 270} + + + {{0, 0}, {1920, 1178}} + {3.40282e+38, 3.40282e+38} + + + 15 + 2 + {{220, 358}, {548, 406}} + 1886912512 + + Window + + NSWindow + + View + + {3.40282e+38, 3.40282e+38} + {213, 107} + + + 256 + + YES + + + 256 YES - - - 2304 + + + 256 YES - - - 256 - {626, 247} - - YES - - - 256 - {626, 17} - - + + + 268 + + YES + + + 256 + + YES + + + 268 + {{15, 71}, {81, 17}} + + YES + + 68288064 + 272630784 + Server + + LucidaGrande + 1.200000e+01 + 16 + + + + + + + + + 268 + {{76, 66}, {382, 26}} + + YES + + -2076049856 + 2048 + + + 109199615 + 129 + + + 400 + 75 + + + (None) + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + 1 + YES + YES + 2 + + + + + 268 + {{77, 33}, {117, 17}} + + YES + + 68288064 + 272761856 + Not Logged In + + + + + + + + + 1292 + + {{439, 33}, {16, 16}} + + 28938 + 1.600000e+01 + 1.000000e+02 + + + + 268 + {{15, 37}, {43, 16}} + + YES + + 68288064 + 272630784 + Status + + + + + + + + + 268 + {{367, 32}, {65, 16}} + + YES + + 67239424 + 134479872 + Cancel + + LucidaGrande + 9.000000e+00 + 3614 + + + -2038284033 + 129 + + + 200 + 25 + + + + {{1, 1}, {480, 94}} + + - - - 256 - {{627, 0}, {16, 17}} - + {{7, 253}, {482, 110}} + + {0, 0} + + 67239424 + 0 + Connection + + + + 3 + MCAwLjgwMDAwMDAxAA + - + + 1 + 0 + 2 + NO + + + + 268 + YES - - nickname - 1.010000e+02 - 4.000000e+01 - 1.000000e+03 - - 75628032 - 0 - Server Name - - - 3 - MC4zMzMzMzI5OQA + + + 256 + + YES + + + 268 + {{135, 144}, {92, 32}} + + YES + + 67239424 + 134479872 + Create New + + + -2038284033 + 129 + + LucidaGrande + 9.000000e+00 + 16 + + + + 200 + 25 + + + + + 268 + {{18, 122}, {211, 26}} + + YES + + 879885888 + 272630784 + + + + YES + + + 5 + YES + + + + 274 + {15, 0} + + + YES + + YES + + + 1.200000e+01 + 1.000000e+01 + 1.000000e+03 + + 75628032 + 0 + + + + 3 + MC4zMzMzMzI5OQA + + + + + 338820672 + 1024 + + + YES + + + + 3 + YES + + + + 3.000000e+00 + 2.000000e+00 + + + 1.900000e+01 + tableViewAction: + -767524864 + + + + 1 + 15 + 0 + YES + + + + + + 268 + {{15, 152}, {103, 16}} + + YES + + 68288064 + 272630784 + Gallery + + + + + + + + + 268 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{258, 38}, {214, 118}} + + YES + + 130560 + 33554432 + 0 + 0 + 1 + NO + + YES + + + + 268 + {{258, 154}, {158, 16}} + + YES + + 68288064 + 272630784 + Gallery Default Image + + + + + + + + + 256 + {{15, 100}, {114, 17}} + + YES + + 67239424 + 272629760 + Image Size: + + + + + + + + + 256 + {{15, 72}, {130, 26}} + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + LucidaGrande + 1.300000e+01 + 16 + + + + + + 400 + 75 + + + Large + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + 2 + + + YES + + + OtherViews + + + YES + + + Small + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Medium + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + + Full Size + + 1048576 + 2147483647 + + + _popUpItemAction: + 3 + + + + + 2 + 3 + YES + YES + 1 + - - 6 - System - headerTextColor - + + + 268 + {{363, 10}, {112, 28}} + + YES + + 604110336 + 134348800 + Choose Default + + + -2038284033 + 129 + + + 200 + 25 + - - - 337772096 - 2048 - Text Cell - - - - - - 3 - YES - YES - - - - username - 1.410000e+02 - 4.000000e+01 - 1.000000e+03 - - 75628032 - 0 - Login Name - - - - - - 337772096 - 2048 - Text Cell - - - - - - 3 - YES - YES - - - - endpoint - 3.750000e+02 - 1.000000e+01 - 3.402823e+38 - - 75628032 - 0 - URL - - - 6 - System - headerColor - + + + 268 + {{256, 10}, {96, 28}} + + YES + + 67239424 + 134348800 + View Gallery + + + -2038284033 + 129 + + + 200 + 25 + + + + + 12 + {{237, 9}, {5, 161}} + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO - - - - 337772096 - 2048 - Text Cell - - - - - 3 - YES - YES - + {{1, 1}, {480, 176}} + - 3.000000e+00 - 2.000000e+00 - - - 1.700000e+01 - -700448768 - 4 - 15 - 0 - YES - - - {{1, 17}, {626, 247}} - - - - - 4 - - - - 256 - {{627, 17}, {15, 247}} - - - _doScroller: - 1.000000e+00 - 1.947368e-01 - - - - 256 - {{1, 264}, {626, 15}} - - 1 - - _doScroller: - 9.984051e-01 - - - - 2304 - - YES - - - {{1, 0}, {626, 17}} - - - - - 4 - - - - {{20, 60}, {643, 280}} - - - 50 - - - - - - QSAAAEEgAABBmAAAQZgAAA - - - - 268 - {{15, 28}, {96, 28}} - - YES - - 67239424 - 134348800 - Remove - - - -2038284033 - 129 - - - 200 - 25 + {{14, 57}, {482, 192}} + + {0, 0} + + 67239424 + 0 + Export Options + + + + 3 + MCAwLjgwMDAwMDAxAA + + + + 1 + 0 + 2 + NO + + + {{2, 2}, {510, 373}} + + - - - - 268 - {{109, 28}, {123, 28}} - - YES - + {{17, 16}, {514, 390}} + + {0, 0} + 67239424 - 134348800 - Make Default + 0 + Ansel - - -2038284033 - 129 - - - 200 - 25 + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 0 + 2 + NO - {679, 358} + {548, 406} + {{0, 0}, {1920, 1178}} + {213, 129} {3.40282e+38, 3.40282e+38} @@ -1379,6 +1551,70 @@ 534 + + + clickViewGallery: + + + + 543 + + + + viewGallery + + + + 544 + + + + mviewGallerySheet + + + + 545 + + + + closeGalleryView + + + + 548 + + + + closeGalleryView: + + + + 549 + + + + dataSource + + + + 551 + + + + delegate + + + + 552 + + + + browserView + + + + 553 + @@ -1410,35 +1646,6 @@ Application - 5 - - - YES - - - - Window - - - 6 - - - YES - - - - - - 7 - - - YES - - - - - - 387 @@ -1531,211 +1738,352 @@ - 403 - - - YES - - - + 403 + + + YES + + + + + + 405 + + + YES + + + + + + 407 + + + YES + + + + + + 409 + + + YES + + + + + + 472 + + + + + 473 + + + + + 474 + + + + + 475 + + + + + 476 + + + + + 477 + + + + + 478 + + + + + 479 + + + + + 480 + + + + + 481 + + + + + 482 + + + + + 501 + + + YES + + + + + + 502 + + + YES + + + + + + + + + 503 + + + YES + + + + + + 504 + + + + + 507 + + + YES + + + + + + + + + 508 + + + + + 509 + + - 405 - + 510 + YES - + + + - + - 407 - + 511 + + + + + 512 + YES - + - + - 409 - + 513 + YES - + - - - - 472 - - - - - 473 - - - - - 474 - - + - 475 - - + 514 + + - 476 - - + 515 + + - 477 - - + 516 + + + YES + + + - 478 - - + 517 + + - 479 - - + 521 + + + YES + + + - 480 - - + 522 + + - 481 - - + 527 + + + YES + + + - 482 - - + 528 + + - 136 - + 536 + YES - - - - - - + - + + GalleryView - 137 - + 537 + YES - - - - - - - - - - + + - + - 138 - + 5 + YES - + - - - - 462 - - + + Window - 140 - + 6 + YES - + - + - 463 - - + 7 + + + YES + + + + - 169 - + 137 + YES - + + + + + + + + + + - + - 464 - - + 500 + + - 357 - + 498 + YES - + - 465 - - + 499 + + - 360 - + 138 + YES - + - 466 - - + 462 + + - 9 - + 364 + YES - + - 460 - - + 467 + + 18 @@ -1760,125 +2108,116 @@ YES - - - + + + - 23 - + 20 + - 22 - + 21 + - 21 - + 22 + - 20 - + 23 + - 364 - + 9 + YES - + - 467 - - + 460 + + - 413 - + 360 + YES - + - + - 470 - - + 466 + + - 484 - + 357 + YES - + - + - 485 - - - YES - - - + 465 + + - 486 - + 169 + YES - + - + - 489 - - + 464 + + - 167 - + 140 + YES - + - - - - 468 - - + - 216 - - + 463 + + - 493 - + 136 + YES - + + + + + + - - - - 494 - - + 495 @@ -1895,166 +2234,102 @@ - 498 - - - YES - - - - - - 499 - - - - - 500 - - - - - 501 - - - YES - - - - - - 502 - - - YES - - - - - - + 216 + + - 503 - + 167 + YES - + - + - 504 - - + 468 + + - 507 - + 493 + YES - - - - + - - - - 508 - - + - 509 - - + 494 + + - 510 - + 413 + YES - - - + - + - 511 - - + 470 + + - 512 - + 484 + YES - + - + - 513 - + 485 + YES - + - - - - 514 - - - - - 515 - - + - 516 - + 486 + YES - + - + - 517 - - + 489 + + - 521 - + 546 + YES - + - + - 522 - - - - - 527 - - - YES - - - + 547 + + - 528 - - + 550 + + @@ -2166,6 +2441,14 @@ 522.IBPluginDependency 527.IBPluginDependency 528.IBPluginDependency + 536.IBEditorWindowLastContentRect + 536.IBPluginDependency + 536.IBWindowTemplateEditedContentRect + 536.NSWindowTemplate.visibleAtLaunch + 537.IBPluginDependency + 546.IBPluginDependency + 547.IBPluginDependency + 550.IBPluginDependency 6.IBPluginDependency 6.ImportedFromIB2 7.CustomClassName @@ -2212,9 +2495,9 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{677, 386}, {455, 195}} + {{351, 386}, {455, 195}} com.apple.InterfaceBuilder.CocoaPlugin - {{677, 386}, {455, 195}} + {{351, 386}, {455, 195}} com.apple.InterfaceBuilder.CocoaPlugin @@ -2253,16 +2536,16 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{580, 642}, {548, 406}} + {{258, 642}, {548, 406}} com.apple.InterfaceBuilder.CocoaPlugin - {{580, 642}, {548, 406}} + {{258, 642}, {548, 406}} {213, 107} com.apple.InterfaceBuilder.CocoaPlugin - {{288, 600}, {679, 358}} + {{127, 600}, {679, 358}} com.apple.InterfaceBuilder.CocoaPlugin - {{288, 600}, {679, 358}} + {{127, 600}, {679, 358}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2280,6 +2563,14 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{91, 819}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + {{91, 819}, {480, 270}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.imagekit.ibplugin com.apple.InterfaceBuilder.CocoaPlugin AnselExportPluginBox @@ -2309,7 +2600,7 @@ - 534 + 553 @@ -2323,6 +2614,8 @@ YES clickCancelConnect: clickServer: + clickViewGallery: + closeGalleryView: closeServerList: doAddServer: doCancelAddServer: @@ -2338,12 +2631,16 @@ id id id + id + id YES YES + browserView + closeGalleryView defaultImageView firstView galleryCombo @@ -2358,14 +2655,18 @@ mServersPopUp mSettingsBox mSizePopUp + mviewGallerySheet newServerSheet serverListPanel serverTable spinner statusLabel + viewGallery YES + IKImageBrowserView + NSButton NSImageView NSControl NSComboBox @@ -2381,10 +2682,12 @@ NSBox NSPopUpButton NSWindow + NSWindow NSPanel NSTableView NSProgressIndicator NSTextField + NSButton diff --git a/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib b/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib index f471deeb9..dcd784b31 100644 Binary files a/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib and b/iPhoto2Ansel/English.lproj/Panel.nib/keyedobjects.nib differ diff --git a/iPhoto2Ansel/TURAnsel.m b/iPhoto2Ansel/TURAnsel.m index e404d5ad7..7c0138e79 100644 --- a/iPhoto2Ansel/TURAnsel.m +++ b/iPhoto2Ansel/TURAnsel.m @@ -22,9 +22,6 @@ @synthesize username; @synthesize password; -static NSString *ERR_DOMAIN = @"com.theupstairsroom.TURAnsel"; - - #pragma mark init - (id)initWithConnectionParameters: (NSDictionary *)params { diff --git a/iPhoto2Ansel/TURAnselGallery.h b/iPhoto2Ansel/TURAnselGallery.h index c83715a4c..c8a4bf84d 100644 --- a/iPhoto2Ansel/TURAnselGallery.h +++ b/iPhoto2Ansel/TURAnselGallery.h @@ -17,7 +17,7 @@ typedef enum { @interface NSObject (TURAnselGalleryDelegate) - (void)TURAnselGalleryDidReceiveRPCResponse: (XMLRPCResponse *)response; -- (void)TURAnselGalleryDidUploadImage: (TURAnselGallery *)gallery; +- (void)TURAnselGalleryDidUploadImage: (id *)gallery; @end @interface TURAnselGallery : NSObject { @@ -25,6 +25,7 @@ typedef enum { int galleryImageCount; int galleryDefaultImage; NSURL *galleryDefaultImageURL; + NSMutableArray *imageList; NSString *galleryName; NSString *galleryDescription; TURAnsel *anselController; @@ -44,6 +45,7 @@ typedef enum { - (void)setDelegate: (id)newDelegate; - (id)delegate; - (NSURL *)galleryDefaultImageURL; +- (id)listImages; - (int)galleryId; - (TURAnselGalleryState) state; - (void)setState: (TURAnselGalleryState)theState; diff --git a/iPhoto2Ansel/TURAnselGallery.m b/iPhoto2Ansel/TURAnselGallery.m index 906a37f4f..3beabd657 100644 --- a/iPhoto2Ansel/TURAnselGallery.m +++ b/iPhoto2Ansel/TURAnselGallery.m @@ -73,6 +73,33 @@ } /** + * Get the complete list of image ids and URLs + */ +- (id)listImages +{ + if (!imageList) { + + NSArray *params = [[NSArray alloc] initWithObjects: + @"ansel", //Scope + [NSNumber numberWithInt: galleryId], //Gallery Id + [NSNumber numberWithInt: 2], //PERMS_SHOW + @"thumb", // Thumbnail + [NSNumber numberWithBool:YES], // Full path + nil]; + + [self setState:TURAnselGalleryStateBusy]; + XMLRPCResponse *response = [anselController callRPCMethod: @"images.listImages" + withParams: params]; + + if (response) { + imageList = [response retain]; + } + } + + return imageList; +} + +/** * Upload the provided image to this gallery. */ - (void)uploadImageObject: (NSDictionary *)imageParameters @@ -136,6 +163,7 @@ [anselController release]; [galleryDefaultImageURL release]; [galleryDescription release]; + [imageList release]; [super dealloc]; } diff --git a/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj b/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj index d39ba363a..86ca39bf9 100644 --- a/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj +++ b/iPhoto2Ansel/iPhoto2Ansel.xcodeproj/project.pbxproj @@ -19,6 +19,9 @@ B07D42700EC230B100B59765 /* TURAnsel.m in Sources */ = {isa = PBXBuildFile; fileRef = B07D426D0EC230B100B59765 /* TURAnsel.m */; }; B07D42710EC230B100B59765 /* TURAnselGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = B07D426F0EC230B100B59765 /* TURAnselGallery.m */; }; B07D44F70EC2AEC700B59765 /* TURXMLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = B07D44F60EC2AEC700B59765 /* TURXMLConnection.m */; }; + B0B666750FB34604009459D5 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B0B666730FB34604009459D5 /* Quartz.framework */; }; + B0B666760FB34604009459D5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B0B666740FB34604009459D5 /* QuartzCore.framework */; }; + B0B6669B0FB357B3009459D5 /* AnselGalleryViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = B0B6669A0FB357B3009459D5 /* AnselGalleryViewItem.m */; }; B0BFBC780ED5B2AB006581A5 /* XMLRPC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B0BFBC700ED5B221006581A5 /* XMLRPC.framework */; }; B0BFBC7B0ED5B2B2006581A5 /* XMLRPC.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B0BFBC700ED5B221006581A5 /* XMLRPC.framework */; }; B0BFBC970ED5B32B006581A5 /* NSDataAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = B0BFBC810ED5B32B006581A5 /* NSDataAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -97,6 +100,10 @@ B07D426F0EC230B100B59765 /* TURAnselGallery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TURAnselGallery.m; sourceTree = ""; }; B07D44F50EC2AEC700B59765 /* TURXMLConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TURXMLConnection.h; sourceTree = ""; }; B07D44F60EC2AEC700B59765 /* TURXMLConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TURXMLConnection.m; sourceTree = ""; }; + B0B666730FB34604009459D5 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = ""; }; + B0B666740FB34604009459D5 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; + B0B666990FB357B3009459D5 /* AnselGalleryViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnselGalleryViewItem.h; sourceTree = ""; }; + B0B6669A0FB357B3009459D5 /* AnselGalleryViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnselGalleryViewItem.m; sourceTree = ""; }; B0BFBC700ED5B221006581A5 /* XMLRPC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XMLRPC.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B0BFBC810ED5B32B006581A5 /* NSDataAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDataAdditions.h; sourceTree = ""; }; B0BFBC820ED5B32B006581A5 /* NSDataAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDataAdditions.m; sourceTree = ""; }; @@ -133,6 +140,8 @@ B0BFBC780ED5B2AB006581A5 /* XMLRPC.framework in Frameworks */, 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, B0DF843C0EE9E6EB000DAA9E /* QuickTime.framework in Frameworks */, + B0B666750FB34604009459D5 /* Quartz.framework in Frameworks */, + B0B666760FB34604009459D5 /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -186,6 +195,8 @@ 08FB77AFFE84173DC02AAC07 /* ExportPlugin */ = { isa = PBXGroup; children = ( + B0B666990FB357B3009459D5 /* AnselGalleryViewItem.h */, + B0B6669A0FB357B3009459D5 /* AnselGalleryViewItem.m */, B06C1E020EB1644600BFAFCB /* AnselExportPluginBox.m */, B06C1E010EB1644600BFAFCB /* AnselExportPluginBox.h */, B06C1E040EB164D900BFAFCB /* AnselExportController.h */, @@ -197,6 +208,8 @@ 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( + B0B666730FB34604009459D5 /* Quartz.framework */, + B0B666740FB34604009459D5 /* QuartzCore.framework */, B0DF843B0EE9E6EB000DAA9E /* QuickTime.framework */, 089C1672FE841209C02AAC07 /* Foundation.framework */, 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, @@ -419,6 +432,7 @@ B05C4A060EE9E001005B4B28 /* ImageResizer.m in Sources */, B0CCED420EEC6E810012D3D3 /* TURAnselGalleryPanelController.m in Sources */, B00EF5670EF5E22900A9D71C /* TURAnselServersPanelController.m in Sources */, + B0B6669B0FB357B3009459D5 /* AnselGalleryViewItem.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };