From: Miltiadis Vasilakis Date: Tue, 20 Sep 2011 19:35:45 +0000 (+0300) Subject: Refactored PithosNodeInfoController. X-Git-Tag: v0.1~58 X-Git-Url: https://code.grnet.gr/git/pithos-macos/commitdiff_plain/515cd8db442f1c8b64deb759995bba630cad447b Refactored PithosNodeInfoController. Added content encoding, content disposition and manifest in info window. Added info window for containers. --- diff --git a/Icons/container.png b/Icons/container.png deleted file mode 100644 index dcf8dc4..0000000 Binary files a/Icons/container.png and /dev/null differ diff --git a/pithos-apple-common b/pithos-apple-common index 3417879..ff26300 160000 --- a/pithos-apple-common +++ b/pithos-apple-common @@ -1 +1 @@ -Subproject commit 3417879291127d5a882740b6b5ca209576568ee8 +Subproject commit ff263008abe73d3f2ad02b4c7886c52115ab9451 diff --git a/pithos-macos.xcodeproj/project.pbxproj b/pithos-macos.xcodeproj/project.pbxproj index 51c3428..de84be8 100644 --- a/pithos-macos.xcodeproj/project.pbxproj +++ b/pithos-macos.xcodeproj/project.pbxproj @@ -36,7 +36,8 @@ 610DD37213E7059900ED982F /* PithosObjectNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 610DD37113E7059900ED982F /* PithosObjectNode.m */; }; 610DD37513E7064F00ED982F /* PithosSubdirNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 610DD37413E7064F00ED982F /* PithosSubdirNode.m */; }; 610DD46313E950E600ED982F /* 01-refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = 610DD46213E950E600ED982F /* 01-refresh.png */; }; - 610DD49D13EAE03400ED982F /* container.png in Resources */ = {isa = PBXBuildFile; fileRef = 610DD49A13EAE03300ED982F /* container.png */; }; + 611405D01428BEC000637170 /* PithosContainerNodeInfoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 611405CE1428BEBE00637170 /* PithosContainerNodeInfoController.m */; }; + 611405D11428BEC000637170 /* PithosContainerNodeInfoController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 611405CF1428BEC000637170 /* PithosContainerNodeInfoController.xib */; }; 611FFCAF13EBF0B900E43E18 /* PithosEmptyNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 611FFCAE13EBF0B900E43E18 /* PithosEmptyNode.m */; }; 611FFCB313EBF40900E43E18 /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 611FFCB213EBF40900E43E18 /* ImageAndTextCell.m */; }; 6121250913F033F500063041 /* PithosBrowserPreviewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6121250813F033F400063041 /* PithosBrowserPreviewController.xib */; }; @@ -46,7 +47,7 @@ 615615DD140CECDB00017BD4 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 615615DC140CECDB00017BD4 /* libz.dylib */; }; 615A444E140F8A5700308614 /* MetadataKeyTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 615A444D140F8A5700308614 /* MetadataKeyTransformer.m */; }; 615A4451140F8A7F00308614 /* MetadataKeyFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 615A4450140F8A7F00308614 /* MetadataKeyFormatter.m */; }; - 616FC0AF13F91BA400140A33 /* PithosNodeInfoController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 616FC0AE13F91BA400140A33 /* PithosNodeInfoController.xib */; }; + 616FC0AF13F91BA400140A33 /* PithosObjectNodeInfoController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 616FC0AE13F91BA400140A33 /* PithosObjectNodeInfoController.xib */; }; 616FC0B313F97D0800140A33 /* PithosNodeInfoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616FC0B213F97D0800140A33 /* PithosNodeInfoController.m */; }; 617460F1140BE45C00D333A1 /* BytesExtendedSizeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 617460F0140BE45C00D333A1 /* BytesExtendedSizeTransformer.m */; }; 6180C22B13FAEF4B00BCA40B /* BytesSizeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6180C22A13FAEF4B00BCA40B /* BytesSizeTransformer.m */; }; @@ -57,6 +58,9 @@ 61C24BBE1410E031007004DC /* SharingDictionaryTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C24BBD1410E031007004DC /* SharingDictionaryTransformer.m */; }; 61C24BC114110BDB007004DC /* SharingNameFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C24BC014110BDB007004DC /* SharingNameFormatter.m */; }; 61C24BEC14161EC7007004DC /* PithosFileUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C24BEB14161EC3007004DC /* PithosFileUtilities.m */; }; + 61C65ADF1428C578002597C2 /* CountTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C65ADE1428C578002597C2 /* CountTransformer.m */; }; + 61C65AE31428D41C002597C2 /* PolicyVersioningTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C65AE21428D41C002597C2 /* PolicyVersioningTransformer.m */; }; + 61C65AE6142918DD002597C2 /* PithosObjectNodeInfoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C65AE5142918DD002597C2 /* PithosObjectNodeInfoController.m */; }; 61E99D9413EC348500E48DA5 /* 145-persondot.png in Resources */ = {isa = PBXBuildFile; fileRef = 61E99D9313EC348500E48DA5 /* 145-persondot.png */; }; /* End PBXBuildFile section */ @@ -121,7 +125,9 @@ 610DD37313E7064E00ED982F /* PithosSubdirNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosSubdirNode.h; sourceTree = ""; }; 610DD37413E7064F00ED982F /* PithosSubdirNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosSubdirNode.m; sourceTree = ""; }; 610DD46213E950E600ED982F /* 01-refresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "01-refresh.png"; sourceTree = ""; }; - 610DD49A13EAE03300ED982F /* container.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = container.png; sourceTree = ""; }; + 611405CD1428BEBD00637170 /* PithosContainerNodeInfoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosContainerNodeInfoController.h; sourceTree = ""; }; + 611405CE1428BEBE00637170 /* PithosContainerNodeInfoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosContainerNodeInfoController.m; sourceTree = ""; }; + 611405CF1428BEC000637170 /* PithosContainerNodeInfoController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PithosContainerNodeInfoController.xib; sourceTree = ""; }; 611FFCAD13EBF0B800E43E18 /* PithosEmptyNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosEmptyNode.h; sourceTree = ""; }; 611FFCAE13EBF0B900E43E18 /* PithosEmptyNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosEmptyNode.m; sourceTree = ""; }; 611FFCB113EBF40900E43E18 /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageAndTextCell.h; path = "pithos-macos/ImageAndTextCell.h"; sourceTree = ""; }; @@ -138,7 +144,7 @@ 615A444D140F8A5700308614 /* MetadataKeyTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MetadataKeyTransformer.m; path = "pithos-macos/MetadataKeyTransformer.m"; sourceTree = ""; }; 615A444F140F8A7F00308614 /* MetadataKeyFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MetadataKeyFormatter.h; path = "pithos-macos/MetadataKeyFormatter.h"; sourceTree = ""; }; 615A4450140F8A7F00308614 /* MetadataKeyFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MetadataKeyFormatter.m; path = "pithos-macos/MetadataKeyFormatter.m"; sourceTree = ""; }; - 616FC0AE13F91BA400140A33 /* PithosNodeInfoController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PithosNodeInfoController.xib; sourceTree = ""; }; + 616FC0AE13F91BA400140A33 /* PithosObjectNodeInfoController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PithosObjectNodeInfoController.xib; sourceTree = ""; }; 616FC0B113F97D0800140A33 /* PithosNodeInfoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosNodeInfoController.h; sourceTree = ""; }; 616FC0B213F97D0800140A33 /* PithosNodeInfoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosNodeInfoController.m; sourceTree = ""; }; 617460EF140BE45C00D333A1 /* BytesExtendedSizeTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BytesExtendedSizeTransformer.h; path = "pithos-macos/BytesExtendedSizeTransformer.h"; sourceTree = ""; }; @@ -158,6 +164,12 @@ 61C24BC014110BDB007004DC /* SharingNameFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SharingNameFormatter.m; path = "pithos-macos/SharingNameFormatter.m"; sourceTree = ""; }; 61C24BEA14161EC0007004DC /* PithosFileUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosFileUtilities.h; sourceTree = ""; }; 61C24BEB14161EC3007004DC /* PithosFileUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosFileUtilities.m; sourceTree = ""; }; + 61C65ADD1428C578002597C2 /* CountTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CountTransformer.h; path = "pithos-macos/CountTransformer.h"; sourceTree = ""; }; + 61C65ADE1428C578002597C2 /* CountTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CountTransformer.m; path = "pithos-macos/CountTransformer.m"; sourceTree = ""; }; + 61C65AE11428D41C002597C2 /* PolicyVersioningTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolicyVersioningTransformer.h; path = "pithos-macos/PolicyVersioningTransformer.h"; sourceTree = ""; }; + 61C65AE21428D41C002597C2 /* PolicyVersioningTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PolicyVersioningTransformer.m; path = "pithos-macos/PolicyVersioningTransformer.m"; sourceTree = ""; }; + 61C65AE4142918DC002597C2 /* PithosObjectNodeInfoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosObjectNodeInfoController.h; sourceTree = ""; }; + 61C65AE5142918DD002597C2 /* PithosObjectNodeInfoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosObjectNodeInfoController.m; sourceTree = ""; }; 61E99D9313EC348500E48DA5 /* 145-persondot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "145-persondot.png"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -230,7 +242,12 @@ 6121250813F033F400063041 /* PithosBrowserPreviewController.xib */, 616FC0B113F97D0800140A33 /* PithosNodeInfoController.h */, 616FC0B213F97D0800140A33 /* PithosNodeInfoController.m */, - 616FC0AE13F91BA400140A33 /* PithosNodeInfoController.xib */, + 611405CD1428BEBD00637170 /* PithosContainerNodeInfoController.h */, + 611405CE1428BEBE00637170 /* PithosContainerNodeInfoController.m */, + 611405CF1428BEC000637170 /* PithosContainerNodeInfoController.xib */, + 61C65AE4142918DC002597C2 /* PithosObjectNodeInfoController.h */, + 61C65AE5142918DD002597C2 /* PithosObjectNodeInfoController.m */, + 616FC0AE13F91BA400140A33 /* PithosObjectNodeInfoController.xib */, 619B85D213F8076F00C9371F /* PithosPreferencesController.h */, 619B85D313F8077100C9371F /* PithosPreferencesController.m */, 619B85D413F8077300C9371F /* PithosPreferencesController.xib */, @@ -319,7 +336,6 @@ children = ( 610DD46213E950E600ED982F /* 01-refresh.png */, 61E99D9313EC348500E48DA5 /* 145-persondot.png */, - 610DD49A13EAE03300ED982F /* container.png */, ); path = Icons; sourceTree = SOURCE_ROOT; @@ -373,6 +389,10 @@ 61C24BBA1410D350007004DC /* PublicURLTransformer.m */, 61C24BBC1410E031007004DC /* SharingDictionaryTransformer.h */, 61C24BBD1410E031007004DC /* SharingDictionaryTransformer.m */, + 61C65ADD1428C578002597C2 /* CountTransformer.h */, + 61C65ADE1428C578002597C2 /* CountTransformer.m */, + 61C65AE11428D41C002597C2 /* PolicyVersioningTransformer.h */, + 61C65AE21428D41C002597C2 /* PolicyVersioningTransformer.m */, ); name = "Value Transformers"; sourceTree = ""; @@ -432,11 +452,11 @@ 610DD30C13E6BB2000ED982F /* MainMenu.xib in Resources */, 610DD35013E6C00E00ED982F /* PithosBrowserController.xib in Resources */, 610DD46313E950E600ED982F /* 01-refresh.png in Resources */, - 610DD49D13EAE03400ED982F /* container.png in Resources */, 61E99D9413EC348500E48DA5 /* 145-persondot.png in Resources */, 6121250913F033F500063041 /* PithosBrowserPreviewController.xib in Resources */, 619B85D613F8077800C9371F /* PithosPreferencesController.xib in Resources */, - 616FC0AF13F91BA400140A33 /* PithosNodeInfoController.xib in Resources */, + 616FC0AF13F91BA400140A33 /* PithosObjectNodeInfoController.xib in Resources */, + 611405D11428BEC000637170 /* PithosContainerNodeInfoController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -484,6 +504,10 @@ 61C24BEC14161EC7007004DC /* PithosFileUtilities.m in Sources */, 614592BC1417CE70002E7A8C /* ASIPithosAccount.m in Sources */, 61433BC9141BA1CE00CD978D /* HashMapHash.m in Sources */, + 611405D01428BEC000637170 /* PithosContainerNodeInfoController.m in Sources */, + 61C65ADF1428C578002597C2 /* CountTransformer.m in Sources */, + 61C65AE31428D41C002597C2 /* PolicyVersioningTransformer.m in Sources */, + 61C65AE6142918DD002597C2 /* PithosObjectNodeInfoController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/pithos-macos/CountTransformer.h b/pithos-macos/CountTransformer.h new file mode 100644 index 0000000..e42cb01 --- /dev/null +++ b/pithos-macos/CountTransformer.h @@ -0,0 +1,39 @@ +// +// CountTransformer.h +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +@interface CountTransformer : NSValueTransformer +@end diff --git a/pithos-macos/CountTransformer.m b/pithos-macos/CountTransformer.m new file mode 100644 index 0000000..b8a0502 --- /dev/null +++ b/pithos-macos/CountTransformer.m @@ -0,0 +1,60 @@ +// +// CountTransformer.m +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +#import "CountTransformer.h" + +@implementation CountTransformer + ++ (Class)transformedValueClass { + return [NSString class]; +} + ++ (BOOL)allowsReverseTransformation { + return NO; +} + +- (id)transformedValue:(id)value { + if (value == nil) + return nil; + return [NSString stringWithFormat:@"%lu", [value unsignedIntegerValue]]; +} + ++ (void)initialize { + [[NSValueTransformer class] setValueTransformer:[self new] forName:@"CountTransformer"]; +} + +@end diff --git a/pithos-macos/PithosBrowserController.m b/pithos-macos/PithosBrowserController.m index d3d5d42..d7138e0 100644 --- a/pithos-macos/PithosBrowserController.m +++ b/pithos-macos/PithosBrowserController.m @@ -769,13 +769,11 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column { menuItem = [[[NSMenuItem alloc] initWithTitle:@"New Folder" action:@selector(newFolder:) keyEquivalent:@""] autorelease]; [menuItem setRepresentedObject:menuNodes]; [menu addItem:menuItem]; - if ([menuNode class] == [PithosSubdirNode class]) { - [menu addItem:[NSMenuItem separatorItem]]; - // Get Info - menuItem = [[[NSMenuItem alloc] initWithTitle:@"Get Info" action:@selector(getInfo:) keyEquivalent:@""] autorelease]; - [menuItem setRepresentedObject:menuNodes]; - [menu addItem:menuItem]; - } + [menu addItem:[NSMenuItem separatorItem]]; + // Get Info + menuItem = [[[NSMenuItem alloc] initWithTitle:@"Get Info" action:@selector(getInfo:) keyEquivalent:@""] autorelease]; + [menuItem setRepresentedObject:menuNodes]; + [menu addItem:menuItem]; } else { // Node context menu NSIndexPath *clickedNodeIndexPath = [[browser indexPathForColumn:column] indexPathByAddingIndex:row]; diff --git a/pithos-macos/PithosContainerNode.h b/pithos-macos/PithosContainerNode.h index 7b91d55..e7726f2 100644 --- a/pithos-macos/PithosContainerNode.h +++ b/pithos-macos/PithosContainerNode.h @@ -46,6 +46,12 @@ ASIPithosContainerRequest *containerRequest; NSString *prefix; NSString *childrenUpdatedNotificationName; + + ASIPithosContainerRequest *applyMetadataContainerRequest; + ASIPithosContainerRequest *refreshMetadataContainerRequest; + + NSString *policyVersioning; + NSNumber *policyQuota; } - (id)initWithPithosContainer:(ASIPithosContainer *)aPithosContainer; @@ -55,7 +61,12 @@ @property(nonatomic, retain) ASIPithosContainer *pithosContainer; @property(nonatomic, retain) NSString *prefix; +@property(nonatomic, retain) NSString *policyVersioning; +@property(nonatomic, retain) NSNumber *policyQuota; - (void)setIcon:(NSImage *)anIcon; +- (void)applyInfo; +- (void)refreshInfo; + @end \ No newline at end of file diff --git a/pithos-macos/PithosContainerNode.m b/pithos-macos/PithosContainerNode.m index 1e48d1e..fbdcb2d 100644 --- a/pithos-macos/PithosContainerNode.m +++ b/pithos-macos/PithosContainerNode.m @@ -43,11 +43,13 @@ #import "ASIPithosObject.h" #import "ASIDownloadCache.h" #import "PithosFileUtilities.h" +#import "PithosContainerNodeInfoController.h" static NSImage *sharedIcon = nil; @implementation PithosContainerNode @synthesize pithosContainer, prefix; +@synthesize policyVersioning, policyQuota; + (void)initialize { if (self == [PithosContainerNode class]) @@ -84,6 +86,12 @@ static NSImage *sharedIcon = nil; - (void)dealloc { [containerRequest clearDelegatesAndCancel]; [containerRequest release]; + [refreshMetadataContainerRequest clearDelegatesAndCancel]; + [refreshMetadataContainerRequest release]; + [applyMetadataContainerRequest clearDelegatesAndCancel]; + [applyMetadataContainerRequest release]; + [policyQuota release]; + [policyVersioning release]; [childrenUpdatedNotificationName release]; [prefix release]; [objects release]; @@ -218,6 +226,42 @@ static NSImage *sharedIcon = nil; } } +- (void)containerMetadataRequestFinished:(ASIPithosContainerRequest *)request { + NSLog(@"URL: %@", [request url]); + NSLog(@"cached: %d", [request didUseCachedResponse]); + + if ([request isEqualTo:applyMetadataContainerRequest]) { + @synchronized(self) { + [applyMetadataContainerRequest release]; + applyMetadataContainerRequest = nil; + } + [self refreshInfo]; + } else if ([request isEqualTo:refreshMetadataContainerRequest]) { + [[pithosNodeInfoController window] makeFirstResponder:nil]; + self.pithosContainer = [refreshMetadataContainerRequest container]; + @synchronized(self) { + [refreshMetadataContainerRequest release]; + refreshMetadataContainerRequest = nil; + } + } +} + +- (void)containerMetadataRequestFailed:(ASIPithosContainerRequest *)request { + if ([request isEqualTo:applyMetadataContainerRequest]) { + [PithosFileUtilities httpRequestErrorAlertWithRequest:applyMetadataContainerRequest]; + @synchronized(self) { + [applyMetadataContainerRequest release]; + applyMetadataContainerRequest = nil; + } + } else if ([request isEqualTo:refreshMetadataContainerRequest]) { + [PithosFileUtilities httpRequestErrorAlertWithRequest:refreshMetadataContainerRequest]; + @synchronized(self) { + [refreshMetadataContainerRequest release]; + refreshMetadataContainerRequest = nil; + } + } +} + #pragma mark - #pragma mark Properties @@ -280,4 +324,64 @@ static NSImage *sharedIcon = nil; icon = [anIcon retain]; } +- (void)setPithosContainer:(ASIPithosContainer *)aPithosContainer { + if (![pithosContainer isEqualTo:aPithosContainer]) { + [pithosContainer release]; + pithosContainer = [aPithosContainer retain]; + } + if (pithosContainer.policy) { + self.policyVersioning = [pithosContainer.policy objectForKey:@"versioning"]; + self.policyQuota = [NSNumber numberWithLongLong:[[pithosContainer.policy objectForKey:@"quota"] longLongValue]]; + } else { + self.policyVersioning = @"manual"; + self.policyQuota = [NSNumber numberWithLongLong:0]; + } +} + +#pragma mark - +#pragma mark Info + +- (void)applyInfo { + @synchronized(self) { + if (applyMetadataContainerRequest == nil) { + [[pithosNodeInfoController window] makeFirstResponder:nil]; + applyMetadataContainerRequest = [[ASIPithosContainerRequest updateContainerMetadataRequestWithContainerName:pithosContainer.name + policy:[NSDictionary dictionaryWithObjectsAndKeys: + policyVersioning, @"versioning", + [policyQuota stringValue], @"quota", + nil] + metadata:pithosContainer.metadata + update:NO] retain]; + applyMetadataContainerRequest.delegate = self; + applyMetadataContainerRequest.didFinishSelector = @selector(containerMetadataRequestFinished:); + applyMetadataContainerRequest.didFailSelector = @selector(containerMetadataRequestFailed:); + [applyMetadataContainerRequest startAsynchronous]; + } + } +} + +- (void)refreshInfo { + @synchronized(self) { + if (refreshMetadataContainerRequest == nil) { + refreshMetadataContainerRequest = [[ASIPithosContainerRequest containerMetadataRequestWithContainerName:pithosContainer.name] retain]; + refreshMetadataContainerRequest.delegate = self; + refreshMetadataContainerRequest.didFinishSelector = @selector(containerMetadataRequestFinished:); + refreshMetadataContainerRequest.didFailSelector = @selector(containerMetadataRequestFailed:); + refreshMetadataContainerRequest.downloadCache = [ASIDownloadCache sharedCache]; + [refreshMetadataContainerRequest startAsynchronous]; + } + } +} + +#pragma mark - +#pragma mark Actions + +- (void)showPithosNodeInfo:(id)sender { + if (!pithosNodeInfoController) + pithosNodeInfoController = [[PithosContainerNodeInfoController alloc] initWithPithosNode:self]; + [pithosNodeInfoController showWindow:sender]; + [[pithosNodeInfoController window] makeKeyAndOrderFront:sender]; + [NSApp activateIgnoringOtherApps:YES]; +} + @end diff --git a/pithos-macos/PithosContainerNodeInfoController.h b/pithos-macos/PithosContainerNodeInfoController.h new file mode 100644 index 0000000..8ef971f --- /dev/null +++ b/pithos-macos/PithosContainerNodeInfoController.h @@ -0,0 +1,51 @@ +// +// PithosContainerNodeInfoController.h +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +#import +#import "PithosNodeInfoController.h" + +@interface PithosContainerNodeInfoController : PithosNodeInfoController { + IBOutlet NSDictionaryController *metadataDictionaryController; + + NSArray *policyVersioningValuesArray; +} + +@property (nonatomic, retain) NSArray *policyVersioningValuesArray; + +- (id)initWithPithosNode:(PithosNode *)aNode; + +@end diff --git a/pithos-macos/PithosContainerNodeInfoController.m b/pithos-macos/PithosContainerNodeInfoController.m new file mode 100644 index 0000000..75866a8 --- /dev/null +++ b/pithos-macos/PithosContainerNodeInfoController.m @@ -0,0 +1,68 @@ +// +// PithosContainerNodeInfoController.m +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +#import "PithosContainerNodeInfoController.h" + +@implementation PithosContainerNodeInfoController +@synthesize policyVersioningValuesArray; + +#pragma mark - +#pragma Object Lifecycle + +- (id)initWithPithosNode:(PithosNode *)aNode { + if ((self = [super initWithWindowNibName:@"PithosContainerNodeInfoController"])) { + node = aNode; + self.policyVersioningValuesArray = [NSArray arrayWithObjects:@"auto", @"manual", @"none", nil]; + } + return self; +} + +- (void)dealloc { + [policyVersioningValuesArray release]; + [super dealloc]; +} + +- (void)windowDidLoad { + [super windowDidLoad]; + + [metadataDictionaryController setInitialKey:@"key"]; + [metadataDictionaryController setInitialValue:@"value"]; + + [[self window] setDelegate:self]; +} + +@end diff --git a/pithos-macos/PithosContainerNodeInfoController.xib b/pithos-macos/PithosContainerNodeInfoController.xib new file mode 100644 index 0000000..f833641 --- /dev/null +++ b/pithos-macos/PithosContainerNodeInfoController.xib @@ -0,0 +1,2445 @@ + + + + 1060 + 10K549 + 1306 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1306 + + + YES + NSMenuItem + NSMenu + NSButton + NSCustomObject + NSArrayController + NSImageView + NSImageCell + NSTableView + NSTextField + NSNumberFormatter + NSWindowTemplate + NSTextFieldCell + NSButtonCell + NSTableColumn + NSBox + NSPopUpButtonCell + NSView + NSDictionaryController + NSScrollView + NSUserDefaultsController + NSScroller + NSTableHeaderView + NSPopUpButton + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + + + YES + + PithosContainerNodeInfoController + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{196, 240}, {265, 412}} + 544735232 + Window + NSWindow + + {400, 412} + {265, 412} + + + 256 + + YES + + + 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 + + + {{10, 370}, {32, 32}} + + + + YES + + 130560 + 33554432 + + NSImage + NSFolderBurnable + + 0 + 3 + 0 + NO + + YES + + + + 270 + {{47, 387}, {135, 17}} + + + + YES + + 68288064 + 272630784 + untitled folder + + LucidaGrande-Bold + 13 + 2072 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 265 + {{178, 387}, {80, 17}} + + + + YES + + 68288064 + 71304192 + Zero KB + + LucidaGrande + 13 + 1044 + + + + + + + + + 14 + {{0, 356}, {265, 5}} + + + + {0, 0} + + 67239424 + 0 + Box + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + + + 268 + {{7, 341}, {72, 14}} + + + + YES + + 68288064 + 4195328 + General: + + LucidaGrande + 11 + 3100 + + + YES + + + + + + + 270 + {{84, 319}, {174, 14}} + + + + YES + + 67239488 + 4196352 + Count + + LucidaGrande + 11 + 16 + + + + + + + + + 270 + {{84, 304}, {174, 14}} + + + + YES + + 67239488 + 4196352 + Size + + + + + + + + + 270 + {{84, 289}, {174, 14}} + + + + YES + + 67239488 + 4196352 + Modified + + + + + + + + + 270 + {{84, 274}, {174, 14}} + + + + YES + + 67239488 + 4196352 + Block size + + + + + + + + + 270 + {{84, 259}, {174, 14}} + + + + YES + + 67239488 + 4196352 + Block hash + + + + + + + + + 268 + {{12, 319}, {72, 14}} + + + + YES + + 68288064 + 71304192 + Count: + + + YES + + + + + + + 268 + {{12, 304}, {72, 14}} + + + + YES + + 68288064 + 71304192 + Size: + + + YES + + + + + + + 268 + {{12, 289}, {72, 14}} + + + + YES + + 68288064 + 71304192 + Modified: + + + YES + + + + + + + 268 + {{12, 274}, {72, 14}} + + + + YES + + 68288064 + 71304192 + Block size: + + + YES + + + + + + + 268 + {{12, 259}, {72, 14}} + + + + YES + + 68288064 + 71304192 + Block hash: + + + YES + + + + + + + 14 + {{0, 246}, {265, 5}} + + + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + + + 268 + {{7, 231}, {72, 14}} + + + + YES + + 68288064 + 4195328 + Metadata: + + + YES + + + + + + + 270 + + YES + + + 2304 + + YES + + + 4352 + {243, 78} + + + + YES + + + 256 + {243, 17} + + + + + + + + -2147483392 + {{224, 0}, {16, 17}} + + + + + + YES + + 101 + 40 + 1000 + + 75628096 + 2048 + Key + + + 3 + MC4zMzMzMzI5ODU2AA + + + 6 + System + headerTextColor + + + + + 337772096 + 2048 + Text Cell + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + YES + + + + 136 + 40 + 1000 + + 75628096 + 2048 + Value + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + YES + + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + 1388314624 + + + 1 + 4 + 15 + 0 + YES + 0 + + + {{1, 17}, {243, 78}} + + + + + + 4 + + + + -2147483392 + {{224, 17}, {15, 102}} + + + + + _doScroller: + 37 + 0.1947367936372757 + + + + -2147483392 + {{1, 119}, {223, 15}} + + + + 1 + + _doScroller: + 0.57142859697341919 + + + + 2304 + + YES + + + {{1, 0}, {243, 17}} + + + + + + 4 + + + + {{10, 127}, {245, 96}} + + + + 562 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 268 + {{10, 107}, {18, 18}} + + + + YES + + -2080244224 + 134217728 + + + + -2033434369 + 162 + + NSImage + NSAddTemplate + + + + 400 + 75 + + + + + 268 + {{27, 107}, {18, 18}} + + + + YES + + -2080244224 + 134217728 + + + + -2033434369 + 162 + + NSImage + NSRemoveTemplate + + + + 400 + 75 + + + + + 14 + {{0, 97}, {265, 5}} + + + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + + + 268 + {{7, 82}, {126, 14}} + + + + YES + + 68288064 + 4195328 + Policy: + + + YES + + + + + + + 268 + {{12, 60}, {72, 14}} + + + + YES + + 68288064 + 71304192 + Versioning: + + + YES + + + + + + + 268 + {{12, 34}, {72, 14}} + + + + YES + + 68288064 + 71304192 + Quota (KB): + + + YES + + + + + + + 265 + {{193, 3}, {62, 19}} + + + + YES + + -2080244224 + 134217728 + Revert + + LucidaGrande + 12 + 16 + + + -2038152961 + 164 + + + 400 + 75 + + + + + 265 + {{123, 3}, {62, 19}} + + + + YES + + -2080244224 + 134217728 + Apply + + + -2038152961 + 164 + + + 400 + 75 + + + + + 270 + {{84, 53}, {174, 26}} + + + + YES + + -2080244160 + 2048 + + + -2035138305 + 129 + + + + 400 + 75 + + + auto + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + manual + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + none + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + + + + 270 + {{87, 30}, {168, 22}} + + + + YES + + -1804468671 + 272630784 + + + + YES + + + 6 + System + textColor + + + + + + {{7, 11}, {265, 412}} + + + + + {{0, 0}, {1280, 778}} + {265, 434} + {400, 434} + + + YES + + + YES + YES + YES + YES + + YES + + key + YES + compare: + + + YES + key + value + + + YES + + YES + YES + YES + YES + YES + + + MetadataKeyFormatter + + + + YES + + YES + allowsFloats + formatterBehavior + locale + minimum + negativeInfinitySymbol + nilSymbol + positiveInfinitySymbol + + + YES + + + + + + + -∞ + + +∞ + + + # + # + + + + + + + + NaN + + YES + + + + + + + 0 + 0 + YES + NO + 1 + AAAAAAAAAAAAAAAAAAAAAA + + + 3 + YES + YES + YES + + . + , + NO + NO + YES + + + + + YES + + + displayPatternTitle1: self.node.displayName + + + + + + displayPatternTitle1: self.node.displayName + displayPatternTitle1 + self.node.displayName + + NSDisplayPattern + %{title1}@ Info + + 2 + + + 105 + + + + window + + + + 107 + + + + content: arrangedObjects + + + + + + content: arrangedObjects + content + arrangedObjects + 2 + + + 130 + + + + value: node.icon + + + + + + value: node.icon + value + node.icon + 2 + + + 169 + + + + value: node.displayName + + + + + + value: node.displayName + value + node.displayName + 2 + + + 170 + + + + add: + + + + 187 + + + + selectionIndexes: selectionIndexes + + + + + + selectionIndexes: selectionIndexes + selectionIndexes + selectionIndexes + + 2 + + + 249 + + + + sortDescriptors: sortDescriptors + + + + + + sortDescriptors: sortDescriptors + sortDescriptors + sortDescriptors + + 2 + + + 251 + + + + remove: + + + + 253 + + + + formatter + + + + 258 + + + + enabled: canRemove + + + + + + enabled: canRemove + enabled + canRemove + 2 + + + 262 + + + + target: node + + + + + + target: node + target + node + + NSSelectorName + applyInfo + + 2 + + + 283 + + + + target: node + + + + + + target: node + target + node + + NSSelectorName + refreshInfo + + 2 + + + 285 + + + + metadataDictionaryController + + + + 319 + + + + value: arrangedObjects.value + + + + + + value: arrangedObjects.value + value + arrangedObjects.value + + YES + + YES + NSConditionallySetsEditable + NSValidatesImmediately + + + YES + + + + + 2 + + + 332 + + + + value: node.pithosContainer.bytes + + + + + + value: node.pithosContainer.bytes + value + node.pithosContainer.bytes + + YES + + YES + NSNullPlaceholder + NSValueTransformerName + + + YES + - + BytesSizeTransformer + + + 2 + + + 909 + + + + value: node.pithosContainer.count + + + + + + value: node.pithosContainer.count + value + node.pithosContainer.count + + NSValueTransformerName + CountTransformer + + 2 + + + 914 + + + + value: node.pithosContainer.count + + + + + + value: node.pithosContainer.count + value + node.pithosContainer.count + + YES + + YES + NSNullPlaceholder + NSValueTransformerName + + + YES + - + CountTransformer + + + 2 + + + 915 + + + + value: node.pithosContainer.bytes + + + + + + value: node.pithosContainer.bytes + value + node.pithosContainer.bytes + + YES + + YES + NSNullPlaceholder + NSValueTransformerName + + + YES + - + BytesExtendedSizeTransformer + + + 2 + + + 917 + + + + value: node.pithosContainer.lastModified + + + + + + value: node.pithosContainer.lastModified + value + node.pithosContainer.lastModified + + YES + + YES + NSNullPlaceholder + NSValueTransformerName + + + YES + - + LastModifiedDateTransformer + + + 2 + + + 918 + + + + value: node.pithosContainer.blockSize + + + + + + value: node.pithosContainer.blockSize + value + node.pithosContainer.blockSize + + YES + + YES + NSNullPlaceholder + NSValueTransformerName + + + YES + - + BytesExtendedSizeTransformer + + + 2 + + + 920 + + + + value: node.pithosContainer.blockHash + + + + + + value: node.pithosContainer.blockHash + value + node.pithosContainer.blockHash + + NSNullPlaceholder + - + + 2 + + + 921 + + + + contentDictionary: node.pithosContainer.metadata + + + + + + contentDictionary: node.pithosContainer.metadata + contentDictionary + node.pithosContainer.metadata + 2 + + + 922 + + + + policyVersioningArrayController + + + + 946 + + + + contentArray: self.policyVersioningValuesArray + + + + + + contentArray: self.policyVersioningValuesArray + contentArray + self.policyVersioningValuesArray + 2 + + + 963 + + + + content: arrangedObjects + + + + + + content: arrangedObjects + content + arrangedObjects + + YES + + YES + NSNoSelectionPlaceholder + NSNullPlaceholder + + + YES + manual + manual + + + 2 + + + 976 + + + + contentObjects: arrangedObjects + + + + + + contentObjects: arrangedObjects + contentObjects + arrangedObjects + + 2 + + + 977 + + + + contentValues: arrangedObjects + + + + + + contentValues: arrangedObjects + contentValues + arrangedObjects + + 2 + + + 978 + + + + selectedObject: node.policyVersioning + + + + + + selectedObject: node.policyVersioning + selectedObject + node.policyVersioning + + YES + + YES + NSConditionallySetsEnabled + NSRaisesForNotApplicableKeys + NSValidatesImmediately + + + YES + + + + + + + 2 + + + 979 + + + + formatter + + + + 986 + + + + value: node.policyQuota + + + + + + value: node.policyQuota + value + node.policyQuota + + YES + + YES + NSConditionallySetsEditable + NSNullPlaceholder + NSRaisesForNotApplicableKeys + NSValidatesImmediately + + + YES + + 0 + + + + + 2 + + + 997 + + + + value: arrangedObjects.key + + + + + + value: arrangedObjects.key + value + arrangedObjects.key + + YES + + YES + NSConditionallySetsEditable + NSValidatesImmediately + + + YES + + + + + 2 + + + 998 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 99 + + + + + 125 + + + Dictionary Controller (Metadata) + + + 257 + + + + + 24 + + + YES + + + + + + 31 + + + + + 66 + + + + + 25 + + + YES + + + + + + 30 + + + + + 5 + + + YES + + + + Name + + + 6 + + + + + 15 + + + + + 19 + + + YES + + + + Modified + + + 36 + + + Text Field Cell - Modified + + + 50 + + + + + 23 + + + YES + + + + + + 32 + + + + + 67 + + + YES + + + + + + 81 + + + + + 20 + + + YES + + + + Modified by + + + 35 + + + Text Field Cell - Modified by + + + 3 + + + YES + + + + Image View + + + 4 + + + + + 26 + + + YES + + + + + + 29 + + + + + 62 + + + YES + + + + + + 63 + + + + + 18 + + + YES + + + + Size + + + 37 + + + Text Field Cell - Size + + + 93 + + + YES + + + + + + 94 + + + + + 27 + + + YES + + + + + + 28 + + + + + 265 + + + YES + + + + + + 266 + + + + + 51 + + + YES + + + + + + 52 + + + + + 17 + + + YES + + + + Count + + + 38 + + + Text Field Cell - Count + + + 64 + + + YES + + + + + + 65 + + + + + 9 + + + YES + + + + Size + + + 10 + + + + + 263 + + + YES + + + + + + 264 + + + + + 44 + + + YES + + + + + + 45 + + + + + 53 + + + YES + + + + + + + Scroll View - Table View - Metadata + + + 57 + + + YES + + + + + + + 59 + + + YES + + + + + + 60 + + + Text Field Cell - Text Cell + + + 58 + + + YES + + + + + + 61 + + + + + 56 + + + + + 55 + + + + + 54 + + + + + 21 + + + YES + + + + Version + + + 34 + + + Text Field Cell - Version + + + 923 + + + YES + + + + + + 924 + + + YES + + + + + + 925 + + + YES + + + + + + + + 926 + + + + + 927 + + + + + 928 + + + + + 929 + + + YES + + + + + + 930 + + + + + 945 + + + Array Controller (Policy Versioning) + + + 983 + + + + + 984 + + + YES + + + + + + 985 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 10.IBPluginDependency + 125.IBPluginDependency + 15.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 19.IBPluginDependency + 2.IBPluginDependency + 20.IBPluginDependency + 21.IBPluginDependency + 23.IBPluginDependency + 24.IBPluginDependency + 25.IBPluginDependency + 257.IBPluginDependency + 26.IBPluginDependency + 263.IBPluginDependency + 264.IBPluginDependency + 265.IBPluginDependency + 266.IBPluginDependency + 27.IBPluginDependency + 28.IBPluginDependency + 29.IBPluginDependency + 3.IBPluginDependency + 30.IBPluginDependency + 31.IBPluginDependency + 32.IBPluginDependency + 34.IBPluginDependency + 35.IBPluginDependency + 36.IBPluginDependency + 37.IBPluginDependency + 38.IBPluginDependency + 4.IBPluginDependency + 44.IBPluginDependency + 45.IBPluginDependency + 5.IBPluginDependency + 50.IBPluginDependency + 51.IBPluginDependency + 52.IBPluginDependency + 53.IBPluginDependency + 54.IBPluginDependency + 55.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 59.IBPluginDependency + 6.IBPluginDependency + 60.IBPluginDependency + 61.IBPluginDependency + 62.IBPluginDependency + 63.IBPluginDependency + 64.IBPluginDependency + 65.IBPluginDependency + 66.IBPluginDependency + 67.IBPluginDependency + 81.IBPluginDependency + 9.IBPluginDependency + 923.IBPluginDependency + 924.IBPluginDependency + 929.IBPluginDependency + 93.IBPluginDependency + 930.IBPluginDependency + 94.IBPluginDependency + 945.IBPluginDependency + 983.IBNumberFormatterBehaviorMetadataKey + 983.IBNumberFormatterLocalizesFormatMetadataKey + 983.IBNumberFormatterSampleNumberKey + 983.IBPluginDependency + 984.IBPluginDependency + 985.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + 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 + 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 + 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 + 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 + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 998 + + + + YES + + MetadataKeyFormatter + NSFormatter + + IBProjectSource + ./Classes/MetadataKeyFormatter.h + + + + PithosContainerNodeInfoController + NSWindowController + + metadataDictionaryController + NSDictionaryController + + + metadataDictionaryController + + metadataDictionaryController + NSDictionaryController + + + + IBProjectSource + ./Classes/PithosContainerNodeInfoController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSAddTemplate + NSFolderBurnable + NSMenuCheckmark + NSMenuMixedState + NSRemoveTemplate + + + YES + {8, 8} + {32, 32} + {9, 8} + {7, 2} + {8, 8} + + + + diff --git a/pithos-macos/PithosNode.m b/pithos-macos/PithosNode.m index 2b3a6a3..3f26980 100644 --- a/pithos-macos/PithosNode.m +++ b/pithos-macos/PithosNode.m @@ -91,11 +91,7 @@ } - (void)showPithosNodeInfo:(id)sender { - if (!pithosNodeInfoController) - pithosNodeInfoController = [[PithosNodeInfoController alloc] initWithPithosNode:self]; - [pithosNodeInfoController showWindow:sender]; - [[pithosNodeInfoController window] makeKeyAndOrderFront:sender]; - [NSApp activateIgnoringOtherApps:YES]; + // Abstract method } - (void)pithosNodeInfoWillClose:(id)sender { diff --git a/pithos-macos/PithosNodeInfoController.h b/pithos-macos/PithosNodeInfoController.h index 94f205b..90bdc13 100644 --- a/pithos-macos/PithosNodeInfoController.h +++ b/pithos-macos/PithosNodeInfoController.h @@ -40,13 +40,8 @@ @interface PithosNodeInfoController : NSWindowController { PithosNode *node; - - IBOutlet NSDictionaryController *metadataDictionaryController; - IBOutlet NSDictionaryController *sharingDictionaryController; } -@property(assign) PithosNode *node; - -- (id)initWithPithosNode:(PithosNode *)aNode; +@property (nonatomic, assign) PithosNode *node; @end diff --git a/pithos-macos/PithosNodeInfoController.m b/pithos-macos/PithosNodeInfoController.m index 1b8dcfd..d41fadc 100644 --- a/pithos-macos/PithosNodeInfoController.m +++ b/pithos-macos/PithosNodeInfoController.m @@ -42,31 +42,6 @@ @synthesize node; #pragma mark - -#pragma Object Lifecycle - -- (id)initWithPithosNode:(PithosNode *)aNode { - if ((self = [super initWithWindowNibName:@"PithosNodeInfoController"])) { - node = aNode; - } - return self; -} - -- (void)dealloc { - [super dealloc]; -} - -- (void)windowDidLoad { - [super windowDidLoad]; - - [metadataDictionaryController setInitialKey:@"key"]; - [metadataDictionaryController setInitialValue:@"value"]; - [sharingDictionaryController setInitialKey:@"user"]; - [sharingDictionaryController setInitialValue:@"read"]; - - [[self window] setDelegate:self]; -} - -#pragma mark - #pragma mark NSWindowDelegate - (void)windowWillClose:(NSNotification *)notification { diff --git a/pithos-macos/PithosObjectNode.m b/pithos-macos/PithosObjectNode.m index ecf6727..bfd8154 100644 --- a/pithos-macos/PithosObjectNode.m +++ b/pithos-macos/PithosObjectNode.m @@ -42,6 +42,7 @@ #import "ASIPithosObject.h" #import "ASIDownloadCache.h" #import "PithosFileUtilities.h" +#import "PithosObjectNodeInfoController.h" @implementation PithosObjectNode @synthesize pithosContainer, pithosObject; @@ -113,11 +114,12 @@ - (void)applyInfo { @synchronized(self) { if (applyMetadataObjectRequest == nil) { + [[pithosNodeInfoController window] makeFirstResponder:nil]; applyMetadataObjectRequest = [[ASIPithosObjectRequest updateObjectMetadataRequestWithContainerName:pithosContainer.name objectName:pithosObject.name - contentEncoding:nil - contentDisposition:nil - manifest:nil + contentEncoding:pithosObject.contentEncoding + contentDisposition:pithosObject.contentDisposition + manifest:pithosObject.manifest sharing:pithosObject.sharing isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) metadata:pithosObject.metadata @@ -158,6 +160,8 @@ } [self refreshInfo]; } else if ([request isEqualTo:refreshMetadataObjectRequest]) { + [[pithosNodeInfoController window] makeFirstResponder:nil]; + self.pithosObject = [refreshMetadataObjectRequest object]; @synchronized(self) { [refreshMetadataObjectRequest release]; @@ -182,4 +186,15 @@ } } +#pragma mark - +#pragma mark Actions + +- (void)showPithosNodeInfo:(id)sender { + if (!pithosNodeInfoController) + pithosNodeInfoController = [[PithosObjectNodeInfoController alloc] initWithPithosNode:self]; + [pithosNodeInfoController showWindow:sender]; + [[pithosNodeInfoController window] makeKeyAndOrderFront:sender]; + [NSApp activateIgnoringOtherApps:YES]; +} + @end diff --git a/pithos-macos/PithosObjectNodeInfoController.h b/pithos-macos/PithosObjectNodeInfoController.h new file mode 100644 index 0000000..2a23887 --- /dev/null +++ b/pithos-macos/PithosObjectNodeInfoController.h @@ -0,0 +1,48 @@ +// +// PithosObjectNodeInfoController.h +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +#import +#import "PithosNodeInfoController.h" + +@interface PithosObjectNodeInfoController : PithosNodeInfoController { + IBOutlet NSDictionaryController *metadataDictionaryController; + IBOutlet NSDictionaryController *sharingDictionaryController; +} + +- (id)initWithPithosNode:(PithosNode *)aNode; + +@end diff --git a/pithos-macos/PithosObjectNodeInfoController.m b/pithos-macos/PithosObjectNodeInfoController.m new file mode 100644 index 0000000..8bedbcb --- /dev/null +++ b/pithos-macos/PithosObjectNodeInfoController.m @@ -0,0 +1,63 @@ +// +// PithosObjectNodeInfoController.m +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +#import "PithosObjectNodeInfoController.h" + +@implementation PithosObjectNodeInfoController + +#pragma mark - +#pragma Object Lifecycle + +- (id)initWithPithosNode:(PithosNode *)aNode { + if ((self = [super initWithWindowNibName:@"PithosObjectNodeInfoController"])) { + node = aNode; + } + return self; +} + +- (void)windowDidLoad { + [super windowDidLoad]; + + [metadataDictionaryController setInitialKey:@"key"]; + [metadataDictionaryController setInitialValue:@"value"]; + [sharingDictionaryController setInitialKey:@"user"]; + [sharingDictionaryController setInitialValue:@"read"]; + + [[self window] setDelegate:self]; +} + +@end diff --git a/pithos-macos/PithosNodeInfoController.xib b/pithos-macos/PithosObjectNodeInfoController.xib similarity index 83% rename from pithos-macos/PithosNodeInfoController.xib rename to pithos-macos/PithosObjectNodeInfoController.xib index 1798559..c67502e 100644 --- a/pithos-macos/PithosNodeInfoController.xib +++ b/pithos-macos/PithosObjectNodeInfoController.xib @@ -13,23 +13,23 @@ YES NSUserDefaultsController - NSDictionaryController + NSTableColumn NSScroller NSTableHeaderView NSButton NSComboBoxCell NSTextFieldCell NSScrollView - NSImageView + NSButtonCell NSBox - NSImageCell + NSImageView NSTableView - NSButtonCell + NSImageCell NSCustomObject NSView NSWindowTemplate NSTextField - NSTableColumn + NSDictionaryController YES @@ -45,7 +45,7 @@ YES - PithosNodeInfoController + PithosObjectNodeInfoController FirstResponder @@ -56,12 +56,12 @@ 15 2 - {{196, 240}, {265, 515}} + {{196, 240}, {265, 644}} 544735232 Window NSWindow - {400, 515} + {400, 644} {265, 515} @@ -83,8 +83,9 @@ NeXT TIFF v4.0 pasteboard type - {{10, 473}, {32, 32}} + {{10, 602}, {32, 32}} + YES @@ -104,8 +105,9 @@ 270 - {{47, 490}, {135, 17}} + {{47, 619}, {135, 17}} + YES @@ -141,8 +143,9 @@ 268 - {{47, 470}, {60, 17}} + {{47, 599}, {60, 17}} + YES @@ -162,8 +165,9 @@ 265 - {{178, 490}, {80, 17}} + {{178, 619}, {80, 17}} + YES @@ -183,8 +187,9 @@ 268 - {{109, 473}, {149, 14}} + {{109, 602}, {149, 14}} + YES @@ -200,8 +205,9 @@ 14 - {{0, 459}, {265, 5}} + {{0, 588}, {265, 5}} + {0, 0} @@ -231,8 +237,9 @@ 268 - {{7, 444}, {72, 14}} + {{7, 573}, {72, 14}} + YES @@ -249,8 +256,9 @@ 270 - {{84, 392}, {174, 14}} + {{84, 521}, {174, 14}} + YES @@ -270,8 +278,9 @@ 270 - {{84, 422}, {174, 14}} + {{84, 551}, {174, 14}} + YES @@ -287,8 +296,9 @@ 270 - {{84, 407}, {174, 14}} + {{84, 536}, {174, 14}} + YES @@ -304,8 +314,9 @@ 270 - {{84, 377}, {174, 14}} + {{84, 506}, {174, 14}} + YES @@ -321,8 +332,9 @@ 270 - {{84, 362}, {174, 14}} + {{84, 491}, {174, 14}} + YES @@ -338,8 +350,9 @@ 270 - {{84, 347}, {174, 14}} + {{84, 476}, {174, 14}} + YES @@ -355,8 +368,9 @@ 268 - {{12, 392}, {72, 14}} + {{12, 521}, {72, 14}} + YES @@ -373,8 +387,9 @@ 268 - {{12, 422}, {72, 14}} + {{12, 551}, {72, 14}} + YES @@ -391,8 +406,9 @@ 268 - {{12, 407}, {72, 14}} + {{12, 536}, {72, 14}} + YES @@ -409,8 +425,9 @@ 268 - {{12, 377}, {72, 14}} + {{12, 506}, {72, 14}} + YES @@ -427,8 +444,9 @@ 268 - {{12, 362}, {72, 14}} + {{12, 491}, {72, 14}} + YES @@ -442,11 +460,69 @@ + + + 268 + {{12, 88}, {114, 14}} + + + + YES + + 68288064 + 71304192 + Content Encoding: + + + YES + + + + + + + 268 + {{12, 61}, {114, 14}} + + + + YES + + 68288064 + 71304192 + Content Disposition: + + + YES + + + + + + + 268 + {{12, 34}, {114, 14}} + + + + YES + + 68288064 + 71304192 + Manifest: + + + YES + + + + 268 - {{12, 347}, {72, 14}} + {{12, 476}, {72, 14}} + YES @@ -463,8 +539,9 @@ 14 - {{0, 334}, {265, 5}} + {{0, 463}, {265, 5}} + {0, 0} @@ -486,8 +563,9 @@ 268 - {{7, 319}, {72, 14}} + {{7, 448}, {72, 14}} + YES @@ -501,6 +579,25 @@ + + + 268 + {{7, 106}, {91, 14}} + + + + YES + + 68288064 + 4195328 + Other Metadata: + + + YES + + + + 270 @@ -516,6 +613,7 @@ 4352 {243, 78} + YES @@ -523,6 +621,7 @@ 256 {243, 17} + @@ -531,6 +630,7 @@ -2147483392 {{224, 0}, {16, 17}} + @@ -627,6 +727,7 @@ {{1, 17}, {243, 78}} + @@ -637,6 +738,7 @@ -2147483392 {{224, 17}, {15, 102}} + _doScroller: @@ -648,6 +750,7 @@ -2147483392 {{1, 119}, {223, 15}} + 1 @@ -663,6 +766,7 @@ {{1, 0}, {243, 17}} + @@ -670,8 +774,9 @@ - {{10, 215}, {245, 96}} + {{10, 344}, {245, 96}} + 562 @@ -684,8 +789,9 @@ 268 - {{10, 195}, {18, 18}} + {{10, 324}, {18, 18}} + YES @@ -709,8 +815,9 @@ 268 - {{27, 195}, {18, 18}} + {{27, 324}, {18, 18}} + YES @@ -734,8 +841,9 @@ 14 - {{0, 185}, {265, 5}} + {{0, 314}, {265, 5}} + {0, 0} @@ -754,11 +862,36 @@ 0 NO + + + 14 + {{0, 126}, {265, 5}} + + + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + 268 - {{7, 170}, {126, 14}} + {{7, 299}, {126, 14}} + YES @@ -787,6 +920,7 @@ 4352 {243, 78} + YES @@ -794,6 +928,7 @@ 256 {243, 17} + @@ -802,6 +937,7 @@ -2147483392 {{224, 0}, {16, 17}} + @@ -946,6 +1082,7 @@ {{1, 17}, {243, 78}} + @@ -956,6 +1093,7 @@ -2147483392 {{224, 17}, {15, 102}} + _doScroller: @@ -966,6 +1104,7 @@ -2147483392 {{1, 80}, {243, 15}} + 1 @@ -981,6 +1120,7 @@ {{1, 0}, {243, 17}} + @@ -988,8 +1128,9 @@ - {{10, 27}, {245, 96}} + {{10, 156}, {245, 96}} + 562 @@ -1002,8 +1143,9 @@ 268 - {{10, 7}, {18, 18}} + {{10, 136}, {18, 18}} + YES @@ -1024,9 +1166,10 @@ 268 - {{27, 7}, {18, 18}} + {{27, 136}, {18, 18}} - + + YES -2080244224 @@ -1046,8 +1189,9 @@ 268 - {{83, 129}, {61, 18}} + {{83, 258}, {61, 18}} + YES @@ -1074,8 +1218,9 @@ 270 - {{84, 148}, {174, 14}} + {{84, 277}, {174, 14}} + YES @@ -1091,8 +1236,9 @@ 268 - {{12, 148}, {72, 14}} + {{12, 277}, {72, 14}} + YES @@ -1109,8 +1255,9 @@ 265 - {{193, 5}, {62, 19}} + {{193, 3}, {62, 19}} + YES @@ -1130,8 +1277,9 @@ 265 - {{123, 5}, {62, 19}} + {{124, 3}, {62, 19}} + YES @@ -1148,14 +1296,77 @@ 75 + + + 270 + {{131, 84}, {124, 22}} + + + + YES + + -1804468671 + 272630784 + + + + YES + + + 6 + System + textColor + + + + + + + 270 + {{131, 57}, {124, 22}} + + + + YES + + -1804468671 + 272630784 + + + + YES + + + + + + + 270 + {{131, 30}, {124, 22}} + + + + YES + + -1804468671 + 272630784 + + + + YES + + + + - {{7, 11}, {265, 515}} + {{7, 11}, {265, 644}} + {{0, 0}, {1280, 778}} {265, 537} - {400, 537} + {400, 666} YES @@ -1762,12 +1973,41 @@ - value: arrangedObjects.key - + value: arrangedObjects.value + - + + value: arrangedObjects.value + value + arrangedObjects.value + + YES + + YES + NSConditionallySetsEditable + NSValidatesImmediately + + + YES + + + + + 2 + + + 332 + + + + value: arrangedObjects.key + + + + + value: arrangedObjects.key value arrangedObjects.key @@ -1777,28 +2017,26 @@ YES NSConditionallySetsEditable NSValidatesImmediately - NSValueTransformerName YES - MetadataKeyTransformer 2 - 331 + 333 value: arrangedObjects.value - - + + - - + + value: arrangedObjects.value value arrangedObjects.value @@ -1806,77 +2044,141 @@ YES YES + NSConditionallySetsEnabled + NSValidatesImmediately + + + YES + + + + + 2 + + + 334 + + + + value: node.pithosObject.contentEncoding + + + + + + value: node.pithosObject.contentEncoding + value + node.pithosObject.contentEncoding + + YES + + YES NSConditionallySetsEditable + NSRaisesForNotApplicableKeys NSValidatesImmediately YES + 2 - 332 + 360 - value: arrangedObjects.key - - + value: node.pithosObject.contentDisposition + + - - - value: arrangedObjects.key + + + value: node.pithosObject.contentDisposition value - arrangedObjects.key + node.pithosObject.contentDisposition YES YES NSConditionallySetsEditable + NSRaisesForNotApplicableKeys NSValidatesImmediately YES + 2 - 333 + 367 - value: arrangedObjects.value - - + value: node.pithosObject.manifest + + - - - value: arrangedObjects.value + + + value: node.pithosObject.manifest value - arrangedObjects.value + node.pithosObject.manifest YES YES - NSConditionallySetsEnabled + NSConditionallySetsEditable + NSRaisesForNotApplicableKeys NSValidatesImmediately YES + 2 - 334 + 373 + + + + value: arrangedObjects.key + + + + + + value: arrangedObjects.key + value + arrangedObjects.key + + YES + + YES + NSConditionallySetsEditable + NSValidatesImmediately + + + YES + + + + + 2 + + + 908 @@ -1954,382 +2256,507 @@ + + + + + + + + - 3 - - - YES - - - - Image View - - - 4 - - + 99 + + - 5 - + 125 + + + Dictionary Controller (Metadata) + + + 257 + + + + + 295 + + + Dictionary Controller (Sharing) + + + 321 + + + + + 338 + YES - + - Name - 6 - - + 339 + + - 7 - + 24 + YES - + - StaticText - Container: - 8 - - + 31 + + - 9 - + 85 + YES - + - Size - 10 - - + 86 + + - 15 - + 66 + - 16 - + 342 + YES - + - Where - 17 - + 343 + + + + + 25 + YES - + - Content Type - 18 - + 30 + + + + + 5 + YES - + - Size + Name - 19 - + 6 + + + + + 15 + + + + + 7 + YES - + - Modified + StaticText - Container: - 20 - + 8 + + + + + 340 + YES - + - Modified by - 21 - + 341 + + + + + 348 + YES - + - Version + Content Disposition - 22 - + 349 + + + + + 19 + YES - + + Modified - 23 - + 36 + + + Text Field Cell - Modified + + + 346 + YES - + + Content Encoding - 24 - + 347 + + + + + 50 + + + + + 23 + YES - + - 25 - + 32 + + + + + 350 + YES - + + Manifest - 26 - + 351 + + + + + 67 + YES - + - 27 - + 81 + + + + + 20 + YES - + + Modified by - 28 - - + 35 + + + Text Field Cell - Modified by - 29 - - + 68 + + + YES + + + + + + + Scroll View - Table View - Sharing - 30 - - + 76 + + - 31 - - + 75 + + - 32 - - + 74 + + - 33 - - + 73 + + + YES + + + + - 34 - - - Text Field Cell - Version + 78 + + + YES + + + - 35 - - - Text Field Cell - Modified by + 79 + + - 36 - - - Text Field Cell - Modified + 77 + + + YES + + + - 37 - - - Text Field Cell - Size + 314 + + - 38 - - - Text Field Cell - Kind + 70 + + + YES + + + - 39 - - - Text Field Cell - Name + 71 + + - 11 - + 69 + YES - + - Container - 12 - - + 72 + + - 44 - + 3 + YES - + + Image View - 45 - - + 4 + + - 50 - + 26 + + + YES + + - 51 - + 29 + + + + + 62 + YES - + - 52 - - + 63 + + - 53 - + 18 + YES - - - - + - Scroll View - Table View - Metadata + Size - 54 - - + 37 + + + Text Field Cell - Size - 55 - - + 93 + + + YES + + + - 56 - - + 94 + + - 57 - + 27 + YES - - + - + - 58 - + 28 + + + + + 265 + YES - + - + - 59 - + 266 + + + + + 337 + + + + + 51 + YES - + - - - - 60 - - - Text Field Cell - Text Cell + - 61 - - + 52 + + - 62 - + 17 + YES - + + Content Type - 63 - - + 38 + + + Text Field Cell - Kind 64 @@ -2346,216 +2773,205 @@ - 66 - - - - - 67 - - - YES - - - - - - 68 - + 11 + YES - - - - + - Scroll View - Table View - Sharing + Container - 69 - + 12 + + + + + 16 + YES - + + Where - 70 - + 39 + + + Text Field Cell - Name + + + 9 + YES - + + Size - 71 - - - - - 72 - - + 10 + + - 73 - + 22 + YES - - + - + - 74 - - + 33 + + - 75 - - + 92 + + + YES + + + + Public URL - 76 - - + 95 + + + Text Field Cell - Kind - 77 - + 263 + YES - + - + - 78 - + 264 + + + + + 344 + YES - + - - - - 79 - - + - 81 - - + 345 + + - 85 - + 44 + YES - + - 86 - - + 45 + + - 92 - + 53 + YES - + + + + - Public URL + Scroll View - Table View - Metadata - 93 - + 57 + YES - + + - + - 94 - - + 59 + + + YES + + + - 95 - - - Text Field Cell - Kind + 60 + + + Text Field Cell - Text Cell - 99 - - + 58 + + + YES + + + - 125 - - - Dictionary Controller (Metadata) + 61 + + - 257 - - + 56 + + - 263 - - - YES - - - + 55 + + - 264 - - + 54 + + - 265 - + 21 + YES - + + Version - 266 - - - - - 295 - - - Dictionary Controller (Sharing) - - - 314 - - - - - 321 - - + 34 + + + Text Field Cell - Version @@ -2603,8 +3019,23 @@ 32.IBPluginDependency 321.IBPluginDependency 33.IBPluginDependency + 337.IBPluginDependency + 338.IBPluginDependency + 339.IBPluginDependency 34.IBPluginDependency + 340.IBPluginDependency + 341.IBPluginDependency + 342.IBPluginDependency + 343.IBPluginDependency + 344.IBPluginDependency + 345.IBPluginDependency + 346.IBPluginDependency + 347.IBPluginDependency + 348.IBPluginDependency + 349.IBPluginDependency 35.IBPluginDependency + 350.IBPluginDependency + 351.IBPluginDependency 36.IBPluginDependency 37.IBPluginDependency 38.IBPluginDependency @@ -2752,6 +3183,21 @@ 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 + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -2766,9 +3212,77 @@ - 334 + 908 + + + + YES + + MetadataKeyFormatter + NSFormatter + + IBProjectSource + ./Classes/MetadataKeyFormatter.h + + + + PithosNodeInfoController + NSWindowController + + IBProjectSource + ./Classes/PithosNodeInfoController.h + + + + PithosObjectNodeInfoController + PithosNodeInfoController + + YES + + YES + metadataDictionaryController + sharingDictionaryController + + + YES + NSDictionaryController + NSDictionaryController + + + + YES + + YES + metadataDictionaryController + sharingDictionaryController + + + YES + + metadataDictionaryController + NSDictionaryController + + + sharingDictionaryController + NSDictionaryController + + + + + IBProjectSource + ./Classes/PithosObjectNodeInfoController.h + + + + SharingNameFormatter + NSFormatter + + IBProjectSource + ./Classes/SharingNameFormatter.h + + + - 0 IBCocoaFramework diff --git a/pithos-macos/PithosSubdirNode.m b/pithos-macos/PithosSubdirNode.m index 406d58c..9e2dfa3 100644 --- a/pithos-macos/PithosSubdirNode.m +++ b/pithos-macos/PithosSubdirNode.m @@ -42,6 +42,7 @@ #import "ASIPithosObject.h" #import "ASIDownloadCache.h" #import "PithosFileUtilities.h" +#import "PithosObjectNodeInfoController.h" static NSImage *sharedIcon = nil; @@ -165,13 +166,14 @@ static NSImage *sharedIcon = nil; return; } if (createObject) { + [[pithosNodeInfoController window] makeFirstResponder:nil]; applyMetadataObjectRequest = [[ASIPithosObjectRequest writeObjectDataRequestWithContainerName:pithosContainer.name objectName:prefix eTag:nil contentType:@"application/directory" - contentEncoding:nil - contentDisposition:nil - manifest:nil + contentEncoding:pithosObject.contentEncoding + contentDisposition:pithosObject.contentDisposition + manifest:pithosObject.manifest sharing:pithosObject.sharing isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) metadata:pithosObject.metadata @@ -183,11 +185,12 @@ static NSImage *sharedIcon = nil; [applyMetadataObjectRequest startAsynchronous]; } } else { + [[pithosNodeInfoController window] makeFirstResponder:nil]; applyMetadataObjectRequest = [[ASIPithosObjectRequest updateObjectMetadataRequestWithContainerName:pithosContainer.name objectName:pithosObject.name - contentEncoding:nil - contentDisposition:nil - manifest:nil + contentEncoding:pithosObject.contentEncoding + contentDisposition:pithosObject.contentDisposition + manifest:pithosObject.manifest sharing:pithosObject.sharing isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) metadata:pithosObject.metadata @@ -231,10 +234,11 @@ static NSImage *sharedIcon = nil; } [self refreshInfo]; } else if ([request isEqualTo:refreshMetadataObjectRequest]) { + [[pithosNodeInfoController window] makeFirstResponder:nil]; self.pithosObject = [refreshMetadataObjectRequest object]; if (refreshParent) { // Ask the parent for refresh for the case where an object was removed - // It is done here so that it doesn'e affect the info window refresh + // It is done here so that it doesn't affect the info window refresh [parent invalidateChildren]; [parent children]; refreshParent = NO; @@ -262,4 +266,15 @@ static NSImage *sharedIcon = nil; } } +#pragma mark - +#pragma mark Actions + +- (void)showPithosNodeInfo:(id)sender { + if (!pithosNodeInfoController) + pithosNodeInfoController = [[PithosObjectNodeInfoController alloc] initWithPithosNode:self]; + [pithosNodeInfoController showWindow:sender]; + [[pithosNodeInfoController window] makeKeyAndOrderFront:sender]; + [NSApp activateIgnoringOtherApps:YES]; +} + @end diff --git a/pithos-macos/PolicyVersioningTransformer.h b/pithos-macos/PolicyVersioningTransformer.h new file mode 100644 index 0000000..49b9963 --- /dev/null +++ b/pithos-macos/PolicyVersioningTransformer.h @@ -0,0 +1,39 @@ +// +// PolicyVersioningTransformer.h +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +@interface PolicyVersioningTransformer : NSValueTransformer +@end diff --git a/pithos-macos/PolicyVersioningTransformer.m b/pithos-macos/PolicyVersioningTransformer.m new file mode 100644 index 0000000..fba205c --- /dev/null +++ b/pithos-macos/PolicyVersioningTransformer.m @@ -0,0 +1,85 @@ +// +// PolicyVersioningTransformer.m +// pithos-macos +// +// Copyright 2011 GRNET S.A. All rights reserved. +// +// Redistribution and use in source and binary forms, with or +// without modification, are permitted provided that the following +// conditions are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and +// documentation are those of the authors and should not be +// interpreted as representing official policies, either expressed +// or implied, of GRNET S.A. + +#import "PolicyVersioningTransformer.h" + +@implementation PolicyVersioningTransformer + ++ (Class)transformedValueClass { + return [NSMutableDictionary class]; +} + ++ (BOOL)allowsReverseTransformation { + return YES; +} + +- (id)transformedValue:(id)value { + if (value == nil) + return @"manual"; + return [(NSDictionary *)value objectForKey:@"X-Container-Policy-Versioning"]; +} + +- (id)reverseTransformedValue:(id)value { + if (value == nil || ([(NSMutableDictionary *)value count] == 0)) + return nil; + + NSString *readSharingString = nil; + NSArray *readUsers = [(NSMutableDictionary *)value allKeysForObject:@"read"]; + if ([readUsers count]) + readSharingString = [NSString stringWithFormat:@"read=%@", [readUsers componentsJoinedByString:@","]]; + NSString *writeSharingString = nil; + + NSArray *writeUsers = [(NSMutableDictionary *)value allKeysForObject:@"write"]; + if ([writeUsers count]) + writeSharingString = [NSString stringWithFormat:@"write=%@", [writeUsers componentsJoinedByString:@","]]; + + + if (readSharingString) { + if (writeSharingString) { + return [NSString stringWithFormat:@"%@;%@", readSharingString, writeSharingString]; + } + return readSharingString; + } else { + return writeSharingString; + } +} + ++ (void)initialize { + [[NSValueTransformer class] setValueTransformer:[self new] forName:@"SharingDictionaryTransformer"]; +} + +@end