From: Michael J. Rubinsky Date: Tue, 22 Sep 2009 18:40:51 +0000 (-0400) Subject: Clean up, use constants where possible, organize header files, better error messages X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=103b7fb670a9fff6359f780a47d29474c9981574;p=horde.git Clean up, use constants where possible, organize header files, better error messages --- diff --git a/ApertureToAnselExportPlugin/AnselGalleryViewItem.h b/ApertureToAnselExportPlugin/AnselGalleryViewItem.h index 068c07f07..41ba61d68 100644 --- a/ApertureToAnselExportPlugin/AnselGalleryViewItem.h +++ b/ApertureToAnselExportPlugin/AnselGalleryViewItem.h @@ -1,10 +1,12 @@ -// -// AnselGalleryViewItem.h -// iPhoto2Ansel -// -// Created by Michael Rubinsky on 5/7/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// +/** + * AnselGalleryViewItem + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @implements IKImageBrowserItem + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import #import @@ -31,4 +33,3 @@ - (NSString *)imageSubtitle; @end - diff --git a/ApertureToAnselExportPlugin/AnselGalleryViewItem.m b/ApertureToAnselExportPlugin/AnselGalleryViewItem.m index c2911d52e..a27b41b5c 100644 --- a/ApertureToAnselExportPlugin/AnselGalleryViewItem.m +++ b/ApertureToAnselExportPlugin/AnselGalleryViewItem.m @@ -1,13 +1,15 @@ -// -// AnselGalleryViewItem.m -// iPhoto2Ansel -// -// Implementation of the IKImageBrowserItem protocol - -// Created by Michael Rubinsky on 5/7/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - +/** + * AnselGalleryViewItem.m + * + * Implements the IKImageBrowserItem protocol for displaying images from a + * remote Ansel gallery in an IKImageBrowser. + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @implements IKImageBrowserItem + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import "AnselGalleryViewItem.h" @implementation AnselGalleryViewItem @@ -25,7 +27,6 @@ imageDate = [theDate retain]; return self; } - - (void)dealloc { [image release]; @@ -59,7 +60,6 @@ NSLog(@"imageTitle: %@", imageTitle); return imageTitle; } - - (NSString *)imageSubtitle { NSLog(@"imageSubtitle: %@", [imageDate description]); diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h index 96955aa18..e1277d2f2 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.h @@ -13,6 +13,7 @@ #import "ApertureExportPlugIn.h" @class TURAnsel, TURAnselGallery; + @interface ApertureToAnselExportPlugin : NSObject { // The cached API Manager object, as passed to the -initWithAPIManager: method. diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m index 26dfea0b3..ad4c0d818 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m @@ -414,7 +414,7 @@ NSString * const TURAnselServerPasswordKey = @"password"; //@TODO - need to add a flag to indicate if we have a UI or not - (void)TURAnselHadError: (NSError *)error { - NSLog(@"TURAnselHadError"); + NSLog(@"TURAnselHadError: %@", error); // Stop the spinner [spinner stopAnimation: self]; [mServersPopUp setEnabled: true]; diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj index 13a4efe7a..2c7190e31 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; + B070DA551069387B00C0E3FC /* TURAnselConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = B070DA541069387B00C0E3FC /* TURAnselConstants.m */; }; B0AE23391049F7770096565B /* TURAnselGalleryPanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = B0AE23361049F7770096565B /* TURAnselGalleryPanelController.m */; }; B0AE23411049F7A20096565B /* AnselGalleryPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = B0AE233D1049F7A20096565B /* AnselGalleryPanel.nib */; }; B0D311D01049A7DE006B06C6 /* TURAnsel.m in Sources */ = {isa = PBXBuildFile; fileRef = B0D311CB1049A7DE006B06C6 /* TURAnsel.m */; }; @@ -45,6 +46,9 @@ 287924B90DAEB2A20074992A /* ApertureSDKCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApertureSDKCommon.h; sourceTree = ""; }; 32DBCF630370AF2F00C91783 /* ApertureToAnselExportPlugin_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApertureToAnselExportPlugin_Prefix.pch; sourceTree = ""; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B070DA531069387B00C0E3FC /* TURAnselConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TURAnselConstants.h; sourceTree = ""; }; + B070DA541069387B00C0E3FC /* TURAnselConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TURAnselConstants.m; sourceTree = ""; }; + B070DA5A1069391F00C0E3FC /* TURAnselKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TURAnselKit.h; sourceTree = ""; }; B0AE23351049F7770096565B /* TURAnselGalleryPanelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TURAnselGalleryPanelController.h; sourceTree = ""; }; B0AE23361049F7770096565B /* TURAnselGalleryPanelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TURAnselGalleryPanelController.m; sourceTree = ""; }; B0AE233E1049F7A20096565B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/AnselGalleryPanel.nib; sourceTree = ""; }; @@ -187,6 +191,9 @@ B0D311CA1049A7DE006B06C6 /* TURAnsel.h */, B0D311CC1049A7DE006B06C6 /* TURAnselGallery.h */, B0D311CD1049A7DE006B06C6 /* TURAnselGallery.m */, + B070DA531069387B00C0E3FC /* TURAnselConstants.h */, + B070DA541069387B00C0E3FC /* TURAnselConstants.m */, + B070DA5A1069391F00C0E3FC /* TURAnselKit.h */, ); name = AnselToolkit; sourceTree = ""; @@ -265,6 +272,7 @@ B0DEA058104D7012001D1509 /* AnselGalleryViewItem.m in Sources */, B0DD64D2106738DB00085661 /* NSStringAdditions.m in Sources */, B0DD64E31067391E00085661 /* NSDataAdditions.m in Sources */, + B070DA551069387B00C0E3FC /* TURAnselConstants.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/classes.nib b/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/classes.nib deleted file mode 100644 index b342825c7..000000000 --- a/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/classes.nib +++ /dev/null @@ -1,101 +0,0 @@ - - - - - IBClasses - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - ACTIONS - - clickCancelConnect - id - clickServer - id - clickViewGallery - id - closeGalleryView - id - closeServerList - id - doAddServer - id - doCancelAddServer - id - removeServer - id - showNewGallery - id - - CLASS - ApertureToAnselExportPlugin - LANGUAGE - ObjC - OUTLETS - - anselController - id - browserView - IKImageBrowserView - closeGalleryView - NSButton - defaultImageView - NSImageView - firstView - NSView - galleryCombo - NSComboBox - lastView - NSView - mMakeNewServerDefault - NSButton - mNewGalleryButton - NSButton - mServerSheetHostURL - NSTextField - mServerSheetPassword - NSSecureTextField - mServerSheetServerNickName - NSTextField - mServerSheetUsername - NSTextField - mServersPopUp - NSPopUpButton - mviewGallerySheet - NSWindow - newServerSheet - NSWindow - serverListPanel - NSPanel - serverTable - NSTableView - settingsView - NSView - spinner - NSProgressIndicator - statusLabel - NSTextField - viewGallery - NSButton - - SUPERCLASS - NSObject - - - IBVersion - 1 - - diff --git a/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/designable.nib b/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/designable.nib new file mode 100644 index 000000000..69a386acc --- /dev/null +++ b/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/designable.nib @@ -0,0 +1,2789 @@ + + + + 1050 + 10B504 + 732 + 1038.2 + 437.00 + + 732 + 1.1 + + + + + + + + + com.apple.imagekit.ibplugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + ApertureToAnselExportPlugin + + + FirstResponder + + + NSApplication + + + + 268 + + + + 256 + + + + 256 + + + + 268 + + + + 256 + + + + 268 + {{27, 225}, {81, 17}} + + YES + + 68288064 + 272630784 + Server + + LucidaGrande + 12 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{76, 220}, {382, 26}} + + YES + + -2076049856 + 2048 + + LucidaGrande + 13 + 1044 + + + 109199615 + 129 + + + 400 + 75 + + + (None) + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + 1 + YES + YES + 2 + + + + + 268 + {{77, 187}, {117, 17}} + + YES + + 68288064 + 272761856 + Not Logged In + + LucidaGrande + 11 + 3100 + + + + + + + + + 1292 + + {{439, 187}, {16, 16}} + + 28938 + 16 + 100 + + + + 268 + {{27, 191}, {43, 16}} + + YES + + 68288064 + 272630784 + Status + + + + + + + + + 268 + {{135, 139}, {92, 32}} + + YES + + 67239424 + 134479872 + Create New + + LucidaGrande + 9 + 3614 + + + -2038284033 + 129 + + LucidaGrande + 9 + 16 + + + + 200 + 25 + + + + + 268 + {{18, 117}, {211, 26}} + + YES + + 611450433 + 272630784 + + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 5 + YES + YES + YES + + + + + 274 + {15, 0} + + + YES + + + + 12 + 10 + 1000 + + 75628032 + 0 + + + + 3 + MC4zMzMzMzI5OQA + + + + + 338820672 + 1024 + + + YES + + 6 + System + controlBackgroundColor + + + + + 3 + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 19 + tableViewAction: + -767524864 + + + 1 + 15 + 0 + YES + 0 + + + + + + + 268 + {{15, 147}, {103, 16}} + + YES + + 68288064 + 272630784 + Gallery + + + + + + + + + 268 + + 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 + + {{244, 24}, {214, 142}} + + YES + + 130560 + 33554432 + 0 + 0 + 1 + YES + + YES + + + + 268 + {{13, 89}, {96, 28}} + + YES + + 604110336 + 134348800 + View Gallery + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{14, 176}, {459, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 2 + 0 + NO + + + {{1, 1}, {487, 256}} + + + + {{7, 9}, {489, 258}} + + {0, 0} + + 67239424 + 0 + + + + + 3 + MCAwLjgwMDAwMDAxAA + + + + 1 + 0 + 0 + NO + + + {{2, 2}, {510, 271}} + + + + {{17, 16}, {514, 275}} + + {0, 0} + + 67239424 + 0 + + + + + 3 + MCAwLjgwMDAwMDAxAA + + + + 3 + 0 + 0 + NO + YES + + + {528, 309} + + NSView + + + 23 + 2 + {{196, 315}, {455, 195}} + -1543503872 + Add Server + NSPanel + + {1.79769e+308, 1.79769e+308} + + + 256 + + + + 268 + {{124, 124}, {311, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + 6 + System + textColor + + + + + + + 268 + {{17, 126}, {102, 17}} + + YES + + 68288064 + 272630784 + Path to rpc.php + + + + + + + + + 268 + {{124, 92}, {311, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 268 + {{124, 60}, {311, 22}} + + YES + + 343014976 + 272630784 + + + + YES + + + + NSAllRomanInputSourcesLocaleIdentifier + + + + + + 268 + {{17, 94}, {67, 17}} + + YES + + 68288064 + 272630784 + Username + + + + + + + + + 268 + {{17, 62}, {67, 17}} + + YES + + 68288064 + 272630784 + Password + + + + + + + + + 268 + {{17, 158}, {102, 17}} + + YES + + 68288064 + 272630784 + Nickname + + + + + + + + + 268 + {{124, 156}, {311, 22}} + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 268 + {{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 + + + + {455, 195} + + + {{0, 0}, {1920, 1178}} + {1.79769e+308, 1.79769e+308} + + + 23 + 2 + {{196, 152}, {679, 358}} + -1543503872 + Servers + NSPanel + + {1.79769e+308, 1.79769e+308} + + + 256 + + + + 268 + {{568, 28}, {96, 28}} + + YES + + 67239424 + 134348800 + Done + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + + + + 2304 + + + + 256 + {626, 247} + + YES + + + 256 + {626, 17} + + + + + + 256 + {{627, 0}, {16, 17}} + + + + + nickname + 101 + 40 + 1000 + + 75628096 + 2048 + Server Name + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + username + 141 + 40 + 1000 + + 75628096 + 2048 + Login Name + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + endpoint + 375 + 10 + 3.4028230607370965e+38 + + 75628096 + 2048 + URL + + + 6 + System + headerColor + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + 3 + 2 + + + 17 + -700448768 + + + 4 + 15 + 0 + YES + 0 + + + {{1, 17}, {626, 247}} + + + + + 4 + + + + 256 + {{627, 17}, {15, 247}} + + + _doScroller: + 1 + 0.1947367936372757 + + + + 256 + {{1, 264}, {626, 15}} + + 1 + + _doScroller: + 0.9984050989151001 + + + + 2304 + + + + {{1, 0}, {626, 17}} + + + + + 4 + + + + {{20, 60}, {643, 280}} + + + 50 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 268 + {{15, 28}, {96, 28}} + + YES + + 67239424 + 134348800 + Remove + + + -2038284033 + 129 + + + 200 + 25 + + + + {679, 358} + + + {{0, 0}, {1920, 1178}} + {1.79769e+308, 1.79769e+308} + + + 23 + 2 + {{196, 183}, {480, 327}} + -1543503872 + Window + NSPanel + + {1.79769e+308, 1.79769e+308} + + + 256 + + + + 268 + {{370, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Close + + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + + + + 2304 + + + + 274 + + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + NSFilenamesPboardType + NSTypedFilenamesPboardType:'.SGI' + NSTypedFilenamesPboardType:'8BPS' + NSTypedFilenamesPboardType:'BMP ' + NSTypedFilenamesPboardType:'BMPf' + NSTypedFilenamesPboardType:'EPSF' + NSTypedFilenamesPboardType:'FPix' + NSTypedFilenamesPboardType:'GIFf' + NSTypedFilenamesPboardType:'ICO ' + NSTypedFilenamesPboardType:'JPEG' + NSTypedFilenamesPboardType:'PDF ' + NSTypedFilenamesPboardType:'PICT' + NSTypedFilenamesPboardType:'PNGf' + NSTypedFilenamesPboardType:'PNTG' + NSTypedFilenamesPboardType:'TIFF' + NSTypedFilenamesPboardType:'TPIC' + NSTypedFilenamesPboardType:'icns' + NSTypedFilenamesPboardType:'jp2 ' + NSTypedFilenamesPboardType:'qtif' + NSTypedFilenamesPboardType:3FR + NSTypedFilenamesPboardType:3fr + NSTypedFilenamesPboardType:ARW + NSTypedFilenamesPboardType:BMP + NSTypedFilenamesPboardType:CR2 + NSTypedFilenamesPboardType:CRW + NSTypedFilenamesPboardType:CUR + NSTypedFilenamesPboardType:DCR + NSTypedFilenamesPboardType:DNG + NSTypedFilenamesPboardType:EFX + NSTypedFilenamesPboardType:EPI + NSTypedFilenamesPboardType:EPS + NSTypedFilenamesPboardType:EPSF + NSTypedFilenamesPboardType:EPSI + NSTypedFilenamesPboardType:ERF + NSTypedFilenamesPboardType:EXR + NSTypedFilenamesPboardType:FAX + NSTypedFilenamesPboardType:FFF + NSTypedFilenamesPboardType:FPIX + NSTypedFilenamesPboardType:FPX + NSTypedFilenamesPboardType:G3 + NSTypedFilenamesPboardType:GIF + NSTypedFilenamesPboardType:HDR + NSTypedFilenamesPboardType:ICNS + NSTypedFilenamesPboardType:ICO + NSTypedFilenamesPboardType:JFAX + NSTypedFilenamesPboardType:JFX + NSTypedFilenamesPboardType:JP2 + NSTypedFilenamesPboardType:JPE + NSTypedFilenamesPboardType:JPEG + NSTypedFilenamesPboardType:JPF + NSTypedFilenamesPboardType:JPG + NSTypedFilenamesPboardType:MAC + NSTypedFilenamesPboardType:MOS + NSTypedFilenamesPboardType:MRW + NSTypedFilenamesPboardType:NEF + NSTypedFilenamesPboardType:NRW + NSTypedFilenamesPboardType:ORF + NSTypedFilenamesPboardType:PCT + NSTypedFilenamesPboardType:PDF + NSTypedFilenamesPboardType:PEF + NSTypedFilenamesPboardType:PIC + NSTypedFilenamesPboardType:PICT + NSTypedFilenamesPboardType:PNG + NSTypedFilenamesPboardType:PNT + NSTypedFilenamesPboardType:PNTG + NSTypedFilenamesPboardType:PS + NSTypedFilenamesPboardType:PSD + NSTypedFilenamesPboardType:PWL + NSTypedFilenamesPboardType:QTI + NSTypedFilenamesPboardType:QTIF + NSTypedFilenamesPboardType:RAF + NSTypedFilenamesPboardType:RAW + NSTypedFilenamesPboardType:RGB + NSTypedFilenamesPboardType:RW2 + NSTypedFilenamesPboardType:RWL + NSTypedFilenamesPboardType:SGI + NSTypedFilenamesPboardType:SR2 + NSTypedFilenamesPboardType:SRF + NSTypedFilenamesPboardType:TARGA + NSTypedFilenamesPboardType:TGA + NSTypedFilenamesPboardType:TIF + NSTypedFilenamesPboardType:TIFF + NSTypedFilenamesPboardType:XBM + NSTypedFilenamesPboardType:arw + NSTypedFilenamesPboardType:bmp + NSTypedFilenamesPboardType:cr2 + NSTypedFilenamesPboardType:crw + NSTypedFilenamesPboardType:cur + NSTypedFilenamesPboardType:dcr + NSTypedFilenamesPboardType:dng + NSTypedFilenamesPboardType:efx + NSTypedFilenamesPboardType:epi + NSTypedFilenamesPboardType:eps + NSTypedFilenamesPboardType:epsf + NSTypedFilenamesPboardType:epsi + NSTypedFilenamesPboardType:erf + NSTypedFilenamesPboardType:exr + NSTypedFilenamesPboardType:fax + NSTypedFilenamesPboardType:fff + NSTypedFilenamesPboardType:fpix + NSTypedFilenamesPboardType:fpx + NSTypedFilenamesPboardType:g3 + NSTypedFilenamesPboardType:gif + NSTypedFilenamesPboardType:hdr + NSTypedFilenamesPboardType:icns + NSTypedFilenamesPboardType:ico + NSTypedFilenamesPboardType:jfax + NSTypedFilenamesPboardType:jfx + NSTypedFilenamesPboardType:jp2 + NSTypedFilenamesPboardType:jpe + NSTypedFilenamesPboardType:jpeg + NSTypedFilenamesPboardType:jpf + NSTypedFilenamesPboardType:jpg + NSTypedFilenamesPboardType:mac + NSTypedFilenamesPboardType:mos + NSTypedFilenamesPboardType:mrw + NSTypedFilenamesPboardType:nef + NSTypedFilenamesPboardType:nrw + NSTypedFilenamesPboardType:orf + NSTypedFilenamesPboardType:pct + NSTypedFilenamesPboardType:pdf + NSTypedFilenamesPboardType:pef + NSTypedFilenamesPboardType:pic + NSTypedFilenamesPboardType:pict + NSTypedFilenamesPboardType:png + NSTypedFilenamesPboardType:pnt + NSTypedFilenamesPboardType:pntg + NSTypedFilenamesPboardType:ps + NSTypedFilenamesPboardType:psd + NSTypedFilenamesPboardType:pwl + NSTypedFilenamesPboardType:qti + NSTypedFilenamesPboardType:qtif + NSTypedFilenamesPboardType:raf + NSTypedFilenamesPboardType:raw + NSTypedFilenamesPboardType:rgb + NSTypedFilenamesPboardType:rw2 + NSTypedFilenamesPboardType:rwl + NSTypedFilenamesPboardType:sgi + NSTypedFilenamesPboardType:sr2 + 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 + + {423, 251} + + NO + YES + YES + YES + YES + NO + NO + YES + 100 + 100 + + + + + {{1, 1}, {423, 251}} + + + + + 6 + + + + 256 + {{424, 1}, {15, 251}} + + + _doScroller: + 1 + 0.96363627910614014 + + + + 256 + {{1, 252}, {423, 15}} + + 1 + + _doScroller: + 0.50602412223815918 + + + {{20, 60}, {440, 268}} + + + 50 + + + + QSAAAEEgAABCzQAAQvAAAA + + + {480, 327} + + + {{0, 0}, {1920, 1178}} + {1.79769e+308, 1.79769e+308} + + + + + + + settingsView + + + + 102 + + + + galleryCombo + + + + 120 + + + + mNewGalleryButton + + + + 123 + + + + mServersPopUp + + + + 124 + + + + spinner + + + + 125 + + + + statusLabel + + + + 126 + + + + defaultImageView + + + + 127 + + + + mServerSheetHostURL + + + + 179 + + + + mServerSheetPassword + + + + 180 + + + + mServerSheetServerNickName + + + + 181 + + + + mServerSheetUsername + + + + 182 + + + + newServerSheet + + + + 183 + + + + serverListPanel + + + + 184 + + + + serverTable + + + + 185 + + + + doAddServer: + + + + 224 + + + + doCancelAddServer: + + + + 225 + + + + clickViewGallery: + + + + 228 + + + + closeServerList: + + + + 229 + + + + removeServer: + + + + 230 + + + + clickServer: + + + + 231 + + + + viewGallery + + + + 269 + + + + showNewGallery: + + + + 270 + + + + mviewGallerySheet + + + + 271 + + + + closeGalleryView + + + + 335 + + + + closeGalleryView: + + + + 336 + + + + dataSource + + + + 337 + + + + browserView + + + + 339 + + + + dataSource + + + + 373 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 61 + + + + + + Settings View + + + 62 + + + + + + + + 128 + + + + + + Panel (Add Server) + + + 129 + + + + + + + + + + + + + + + + + 131 + + + + + + + + 132 + + + + + + + + 133 + + + + + + + + 134 + + + + + + + + 135 + + + + + + + + 136 + + + + + + + + 137 + + + + + + + + 138 + + + + + + + + 139 + + + + + + + + 140 + + + + + + + + 152 + + + + + + Panel (Servers) + + + 153 + + + + + + + + + + 155 + + + + + + + + 156 + + + + + + + + 157 + + + + + + + + + + + 159 + + + + + + + + + + 162 + + + + + + + + 167 + + + + + 163 + + + + + + + + 166 + + + + + 164 + + + + + + + + 165 + + + + + 171 + + + + + + GalleryView + + + 172 + + + + + + + + + 173 + + + + + + + + + + 176 + + + + + 174 + + + + + + + + 385 + + + + + 386 + + + + + 387 + + + + + 388 + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 396 + + + + + 397 + + + + + 398 + + + + + 399 + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 63 + + + + + + + + + + + + + + + + + + 93 + + + + + + + + 382 + + + + + 94 + + + + + + + + 383 + + + + + + + + 96 + + + + + + + + 97 + + + + + 91 + + + + + + + + 380 + + + + + 90 + + + + + 92 + + + + + + + + 381 + + + + + 66 + + + + + + + + 375 + + + + + 72 + + + + + + + + 378 + + + + + 71 + + + + + + + + 377 + + + + + 70 + + + + + + + + 376 + + + + + 73 + + + + + + + + 379 + + + + + 303 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + {{63, 887}, {455, 195}} + com.apple.InterfaceBuilder.CocoaPlugin + {{63, 887}, {455, 195}} + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{531, 793}, {679, 358}} + com.apple.InterfaceBuilder.CocoaPlugin + {{531, 793}, {679, 358}} + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{531, 801}, {480, 327}} + com.apple.InterfaceBuilder.CocoaPlugin + {{531, 801}, {480, 327}} + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.imagekit.ibplugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + {{531, 790}, {528, 309}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + 403 + + + + + ApertureToAnselExportPlugin + NSObject + + id + id + id + id + id + id + id + id + + + IKImageBrowserView + NSButton + NSImageView + NSView + NSComboBox + NSView + NSButton + NSButton + NSTextField + NSSecureTextField + NSTextField + NSTextField + NSPopUpButton + NSWindow + NSWindow + NSPanel + NSTableView + NSView + NSProgressIndicator + NSTextField + NSButton + + + IBProjectSource + ApertureToAnselExportPlugin.h + + + + ApertureToAnselExportPlugin + NSObject + + clickCancelConnect: + id + + + anselController + id + + + IBUserSource + + + + + FirstResponder + + IBUserSource + + + + + NSObject + + IBProjectSource + TURAnsel.h + + + + NSObject + + IBProjectSource + TURAnselGallery.h + + + + NSObject + + IBProjectSource + TURAnselGalleryPanelController.h + + + + NSObject + + IBUserSource + + + + + + + IKImageBrowserView + NSView + + id + id + id + NSScroller + NSScroller + + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSComboBox + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSComboBox.h + + + + NSComboBoxCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSComboBoxCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSImageCell.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKSaveOptions.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + PluginManager.framework/Headers/PROAPIAccessing.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + + + NSObject + + IBFrameworkSource + QuickLookUI.framework/Headers/QLPreviewPanel.h + + + + NSPanel + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSPanel.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSecureTextField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSecureTextField.h + + + + NSSecureTextFieldCell + NSTextFieldCell + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + ../ApertureToAnselExportPlugin.xcodeproj + 3 + + diff --git a/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/info.nib b/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/info.nib deleted file mode 100644 index 35717405d..000000000 --- a/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/info.nib +++ /dev/null @@ -1,22 +0,0 @@ - - - - - IBFramework Version - 672 - IBLastKnownRelativeProjectPath - ../ApertureToAnselExportPlugin.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 157 - 176 - 63 - - IBSystem Version - 9L30 - targetFramework - IBCocoaFramework - - diff --git a/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/keyedobjects.nib b/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/keyedobjects.nib index 2a54fd6f3..a8efc7814 100644 Binary files a/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/keyedobjects.nib and b/ApertureToAnselExportPlugin/English.lproj/ApertureToAnselExportPlugin.nib/keyedobjects.nib differ diff --git a/ApertureToAnselExportPlugin/TURAnsel.h b/ApertureToAnselExportPlugin/TURAnsel.h index df949c321..b1997fa43 100644 --- a/ApertureToAnselExportPlugin/TURAnsel.h +++ b/ApertureToAnselExportPlugin/TURAnsel.h @@ -1,10 +1,11 @@ -// -// TURAnsel.h -// myXMLTest -// -// Created by Michael Rubinsky on 10/31/08. -// Copyright 2008 __MyCompanyName__. All rights reserved. -// +/** + * TURAnsel + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import @class TURAnselGallery; diff --git a/ApertureToAnselExportPlugin/TURAnsel.m b/ApertureToAnselExportPlugin/TURAnsel.m index 75373ecdb..56ad2f77d 100644 --- a/ApertureToAnselExportPlugin/TURAnsel.m +++ b/ApertureToAnselExportPlugin/TURAnsel.m @@ -1,14 +1,15 @@ -// -// TURAnsel.m -// AnselCocoaToolkit -// -// Created by Michael Rubinsky on 10/31/08. -// Copyright 2008 Michael Rubinsky -// - +/** + * TURAnsel.m + * + * Main class for interacting with a remote Ansel server. + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import -#import "TURAnsel.h" -#import "TURAnselGallery.h" +#import "TURAnselKit.h" @interface TURAnsel (PrivateAPI) - (void)doLogin; @@ -21,7 +22,7 @@ @synthesize password; #pragma mark - -#pragma mark init +#pragma mark init/dealloc - (id)initWithConnectionParameters: (NSDictionary *)params { [super init]; @@ -50,14 +51,13 @@ [userAgent release]; [super dealloc]; } + #pragma mark - #pragma mark Actions - - (void)connect { [self doLogin]; } - - (void) cancel { state = TURAnselStateCancelled; @@ -73,21 +73,21 @@ - (NSDictionary *)createNewGallery: (NSDictionary *)params { NSArray *apiparams = [NSArray arrayWithObjects: @"ansel", params, nil]; - NSArray *order = [NSArray arrayWithObjects:@"scope", @"galleryparams", nil]; + NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope, kTURAnselAPIParamGaleryParams, nil]; NSDictionary *response = [self callRPCMethod: @"images.createGallery" withParams: apiparams withOrder: order]; if (response) { - NSNumber *gallery_id = [response objectForKey: (NSString *)kWSMethodInvocationResult]; NSDictionary *results = [NSDictionary dictionaryWithObjectsAndKeys: - gallery_id, @"share_id", - [params valueForKey: @"name"], @"attribute_name", - @"", @"attribute_desc", - [NSNumber numberWithInt: 0], @"attribute_images", - [NSNumber numberWithInt: 0], @"attribute_default", nil]; + gallery_id, kTURAnselGalleryKeyId, + [params valueForKey: @"name"], kTURAnselGalleryKeyName, + @"", kTURAnselGalleryKeyDescription, + [NSNumber numberWithInt: 0], kTURAnselGalleryKeyImages, + [NSNumber numberWithInt: 0], kTURAnselGalleryKeyDefaultImage, nil]; + TURAnselGallery *newGallery = [[TURAnselGallery alloc] initWithObject: results controller: self]; [galleryList addObject: newGallery]; @@ -166,17 +166,30 @@ CFRelease(request); // Check out the results if (WSMethodResultIsFault((CFDictionaryRef) result)) { - NSNumber *faultCode = [result objectForKey: (NSString *)kWSFaultCode]; - NSString *faultString = [result objectForKey: (NSString *)kWSFaultString]; - NSLog(@"faultCode: %@ faultString: %@", faultCode, faultString); - if ([[self delegate] respondsToSelector: @selector(TURAnselHadError:)]) { - NSError *error = [NSError errorWithDomain:@"TURAnsel" - code:[faultCode intValue] - userInfo:[NSDictionary dictionaryWithObjectsAndKeys: faultString, @"message", nil]]; + NSError *error; + + CFHTTPMessageRef response = (CFHTTPMessageRef)[result objectForKey:(id)kWSHTTPResponseMessage]; + int resStatusCode = CFHTTPMessageGetResponseStatusCode(response); + NSString *resStatusLine = (NSString *)CFHTTPMessageCopyResponseStatusLine(response); + if (resStatusCode == 401) { + error = [NSError errorWithDomain: @"TURAnsel" + code: resStatusCode + userInfo: [NSDictionary dictionaryWithObjectsAndKeys: resStatusLine, @"NSLocalizedDescriptionKey", nil]]; + } else { + NSNumber *faultCode = [result objectForKey: (NSString *)kWSFaultCode]; + NSString *faultString = [result objectForKey: (NSString *)kWSFaultString]; + NSLog(@"faultCode: %@ faultString: %@", faultCode, faultString); + error = [NSError errorWithDomain: @"TURAnsel" + code: [faultCode intValue] + userInfo: [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat: @"%@, %@", resStatusLine, faultString], @"NSLocalizedDescriptionKey", nil]]; + - [[self delegate] TURAnselHadError:error]; + } + if ([[self delegate] respondsToSelector: @selector(TURAnselHadError:)]) { + [[self delegate] TURAnselHadError: error]; } + [resStatusLine release]; [result autorelease]; return nil; } @@ -269,7 +282,11 @@ [NSNumber numberWithInt: 0], // Count [self valueForKey:@"username"], nil]; // Restrict to user (This should be an option eventually). - NSArray *order = [NSArray arrayWithObjects: @"scope", @"perms", @"parent", @"levels", @"offset", @"count", @"useronly", nil]; + NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope, kTURAnselAPIParamPerms, + kTURAnselAPIParamParent, kTURAnselAPIParamAllLevels, + kTURAnselAPIParamOffset, kTURAnselAPIParamCount, + kTURAnselAPIParamUserOnly, nil]; + NSDictionary *results = [self callRPCMethod: @"images.listGalleries" withParams: params withOrder: order]; @@ -295,5 +312,4 @@ [params release]; } - -@end +@end \ No newline at end of file diff --git a/ApertureToAnselExportPlugin/TURAnselConstants.h b/ApertureToAnselExportPlugin/TURAnselConstants.h new file mode 100644 index 000000000..ef64dc77a --- /dev/null +++ b/ApertureToAnselExportPlugin/TURAnselConstants.h @@ -0,0 +1,33 @@ +/** + * TURAnselConstants + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ + +// Constants for the API parameter names. +extern NSString * const kTURAnselAPIParamScope; +extern NSString * const kTURAnselAPIParamGaleryParams; +extern NSString * const kTURAnselAPIParamPerms; +extern NSString * const kTURAnselAPIParamParent; +extern NSString * const kTURAnselAPIParamAllLevels; +extern NSString * const kTURAnselAPIParamOffset; +extern NSString * const kTURAnselAPIParamCount; +extern NSString * const kTURAnselAPIParamUserOnly; +extern NSString * const kTURAnselAPIParamImageId; +extern NSString * const kTURAnselAPIParamGalleryId; +extern NSString * const kTURAnselAPIParamThumbnailStyle; +extern NSString * const kTURAnselAPIParamFullPath; +extern NSString * const kTURAnselAPIParamImageData; +extern NSString * const kTURAnselAPIParamSetAsDefault; +extern NSString * const kTURAnselAPIParamAdditionalData; +extern NSString * const kTURAnselAPIParamEncoding; + +// Constants for the dictionary keys used to describe/create TURAnselGallery +extern NSString * const kTURAnselGalleryKeyId; +extern NSString * const kTURAnselGalleryKeyName; +extern NSString * const kTURAnselGalleryKeyDescription; +extern NSString * const kTURAnselGalleryKeyImages; +extern NSString * const kTURAnselGalleryKeyDefaultImage; diff --git a/ApertureToAnselExportPlugin/TURAnselConstants.m b/ApertureToAnselExportPlugin/TURAnselConstants.m new file mode 100644 index 000000000..74472bb5f --- /dev/null +++ b/ApertureToAnselExportPlugin/TURAnselConstants.m @@ -0,0 +1,34 @@ +// +// TURAnselConstants.m +// ApertureToAnselExportPlugin +// +// Created by Michael Rubinsky on 9/22/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "TURAnselConstants.h" + +// Constants for the API parameter names. +NSString * const kTURAnselAPIParamScope = @"scope"; +NSString * const kTURAnselAPIParamGaleryParams = @"galleryParams"; +NSString * const kTURAnselAPIParamPerms = @"perms"; +NSString * const kTURAnselAPIParamParent = @"parent"; +NSString * const kTURAnselAPIParamAllLevels = @"allLevels"; +NSString * const kTURAnselAPIParamOffset = @"offset"; +NSString * const kTURAnselAPIParamCount = @"count"; +NSString * const kTURAnselAPIParamUserOnly = @"userOnly"; +NSString * const kTURAnselAPIParamImageId = @"imageId"; +NSString * const kTURAnselAPIParamGalleryId = @"galleryId"; +NSString * const kTURAnselAPIParamThumbnailStyle = @"thumbnailStyle"; +NSString * const kTURAnselAPIParamFullPath = @"fullPath"; +NSString * const kTURAnselAPIParamImageData = @"imageData"; +NSString * const kTURAnselAPIParamSetAsDefault = @"default"; +NSString * const kTURAnselAPIParamAdditionalData = @"additionalData"; +NSString * const kTURAnselAPIParamEncoding = @"encoding"; + +// Ansel gallery attribtues. +NSString * const kTURAnselGalleryKeyId = @"share_id"; +NSString * const kTURAnselGalleryKeyName = @"attribute_name"; +NSString * const kTURAnselGalleryKeyDescription = @"attribute_desc"; +NSString * const kTURAnselGalleryKeyImages = @"attribute_images"; +NSString * const kTURAnselGalleryKeyDefaultImage = @"attribute_default"; \ No newline at end of file diff --git a/ApertureToAnselExportPlugin/TURAnselGallery.h b/ApertureToAnselExportPlugin/TURAnselGallery.h index 7c6933b9b..5eff4e79b 100644 --- a/ApertureToAnselExportPlugin/TURAnselGallery.h +++ b/ApertureToAnselExportPlugin/TURAnselGallery.h @@ -1,19 +1,13 @@ -// -// TURAnselGallery.h -// -// Class to wrap Ansel Gallery. -// -// Created by Michael Rubinsky on 10/21/08. -// Copyright 2008 __MyCompanyName__. All rights reserved. -// - +/** + * TURAnselGallery + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import -@class TURAnsel, NSURL, XMLRPCResponse; - -typedef enum { - TURAnselGalleryStateReady = 0, - TURAnselGalleryStateBusy -} TURAnselGalleryState; +@class TURAnsel, NSURL; @interface NSObject (TURAnselGalleryDelegate) - (void)TURAnselGalleryDidUploadImage: (id *)gallery; @@ -28,7 +22,6 @@ typedef enum { NSString *galleryName; NSString *galleryDescription; TURAnsel *anselController; - TURAnselGalleryState state; id delegate; } @property (readonly) NSString *galleryName; @@ -45,7 +38,5 @@ typedef enum { - (NSURL *)galleryKeyImageURL; - (id)listImages; - (int)galleryId; -- (TURAnselGalleryState) state; -- (void)setState: (TURAnselGalleryState)theState; - (void)setAnselController:(TURAnsel *)newController; @end \ No newline at end of file diff --git a/ApertureToAnselExportPlugin/TURAnselGallery.m b/ApertureToAnselExportPlugin/TURAnselGallery.m index cd3c87350..9397b107d 100644 --- a/ApertureToAnselExportPlugin/TURAnselGallery.m +++ b/ApertureToAnselExportPlugin/TURAnselGallery.m @@ -1,13 +1,13 @@ -// -// TURAnselGallery.m -// Class wraps an Ansel Gallery -// -// Created by Michael Rubinsky on 10/21/08. -// Copyright 2008 __MyCompanyName__. All rights reserved. -// +/** + * TURAnselGallery.m + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import -#import "TURAnsel.h" -#import "TURAnselGallery.h" +#import "TURAnselKit.h" @interface TURAnselGallery (PrivateAPI) - (void)doUpload: (NSDictionary *)imageParams; @@ -21,28 +21,26 @@ @synthesize galleryKeyImage; #pragma mark - -#pragma mark init - +#pragma mark init/dealloc /** * Init a gallery object */ - (id)initWithObject:(id)galleryData controller:(TURAnsel *)controller { [super init]; - [self setValue: [galleryData valueForKey:@"share_id"] + [self setValue: [galleryData valueForKey: kTURAnselGalleryKeyId] forKey: @"galleryId"]; - [self setValue:[galleryData valueForKey:@"attribute_desc"] + [self setValue:[galleryData valueForKey: kTURAnselGalleryKeyDescription] forKey:@"galleryDescription"]; - [self setValue:[galleryData valueForKey:@"attribute_name"] + [self setValue:[galleryData valueForKey: kTURAnselGalleryKeyName] forKey:@"galleryName"]; - [self setValue: [galleryData valueForKey:@"attribute_images"] + [self setValue: [galleryData valueForKey: kTURAnselGalleryKeyImages] forKey:@"galleryImageCount"]; - [self setValue: [galleryData valueForKey:@"attribute_default"] + [self setValue: [galleryData valueForKey: kTURAnselGalleryKeyDefaultImage] forKey:@"galleryKeyImage"]; [self setAnselController: controller]; return self; } - - (void)dealloc { NSLog(@"TURAnselGallery dealloc called on Gallery %@", self); @@ -81,7 +79,12 @@ @"thumb", // Thumbnail type [NSNumber numberWithBool:YES], // Full path nil]; - NSArray *order = [NSArray arrayWithObjects: @"scope", @"image_id", @"thumbnail", @"path", nil]; + + NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope, + kTURAnselAPIParamImageId, + kTURAnselAPIParamThumbnailStyle, + kTURAnselAPIParamFullPath, nil]; + NSDictionary *response = [anselController callRPCMethod: @"images.getImageUrl" withParams: params withOrder: order]; @@ -96,7 +99,6 @@ return nil; } - } /** @@ -113,7 +115,12 @@ @"thumb", // Thumbnail [NSNumber numberWithBool:YES], // Full path nil]; - NSArray *order = [NSArray arrayWithObjects: @"scope", @"gallery_id", @"perms", @"thumnail", @"path", nil]; + NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope, + kTURAnselAPIParamGalleryId, + kTURAnselAPIParamPerms, + kTURAnselAPIParamThumbnailStyle, + kTURAnselAPIParamFullPath, nil]; + NSDictionary *response = [anselController callRPCMethod: @"images.listImages" withParams: params withOrder: order]; @@ -144,6 +151,7 @@ { return _galleryId; } + - (void)setGalleryId:(int)id { _galleryId = id; @@ -153,20 +161,12 @@ { return delegate; } + - (void)setDelegate: (id)newDelegate { delegate = newDelegate; } -- (TURAnselGalleryState)state -{ - return state; -} -- (void)setState: (TURAnselGalleryState)theState -{ - state = theState; -} - - (void)setAnselController: (TURAnsel *)newController { [anselController autorelease]; @@ -191,7 +191,12 @@ @"", // Additional gallery data to set? @"base64", // Image data encoding nil]; - NSArray *order = [NSArray arrayWithObjects: @"scope", @"gallery_id", @"data", @"default", @"additional_data", @"encoding", nil]; + NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope, + kTURAnselAPIParamGalleryId, + kTURAnselAPIParamImageData, + kTURAnselAPIParamSetAsDefault, + kTURAnselAPIParamAdditionalData, + kTURAnselAPIParamEncoding, nil]; // Send the request up to the controller NSDictionary *result = [anselController callRPCMethod: @"images.saveImage" diff --git a/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.h b/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.h index 9e2f612b2..b0a8f2e66 100644 --- a/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.h +++ b/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.h @@ -1,13 +1,13 @@ -// -// TURAnselGalleryPanelController.h -// iPhoto2Ansel -// -// Created by Michael Rubinsky on 12/7/08. -// Copyright 2008 __MyCompanyName__. All rights reserved. -// - +/** + * TURAnselGalleryPanelController + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import -#import "TURAnsel.h" +#import "TURAnselKit.h" @interface NSObject (TURAnselGalleryPaneControllerDelegate) -(void)TURAnselGalleryPanelDidAddGallery; @@ -20,9 +20,10 @@ IBOutlet NSTextField *galleryDescTextField; IBOutlet NSPanel *newGallerySheet; - TURAnsel *anselController; - NSWindow *controllerWindow; - id delegate; + // Instance members + TURAnsel *_anselController; + NSWindow *_controllerWindow; + id _delegate; } // Actions diff --git a/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.m b/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.m index baff799ba..09aa6c5ae 100644 --- a/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.m +++ b/ApertureToAnselExportPlugin/TURAnselGalleryPanelController.m @@ -1,15 +1,49 @@ -// -// TURAnselGalleryPanelController.m -// iPhoto2Ansel -// -// Created by Michael Rubinsky on 12/7/08. -// Copyright 2008 __MyCompanyName__. All rights reserved. -// - +/** + * TURAnselGalleryPanelController.m + * + * Controller for handling the form that creates new remote Ansel galleries. + * + * Copyright 2009 The Horde Project (http://www.horde.org) + * + * @license http://opensource.org/licenses/bsd-license.php + * @author Michael J. Rubinsky + */ #import "TURAnselGalleryPanelController.h" @implementation TURAnselGalleryPanelController +#pragma mark - +#pragma mark init/dealloc +-(id)initWithController: (TURAnsel *)theController +{ + [super init]; + _anselController = [theController retain]; + [NSBundle loadNibNamed: @"AnselGalleryPanel" + owner: self]; + + return self; +} +- (id)initWithController: (TURAnsel *)theController + withGalleryName: (NSString *)galleryName +{ + + [super init]; + _anselController = [theController retain]; + [NSBundle loadNibNamed: @"AnselGalleryPanel" + owner: self]; + + [galleryNameTextField setStringValue: galleryName]; + + return self; +} +- (void)dealloc +{ + [_anselController release]; + [_controllerWindow release]; + [super dealloc]; +} + +#pragma mark - #pragma mark IBActions - (IBAction)cancelNewGallery: (id)sender { @@ -32,7 +66,7 @@ NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:@"Gallery names cannot be empty"]; [alert setAlertStyle: NSCriticalAlertStyle]; - [alert beginSheetModalForWindow: controllerWindow + [alert beginSheetModalForWindow: _controllerWindow modalDelegate: nil didEndSelector: nil contextInfo: nil]; @@ -44,63 +78,38 @@ gallerySlug, @"slug", galleryDescription, @"desc", nil]; - NSDictionary *results = [[anselController createNewGallery: params] retain]; + NSDictionary *results = [[_anselController createNewGallery: params] retain]; [NSApp endSheet: newGallerySheet]; [newGallerySheet orderOut: nil]; - if ([anselController state] != TURAnselStateError) { + if ([_anselController state] != TURAnselStateError) { NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText: @"Gallery successfully created."]; - [alert beginSheetModalForWindow: controllerWindow + [alert beginSheetModalForWindow: _controllerWindow modalDelegate: nil didEndSelector: nil contextInfo: nil]; [alert release]; - if ([delegate respondsToSelector:@selector(TURAnselGalleryPanelDidAddGallery)]) { - [delegate TURAnselGalleryPanelDidAddGallery]; + if ([_delegate respondsToSelector:@selector(TURAnselGalleryPanelDidAddGallery)]) { + [_delegate TURAnselGalleryPanelDidAddGallery]; } } [results release]; } --(id)initWithController: (TURAnsel *)theController -{ - [super init]; - anselController = [theController retain]; - [NSBundle loadNibNamed: @"AnselGalleryPanel" - owner: self]; - - return self; -} - -- (id)initWithController: (TURAnsel *)theController - withGalleryName: (NSString *)galleryName -{ - - [super init]; - anselController = [theController retain]; - [NSBundle loadNibNamed: @"AnselGalleryPanel" - owner: self]; - - [galleryNameTextField setStringValue: galleryName]; - - return self; - - -} - (void)setDelegate: (id)theDelegate { - delegate = theDelegate; // weak + _delegate = theDelegate; // weak } - (void)showSheetForWindow: (NSWindow *)theWindow { - [controllerWindow release]; - controllerWindow = [theWindow retain]; + [_controllerWindow release]; + _controllerWindow = [theWindow retain]; [NSApp beginSheet: newGallerySheet modalForWindow: theWindow modalDelegate: nil @@ -108,11 +117,4 @@ contextInfo: nil]; } -- (void)dealloc -{ - [anselController release]; - [controllerWindow release]; - [super dealloc]; -} - @end diff --git a/ApertureToAnselExportPlugin/TURAnselKit.h b/ApertureToAnselExportPlugin/TURAnselKit.h new file mode 100644 index 000000000..7a4277a8a --- /dev/null +++ b/ApertureToAnselExportPlugin/TURAnselKit.h @@ -0,0 +1,4 @@ +#import "TURAnselConstants.h" +#import "TURAnsel.h" +#import "TURAnselGallery.h" +