Implemented group preferences.
authorMiltiadis Vasilakis <mvasilak@gmail.com>
Thu, 6 Oct 2011 23:26:04 +0000 (02:26 +0300)
committerMiltiadis Vasilakis <mvasilak@gmail.com>
Thu, 6 Oct 2011 23:26:04 +0000 (02:26 +0300)
Initial implementation of download/upload activity progress and messages.

21 files changed:
pithos-apple-common
pithos-macos.xcodeproj/project.pbxproj
pithos-macos/GroupAndGroupMemberFormatter.h [new file with mode: 0644]
pithos-macos/GroupAndGroupMemberFormatter.m [new file with mode: 0644]
pithos-macos/GroupMembersDictionaryTransformer.h [new file with mode: 0644]
pithos-macos/GroupMembersDictionaryTransformer.m [new file with mode: 0644]
pithos-macos/PithosAccountNode.h
pithos-macos/PithosAccountNode.m
pithos-macos/PithosActivity.h [new file with mode: 0644]
pithos-macos/PithosActivity.m [new file with mode: 0644]
pithos-macos/PithosActivityFacility.h [new file with mode: 0644]
pithos-macos/PithosActivityFacility.m [new file with mode: 0644]
pithos-macos/PithosBrowserController.h
pithos-macos/PithosBrowserController.m
pithos-macos/PithosBrowserController.xib
pithos-macos/PithosFileUtilities.m
pithos-macos/PithosPreferencesController.h
pithos-macos/PithosPreferencesController.m
pithos-macos/PithosPreferencesController.xib
pithos-macos/SharingDictionaryTransformer.m
pithos-macos/en.lproj/MainMenu.xib

index b9ebc0f..78355da 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b9ebc0f4602b7937448a40169a68fe9acd0fe040
+Subproject commit 78355da33ddaffcb7bc9bd460cb38f184962f3bf
index fb4709b..a85a486 100644 (file)
@@ -41,6 +41,8 @@
                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 */; };
+               613629B5143E0F8B00363787 /* GroupMembersDictionaryTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 613629B4143E0F8B00363787 /* GroupMembersDictionaryTransformer.m */; };
+               613629B9143E51E000363787 /* GroupAndGroupMemberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 613629B8143E51E000363787 /* GroupAndGroupMemberFormatter.m */; };
                6139837113EFEECC004CE444 /* FileSystemBrowserCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6139837013EFEECC004CE444 /* FileSystemBrowserCell.m */; };
                61433BC9141BA1CE00CD978D /* HashMapHash.m in Sources */ = {isa = PBXBuildFile; fileRef = 61433BC8141BA1CE00CD978D /* HashMapHash.m */; };
                614592BC1417CE70002E7A8C /* ASIPithosAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = 614592BB1417CE70002E7A8C /* ASIPithosAccount.m */; };
@@ -55,6 +57,8 @@
                617460F1140BE45C00D333A1 /* BytesExtendedSizeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 617460F0140BE45C00D333A1 /* BytesExtendedSizeTransformer.m */; };
                6180C22B13FAEF4B00BCA40B /* BytesSizeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6180C22A13FAEF4B00BCA40B /* BytesSizeTransformer.m */; };
                6180C22E13FBF1FD00BCA40B /* LastModifiedDateTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6180C22D13FBF1FD00BCA40B /* LastModifiedDateTransformer.m */; };
+               618A7FD81438CE5D0040F043 /* PithosActivityFacility.m in Sources */ = {isa = PBXBuildFile; fileRef = 618A7FD71438CE5D0040F043 /* PithosActivityFacility.m */; };
+               618A7FF6143A20830040F043 /* PithosActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 618A7FF5143A20830040F043 /* PithosActivity.m */; };
                619B85D513F8077800C9371F /* PithosPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 619B85D313F8077100C9371F /* PithosPreferencesController.m */; };
                619B85D613F8077800C9371F /* PithosPreferencesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 619B85D413F8077300C9371F /* PithosPreferencesController.xib */; };
                61C24BBB1410D350007004DC /* PublicURLTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C24BBA1410D350007004DC /* PublicURLTransformer.m */; };
                611FFCB113EBF40900E43E18 /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageAndTextCell.h; path = "pithos-macos/ImageAndTextCell.h"; sourceTree = "<group>"; };
                611FFCB213EBF40900E43E18 /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ImageAndTextCell.m; path = "pithos-macos/ImageAndTextCell.m"; sourceTree = "<group>"; };
                6121250813F033F400063041 /* PithosBrowserPreviewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PithosBrowserPreviewController.xib; sourceTree = "<group>"; };
+               613629B3143E0F8B00363787 /* GroupMembersDictionaryTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupMembersDictionaryTransformer.h; path = "pithos-macos/GroupMembersDictionaryTransformer.h"; sourceTree = "<group>"; };
+               613629B4143E0F8B00363787 /* GroupMembersDictionaryTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupMembersDictionaryTransformer.m; path = "pithos-macos/GroupMembersDictionaryTransformer.m"; sourceTree = "<group>"; };
+               613629B7143E51E000363787 /* GroupAndGroupMemberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GroupAndGroupMemberFormatter.h; path = "pithos-macos/GroupAndGroupMemberFormatter.h"; sourceTree = "<group>"; };
+               613629B8143E51E000363787 /* GroupAndGroupMemberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GroupAndGroupMemberFormatter.m; path = "pithos-macos/GroupAndGroupMemberFormatter.m"; sourceTree = "<group>"; };
                6139836F13EFEECC004CE444 /* FileSystemBrowserCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemBrowserCell.h; path = "pithos-macos/FileSystemBrowserCell.h"; sourceTree = "<group>"; };
                6139837013EFEECC004CE444 /* FileSystemBrowserCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FileSystemBrowserCell.m; path = "pithos-macos/FileSystemBrowserCell.m"; sourceTree = "<group>"; };
                61433BC7141BA1CE00CD978D /* HashMapHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HashMapHash.h; path = "pithos-macos/HashMapHash.h"; sourceTree = "<group>"; };
                6180C22A13FAEF4B00BCA40B /* BytesSizeTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BytesSizeTransformer.m; path = "pithos-macos/BytesSizeTransformer.m"; sourceTree = "<group>"; };
                6180C22C13FBF1FC00BCA40B /* LastModifiedDateTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LastModifiedDateTransformer.h; path = "pithos-macos/LastModifiedDateTransformer.h"; sourceTree = "<group>"; };
                6180C22D13FBF1FD00BCA40B /* LastModifiedDateTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LastModifiedDateTransformer.m; path = "pithos-macos/LastModifiedDateTransformer.m"; sourceTree = "<group>"; };
+               618A7FD61438CE5D0040F043 /* PithosActivityFacility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosActivityFacility.h; sourceTree = "<group>"; };
+               618A7FD71438CE5D0040F043 /* PithosActivityFacility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosActivityFacility.m; sourceTree = "<group>"; };
+               618A7FF4143A20830040F043 /* PithosActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosActivity.h; sourceTree = "<group>"; };
+               618A7FF5143A20830040F043 /* PithosActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosActivity.m; sourceTree = "<group>"; };
                619B85D213F8076F00C9371F /* PithosPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PithosPreferencesController.h; sourceTree = "<group>"; };
                619B85D313F8077100C9371F /* PithosPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PithosPreferencesController.m; sourceTree = "<group>"; };
                619B85D413F8077300C9371F /* PithosPreferencesController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PithosPreferencesController.xib; sourceTree = "<group>"; };
                                611FFCAE13EBF0B900E43E18 /* PithosEmptyNode.m */,
                                61C24BEA14161EC0007004DC /* PithosFileUtilities.h */,
                                61C24BEB14161EC3007004DC /* PithosFileUtilities.m */,
+                               618A7FD61438CE5D0040F043 /* PithosActivityFacility.h */,
+                               618A7FD71438CE5D0040F043 /* PithosActivityFacility.m */,
+                               618A7FF4143A20830040F043 /* PithosActivity.h */,
+                               618A7FF5143A20830040F043 /* PithosActivity.m */,
                        );
                        path = "pithos-macos";
                        sourceTree = "<group>";
                                615A4450140F8A7F00308614 /* MetadataKeyFormatter.m */,
                                61C24BBF14110BDB007004DC /* SharingNameFormatter.h */,
                                61C24BC014110BDB007004DC /* SharingNameFormatter.m */,
+                               613629B7143E51E000363787 /* GroupAndGroupMemberFormatter.h */,
+                               613629B8143E51E000363787 /* GroupAndGroupMemberFormatter.m */,
                        );
                        name = Formatters;
                        sourceTree = "<group>";
                                6152D094143334E000803874 /* SharingAccountBoolTransformer.m */,
                                6152D090143334CC00803874 /* AllowedToBoolTransformer.h */,
                                6152D091143334CC00803874 /* AllowedToBoolTransformer.m */,
+                               613629B3143E0F8B00363787 /* GroupMembersDictionaryTransformer.h */,
+                               613629B4143E0F8B00363787 /* GroupMembersDictionaryTransformer.m */,
                        );
                        name = "Value Transformers";
                        sourceTree = "<group>";
                                6152D08C143200CC00803874 /* PithosSharingAccountsNode.m in Sources */,
                                6152D092143334CC00803874 /* AllowedToBoolTransformer.m in Sources */,
                                6152D095143334E000803874 /* SharingAccountBoolTransformer.m in Sources */,
+                               618A7FD81438CE5D0040F043 /* PithosActivityFacility.m in Sources */,
+                               618A7FF6143A20830040F043 /* PithosActivity.m in Sources */,
+                               613629B5143E0F8B00363787 /* GroupMembersDictionaryTransformer.m in Sources */,
+                               613629B9143E51E000363787 /* GroupAndGroupMemberFormatter.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/pithos-macos/GroupAndGroupMemberFormatter.h b/pithos-macos/GroupAndGroupMemberFormatter.h
new file mode 100644 (file)
index 0000000..84d5a18
--- /dev/null
@@ -0,0 +1,41 @@
+//
+//  GroupAndGroupMemberFormatter.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 <Foundation/Foundation.h>
+
+@interface GroupAndGroupMemberFormatter : NSFormatter
+@end
diff --git a/pithos-macos/GroupAndGroupMemberFormatter.m b/pithos-macos/GroupAndGroupMemberFormatter.m
new file mode 100644 (file)
index 0000000..f3e0f39
--- /dev/null
@@ -0,0 +1,72 @@
+//
+//  GroupAndGroupMemberFormatter.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 "GroupAndGroupMemberFormatter.h"
+
+@implementation GroupAndGroupMemberFormatter
+
+- (NSString *)stringForObjectValue:(id)anObject {
+       if (anObject != nil)
+               return [NSString stringWithString:anObject];
+       return nil;
+}
+
+- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error {
+       *anObject = [NSString stringWithString:string];
+       return YES;
+}
+
+- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error {
+       if ([partialString length] == 0) {
+        *newString = nil;
+        return NO;
+    }
+    
+       unichar aChar;  
+       for (int i = 0; i < [partialString length]; i++) {
+               aChar = [partialString characterAtIndex:i];
+               if ((aChar == ' ') || (aChar == ',') || (aChar == '=')) {
+                       *newString = nil;
+                       return NO;
+               }
+       }
+    
+       *newString = [partialString lowercaseString];
+       return NO;
+}
+
+@end
diff --git a/pithos-macos/GroupMembersDictionaryTransformer.h b/pithos-macos/GroupMembersDictionaryTransformer.h
new file mode 100644 (file)
index 0000000..52a0d09
--- /dev/null
@@ -0,0 +1,41 @@
+//
+//  GroupMembersArrayTransformer.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 <Foundation/Foundation.h>
+
+@interface GroupMembersDictionaryTransformer : NSValueTransformer 
+@end
diff --git a/pithos-macos/GroupMembersDictionaryTransformer.m b/pithos-macos/GroupMembersDictionaryTransformer.m
new file mode 100644 (file)
index 0000000..5eba1a1
--- /dev/null
@@ -0,0 +1,77 @@
+//
+//  GroupMembersArrayTransformer.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 "GroupMembersDictionaryTransformer.h"
+
+@implementation GroupMembersDictionaryTransformer
+
++ (Class)transformedValueClass {
+       return [NSMutableDictionary class];}
+
++ (BOOL)allowsReverseTransformation {
+       return YES;
+}
+
+- (id)transformedValue:(id)value {
+    NSMutableDictionary *groupMembersDictionary = [NSMutableDictionary dictionary];
+    if (value != nil) {
+        for (NSString *groupMember in [(NSString *)value componentsSeparatedByString:@","]) {
+            if ([groupMember length])
+                [groupMembersDictionary setObject:@"" forKey:groupMember];
+        }
+    }
+    return groupMembersDictionary;
+}
+
+- (id)reverseTransformedValue:(id)value {
+    NSMutableString *groupMembersString = [NSMutableString string];
+    if ((value != nil) || [(NSMutableDictionary *)value count]) {
+        for (NSString *groupMember in [(NSMutableDictionary *)value keyEnumerator]) {
+            if ([groupMember length])
+                [groupMembersString appendFormat:@"%@,", groupMember];
+        }
+        if ([groupMembersString hasSuffix:@","])
+            [groupMembersString deleteCharactersInRange:NSMakeRange(([groupMembersString length] - 1), 1)];
+    }
+    return groupMembersString;
+}
+
++ (void)initialize {
+    [[NSValueTransformer class] setValueTransformer:[self new] forName:@"GroupMembersDictionaryTransformer"];
+}
+
+@end
index e9abf01..6c77ab8 100644 (file)
 
 #import "PithosNode.h"
 @class ASIPithosAccountRequest;
+@class ASIPithosAccount;
 
 @interface PithosAccountNode : PithosNode {
+    ASIPithosAccount *pithosAccount;
+    
     NSMutableArray *containers;
     ASIPithosAccountRequest *accountRequest;
+    
+    ASIPithosAccountRequest *applyMetadataAccountRequest;
+    ASIPithosAccountRequest *refreshMetadataAccountRequest;
 }
 
+@property(nonatomic, retain) ASIPithosAccount *pithosAccount;
+
+- (void)applyInfo;
+- (void)refreshInfo;
+
 @end
\ No newline at end of file
index 14d0642..639e344 100644 (file)
@@ -38,6 +38,7 @@
 #import "PithosAccountNode.h"
 #import "PithosContainerNode.h"
 #import "ASIPithosAccountRequest.h"
+#import "ASIPithosAccount.h"
 #import "ASIPithosContainer.h"
 #import "ASIDownloadCache.h"
 #import "PithosFileUtilities.h"
@@ -45,6 +46,7 @@
 static NSImage *sharedIcon = nil;
 
 @implementation PithosAccountNode
+@synthesize pithosAccount;
 
 + (void)initialize {
        if (self == [PithosAccountNode class])
@@ -57,7 +59,12 @@ static NSImage *sharedIcon = nil;
 - (void)dealloc {
     [accountRequest clearDelegatesAndCancel];
     [accountRequest release];
+    [refreshMetadataAccountRequest clearDelegatesAndCancel];
+    [refreshMetadataAccountRequest release];
+    [applyMetadataAccountRequest clearDelegatesAndCancel];
+    [applyMetadataAccountRequest release];
     [containers release];
+    [pithosAccount release];
     [super dealloc];
 }
 
@@ -126,6 +133,8 @@ static NSImage *sharedIcon = nil;
 - (void)accountRequestFinished:(ASIPithosAccountRequest *)request {
     NSLog(@"URL: %@", [accountRequest url]);
     NSLog(@"cached: %d", [accountRequest didUseCachedResponse]);
+
+    self.pithosAccount = [accountRequest account];
     
     NSArray *someContainers = [accountRequest containers];
     if (containers == nil) {
@@ -203,4 +212,72 @@ static NSImage *sharedIcon = nil;
     }
 }
 
+- (void)accountMetadataRequestFinished:(ASIPithosAccountRequest *)request {
+    NSLog(@"URL: %@", [request url]);
+    NSLog(@"cached: %d", [request didUseCachedResponse]);
+    
+    if ([request isEqualTo:applyMetadataAccountRequest]) {
+        @synchronized(self) {
+            [applyMetadataAccountRequest release];
+            applyMetadataAccountRequest = nil;
+        }
+        [self refreshInfo];
+    } else if ([request isEqualTo:refreshMetadataAccountRequest]) {
+        self.pithosAccount = [refreshMetadataAccountRequest account];
+        @synchronized(self) {
+            [refreshMetadataAccountRequest release];
+            refreshMetadataAccountRequest = nil;
+        }
+    }
+}
+
+- (void)accountMetadataRequestFailed:(ASIPithosAccountRequest *)request {
+    if ([request isEqualTo:applyMetadataAccountRequest]) {
+        [PithosFileUtilities httpRequestErrorAlertWithRequest:applyMetadataAccountRequest];
+        @synchronized(self) {
+            [applyMetadataAccountRequest release];
+            applyMetadataAccountRequest = nil;
+        }
+    } else if ([request isEqualTo:refreshMetadataAccountRequest]) {
+        [PithosFileUtilities httpRequestErrorAlertWithRequest:refreshMetadataAccountRequest];
+        @synchronized(self) {
+            [refreshMetadataAccountRequest release];
+            refreshMetadataAccountRequest = nil;
+        }
+    }
+}
+
+#pragma mark -
+#pragma mark Info
+
+- (void)applyInfo {
+    @synchronized(self) {
+        if (applyMetadataAccountRequest == nil) {
+            NSMutableDictionary *groups = pithosAccount.groups;
+            if ([groups count] == 0)
+                groups = [NSMutableDictionary dictionaryWithObject:@"" forKey:@"group"];
+            applyMetadataAccountRequest = [[ASIPithosAccountRequest updateAccountMetadataRequestWithGroups:groups 
+                                                                                                  metadata:pithosAccount.metadata 
+                                                                                                    update:NO] retain];
+            applyMetadataAccountRequest.delegate = self;
+            applyMetadataAccountRequest.didFinishSelector = @selector(accountMetadataRequestFinished:);
+            applyMetadataAccountRequest.didFailSelector = @selector(accountMetadataRequestFailed:);
+            [applyMetadataAccountRequest startAsynchronous];
+        }
+    }
+}
+
+- (void)refreshInfo {
+    @synchronized(self) {
+        if (refreshMetadataAccountRequest == nil) {
+            refreshMetadataAccountRequest = [[ASIPithosAccountRequest accountMetadataRequest] retain];
+            refreshMetadataAccountRequest.delegate = self;
+            refreshMetadataAccountRequest.didFinishSelector = @selector(accountMetadataRequestFinished:);
+            refreshMetadataAccountRequest.didFailSelector = @selector(accountMetadataRequestFailed:);
+            refreshMetadataAccountRequest.downloadCache = [ASIDownloadCache sharedCache];
+            [refreshMetadataAccountRequest startAsynchronous];
+        }
+    }
+}
+
 @end
diff --git a/pithos-macos/PithosActivity.h b/pithos-macos/PithosActivity.h
new file mode 100644 (file)
index 0000000..44aa504
--- /dev/null
@@ -0,0 +1,59 @@
+//
+//  PithosActivity.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 <Foundation/Foundation.h>
+
+typedef enum  {
+    PithosActivityUpload,
+    PithosActivityDownload
+} PithosActivityType;
+
+@interface PithosActivity : NSObject {
+    PithosActivityType type;
+    NSString *message;
+    NSUInteger totalBytes;
+    NSUInteger currentBytes;
+}
+
+- (id)initWithType:(PithosActivityType)aType;
+
+@property (nonatomic, assign) PithosActivityType type;
+@property (nonatomic, copy) NSString *message;
+@property (nonatomic, assign) NSUInteger totalBytes;
+@property (nonatomic, assign) NSUInteger currentBytes;
+
+@end
diff --git a/pithos-macos/PithosActivity.m b/pithos-macos/PithosActivity.m
new file mode 100644 (file)
index 0000000..327a106
--- /dev/null
@@ -0,0 +1,65 @@
+//
+//  PithosActivity.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 "PithosActivity.h"
+
+@implementation PithosActivity
+@synthesize type, message, totalBytes, currentBytes;
+
+#pragma mark -
+#pragma mark Object Lifecycle
+
+- (id)initWithType:(PithosActivityType)aType {
+    if ((self = [super init])) {
+        type = aType;
+        totalBytes = 0;
+        currentBytes = 0;
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [message release];
+    [super dealloc];
+}
+
+- (NSString *)description {
+    return [NSString stringWithFormat:@"type: %lu, message: %@, totalBytes: %lu, currentBytes: %lu", 
+            type, message, totalBytes, currentBytes];
+}
+
+@end
diff --git a/pithos-macos/PithosActivityFacility.h b/pithos-macos/PithosActivityFacility.h
new file mode 100644 (file)
index 0000000..ce71d16
--- /dev/null
@@ -0,0 +1,78 @@
+//
+//  PithosActivityFacility.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 <Foundation/Foundation.h>
+#import "PithosActivity.h"
+
+@protocol PithosActivityFacilityDelegate <NSObject>
+@required
+- (void)activityUpdate:(NSDictionary *)info;
+@end
+
+@interface PithosActivityFacility : NSObject {
+    NSMutableArray *runningActivities;
+    NSMutableArray *endingActivities;
+    NSUInteger totalUploadBytes;
+    NSUInteger currentUploadBytes;
+    NSUInteger totalDownloadBytes;
+    NSUInteger currentDownloadBytes;
+
+    NSTimer *timer;
+    BOOL pickedRunning;
+    
+    id<PithosActivityFacilityDelegate> delegate;
+}
+
+@property (nonatomic, assign) id delegate;
+
++ (id)defaultPithosActivityFacility;
+
+- (void)reset;
+- (PithosActivity *)startActivityWithType:(PithosActivityType)type 
+                                  message:(NSString *)message 
+                               totalBytes:(NSUInteger)totalBytes 
+                             currentBytes:(NSUInteger)currentBytes;
+- (void)updateActivity:(PithosActivity *)activity 
+           withMessage:(NSString *)message 
+            totalBytes:(NSUInteger)totalBytes 
+          currentBytes:(NSUInteger)currentBytes;
+- (void)endActivity:(PithosActivity *)activity 
+        withMessage:(NSString *)message 
+         totalBytes:(NSUInteger)totalBytes 
+       currentBytes:(NSUInteger)currentBytes;
+
+@end
\ No newline at end of file
diff --git a/pithos-macos/PithosActivityFacility.m b/pithos-macos/PithosActivityFacility.m
new file mode 100644 (file)
index 0000000..b3b0a52
--- /dev/null
@@ -0,0 +1,282 @@
+//
+//  PithosActivityFacility.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 "PithosActivityFacility.h"
+
+static PithosActivityFacility *defaultPithosActivityFacility = nil;
+
+@implementation PithosActivityFacility
+@synthesize delegate;
+
+#pragma mark -
+#pragma mark - Singleton
+
++ (id)defaultPithosActivityFacility {
+       @synchronized(self) {
+               if (!defaultPithosActivityFacility)
+                       [[self alloc] init]; // Assignment not done here
+       }
+       return defaultPithosActivityFacility;
+}
+
++ (id)allocWithZone:(NSZone *)zone {
+    @synchronized(self) {
+        if (!defaultPithosActivityFacility) {
+            defaultPithosActivityFacility = [super allocWithZone:zone];
+            return defaultPithosActivityFacility;
+        }
+    }
+    return nil;
+}
+
+- (id)copyWithZone:(NSZone *)zone {
+    return self;
+}
+
+- (id)retain {
+    return self;
+}
+
+- (NSUInteger)retainCount {
+    return UINT_MAX; // Can not be released
+}
+
+- (void)release {
+    // Do nothing
+}
+
+- (id)autorelease {
+    return self;
+}
+
+#pragma mark -
+#pragma mark Object Lifecycle
+
+- (id)init {
+    if ((self = [super init])) {
+        [self reset];
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [timer invalidate];
+    [timer release];
+    [runningActivities release];
+    [endingActivities release];
+    [super dealloc];
+}
+
+- (void)reset {
+    @synchronized(self) {
+        [timer invalidate];
+        [timer release];
+        
+        [runningActivities release];
+        runningActivities = [[NSMutableArray alloc] init];
+        [endingActivities release];
+        endingActivities = [[NSMutableArray alloc] init];
+        totalUploadBytes = 0;
+        currentUploadBytes = 0;
+        totalDownloadBytes = 0;
+        currentDownloadBytes = 0;
+        
+        pickedRunning = NO;
+        
+        timer = [[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(update:) userInfo:nil repeats:YES] retain];
+    }
+}
+
+- (NSString *)description {
+    return [NSString stringWithFormat:@"running activities: %lu, ending activities: %lu, totalUploadBytes: %lu, currentUploadBytes: %lu, totalDownloadBytes: %lu, currentDownloadBytes: %lu", 
+            [runningActivities count], [endingActivities count], totalUploadBytes, currentUploadBytes, totalDownloadBytes, currentDownloadBytes];
+}
+
+#pragma mark -
+#pragma mark Timer
+
+- (void)update:(NSTimer *)aTimer {
+    NSMutableDictionary *info = [NSMutableDictionary dictionary];
+    @synchronized(self) {
+        PithosActivity *activity = nil;
+        NSUInteger endingActivitiesCount = [endingActivities count];
+        NSUInteger runningActivitiesCount = [runningActivities count];
+        if ((pickedRunning || !runningActivitiesCount) && endingActivitiesCount) {
+            NSUInteger index;
+            for (index = 0 ; index < endingActivitiesCount; index++) {
+                activity = [endingActivities objectAtIndex:index];
+                switch (activity.type) {
+                    case PithosActivityUpload:
+                        totalUploadBytes -= activity.totalBytes;
+                        currentUploadBytes -= activity.currentBytes;
+                        break;
+                    case PithosActivityDownload:
+                        totalDownloadBytes -= activity.totalBytes;
+                        currentDownloadBytes -= activity.currentBytes;
+                        break;
+                    default:
+                        break;
+                }
+                [activity retain];
+                if (activity.message)
+                    break;
+            }
+            [endingActivities removeObjectsInRange:NSMakeRange(0, (index + 1))];
+            pickedRunning = NO;
+        } else if (runningActivitiesCount) {
+            NSUInteger count;
+            for (count = 0 ; count < runningActivitiesCount; count++) {
+                activity = [runningActivities objectAtIndex:0];
+                [runningActivities removeObjectAtIndex:0];
+                [runningActivities addObject:activity];
+                if (activity.message)
+                    break;
+            }
+            [activity retain];
+            pickedRunning = YES;
+        }
+        if (activity && activity.message)
+            [info setObject:activity.message forKey:@"message"];
+        [info setObject:[NSNumber numberWithUnsignedInteger:[runningActivities count]] forKey:@"runningActivitiesCount"];
+        [info setObject:[NSNumber numberWithUnsignedInteger:[endingActivities count]] forKey:@"endingActivitiesCount"];
+        [info setObject:[NSNumber numberWithUnsignedInteger:totalUploadBytes] forKey:@"totalUploadBytes"];
+        [info setObject:[NSNumber numberWithUnsignedInteger:currentUploadBytes] forKey:@"currentUploadBytes"];
+        [info setObject:[NSNumber numberWithUnsignedInteger:totalDownloadBytes] forKey:@"totalDownloadBytes"];
+        [info setObject:[NSNumber numberWithUnsignedInteger:currentDownloadBytes] forKey:@"currentDownloadBytes"];
+        [activity release];
+        NSLog(@"PithosActivityFacility update: %@", info);
+    }
+    if (delegate) {
+        [delegate activityUpdate:info];
+    }
+}
+
+#pragma mark -
+#pragma mark Activity Actions
+
+- (PithosActivity *)startActivityWithType:(PithosActivityType)type 
+                                  message:(NSString *)message 
+                               totalBytes:(NSUInteger)totalBytes 
+                               currentBytes:(NSUInteger)currentBytes {
+    PithosActivity *activity = [[[PithosActivity alloc] initWithType:type] autorelease];
+    activity.message = message;
+    activity.totalBytes = totalBytes;
+    activity.currentBytes = currentBytes;
+    NSLog(@"PithosActivityFacility startedActivity %@", activity);
+    
+    switch (type) {
+        case PithosActivityUpload:
+            @synchronized(self) {
+                totalUploadBytes += totalBytes;
+                currentUploadBytes += currentBytes;
+            }
+            break;
+        case PithosActivityDownload:
+            @synchronized(self) {
+                totalDownloadBytes += totalBytes;
+                currentDownloadBytes += currentBytes;
+            }
+            break;
+        default:
+            break;
+    }
+    
+    @synchronized(self) {
+        [runningActivities addObject:activity];
+    }
+    NSLog(@"PithosActivityFacility %@", self);
+    
+    return activity;
+}
+
+- (void)updateActivity:(PithosActivity *)activity 
+           withMessage:(NSString *)message 
+            totalBytes:(NSUInteger)totalBytes 
+          currentBytes:(NSUInteger)currentBytes {
+    NSLog(@"PithosActivityFacility updatedActivity %@", activity);
+    @synchronized(self) {
+        activity.message = message;
+        switch (activity.type) {
+            case PithosActivityUpload:
+                totalUploadBytes += totalBytes - activity.totalBytes;
+                activity.totalBytes = totalBytes;
+                currentUploadBytes += currentBytes - activity.currentBytes;
+                activity.currentBytes = currentBytes;
+                break;
+            case PithosActivityDownload:
+                totalDownloadBytes += totalBytes - activity.totalBytes;
+                activity.totalBytes = totalBytes;
+                currentDownloadBytes += currentBytes - activity.currentBytes;
+                activity.currentBytes = currentBytes;
+                break;
+            default:
+                break;
+        }
+    }
+    NSLog(@"PithosActivityFacility %@", self);
+}
+
+- (void)endActivity:(PithosActivity *)activity 
+        withMessage:(NSString *)message 
+         totalBytes:(NSUInteger)totalBytes 
+       currentBytes:(NSUInteger)currentBytes {
+    @synchronized(self) {
+        [runningActivities removeObject:activity];
+        activity.message = message;
+        switch (activity.type) {
+            case PithosActivityUpload:
+                totalUploadBytes += totalBytes - activity.totalBytes;
+                activity.totalBytes = totalBytes;
+                currentUploadBytes += currentBytes - activity.currentBytes;
+                activity.currentBytes = currentBytes;
+                break;
+            case PithosActivityDownload:
+                totalDownloadBytes += totalBytes - activity.totalBytes;
+                activity.totalBytes = totalBytes;
+                currentDownloadBytes += currentBytes - activity.currentBytes;
+                activity.currentBytes = currentBytes;
+                break;
+            default:
+                break;
+        }
+        [endingActivities addObject:activity];
+    }
+    NSLog(@"PithosActivityFacility endedActivity %@", activity);
+    NSLog(@"PithosActivityFacility %@", self);
+}
+
+@end
index 6bf0dfe..3e107df 100644 (file)
 // or implied, of GRNET S.A.
 
 #import <Cocoa/Cocoa.h>
+#import "PithosActivityFacility.h"
 @class PithosNode;
 @class PithosAccountNode;
 @class PithosSharingAccountsNode;
 @class PithosEmptyNode;
+@class PithosActivityFacility;
 
-@interface PithosBrowserController : NSWindowController <NSBrowserDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSOutlineViewDataSource, NSMenuDelegate> {
+@interface PithosBrowserController : NSWindowController <NSBrowserDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSOutlineViewDataSource, NSMenuDelegate, PithosActivityFacilityDelegate> {
     PithosNode *rootNode;
     PithosAccountNode *accountNode;
     PithosEmptyNode *containersNode;
     NSArray *clipboardNodes;
     PithosNode *clipboardParentNode;
     BOOL clipboardCopy;
+    
+    NSTextField *activityTextField;
+    NSProgressIndicator *activityProgressIndicator;
+    PithosActivityFacility *activityFacility;
 }
 
+@property (nonatomic, readonly) PithosAccountNode *accountNode;
+
 @property (nonatomic, assign) IBOutlet NSSplitView *verticalSplitView;
 @property (nonatomic, assign) IBOutlet NSSplitView *horizontalSplitView;
 @property (nonatomic, assign) IBOutlet NSView *leftTopView;
@@ -84,6 +92,9 @@
 @property (nonatomic, retain) PithosNode *clipboardParentNode;
 @property (nonatomic, assign) BOOL clipboardCopy;
 
+@property (nonatomic, assign) IBOutlet NSTextField *activityTextField;
+@property (nonatomic, assign) IBOutlet NSProgressIndicator *activityProgressIndicator;
+
 - (IBAction)refresh:(id)sender;
 
 @end
index f7c3f5d..dc5832d 100644 (file)
 #import "ASIPithosRequest.h"
 #import "ASIPithosContainerRequest.h"
 #import "ASIPithosObjectRequest.h"
+#import "ASIPithosAccount.h"
 #import "ASIPithosContainer.h"
 #import "ASIPithosObject.h"
 #import "PithosFileUtilities.h"
+#import "BytesExtendedSizeTransformer.h"
 
 @interface PithosBrowserCell : FileSystemBrowserCell {}
 @end
 @end
 
 @implementation PithosBrowserController
+@synthesize accountNode;
 @synthesize verticalSplitView, horizontalSplitView, leftTopView, leftBottomView, outlineView, browser;
 @synthesize draggedNodes, draggedParentNode;
 @synthesize clipboardNodes, clipboardParentNode, clipboardCopy;
+@synthesize activityTextField, activityProgressIndicator;
 
 #pragma mark -
 #pragma Object Lifecycle
     [accountNode refresh];
     [mySharedNode refresh];
     [othersSharedNode refresh];
+    
+    [activityFacility reset];
 }
 
 - (void)windowDidLoad {
     [super windowDidLoad];
     
+    [activityProgressIndicator setUsesThreadedAnimation:YES];
+    [activityProgressIndicator setMinValue:0.0];
+    [activityProgressIndicator setMaxValue:1.0];
+    activityFacility = [PithosActivityFacility defaultPithosActivityFacility];
+    activityFacility.delegate = self;
+    
     accountNode = [[PithosAccountNode alloc] init];
     containersNode = [[PithosEmptyNode alloc] initWithDisplayName:@"CONTAINERS" icon:nil];
     containersNodeChildren = [[NSMutableArray alloc] init];
@@ -544,6 +556,11 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
                             objectRequest.delegate = self;
                             objectRequest.didFinishSelector = @selector(downloadObjectFinished:);
                             objectRequest.didFailSelector = @selector(downloadObjectFailed:);
+                            PithosActivity *activity = [activityFacility startActivityWithType:PithosActivityDownload 
+                                                                                       message:[NSString stringWithFormat:@"Downloading '%@' (0%%)", [objectRequest.userInfo objectForKey:@"fileName"]] 
+                                                                                    totalBytes:[[objectRequest.userInfo objectForKey:@"bytes"] unsignedIntegerValue] 
+                                                                                  currentBytes:0];
+                            [(NSMutableDictionary *)objectRequest.userInfo setObject:activity forKey:@"activity"];
                             [objectRequest startAsynchronous];
                         }
                     }
@@ -560,6 +577,11 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
                 objectRequest.delegate = self;
                 objectRequest.didFinishSelector = @selector(downloadObjectFinished:);
                 objectRequest.didFailSelector = @selector(downloadObjectFailed:);
+                PithosActivity *activity = [activityFacility startActivityWithType:PithosActivityDownload 
+                                                                           message:[NSString stringWithFormat:@"Downloading '%@' (0%%)", [objectRequest.userInfo valueForKey:@"fileName"]]
+                                                                        totalBytes:node.pithosObject.bytes 
+                                                                      currentBytes:0];
+                [(NSMutableDictionary *)objectRequest.userInfo setObject:activity forKey:@"activity"];
                 [objectRequest startAsynchronous];
             }
         }
@@ -732,20 +754,25 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
                         objectRequest.delegate = self;
                         objectRequest.didFinishSelector = @selector(uploadObjectUsingHashMapFinished:);
                         objectRequest.didFailSelector = @selector(uploadObjectUsingHashMapFailed:);
-                        NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
-                                                         containerName, @"containerName", 
-                                                         objectName, @"objectName", 
-                                                         contentType, @"contentType", 
-                                                         [NSNumber numberWithUnsignedInteger:blockSize], @"blockSize", 
-                                                         blockHash, @"blockHash", 
-                                                         filePath, @"filePath", 
-                                                         hashes, @"hashes", 
-                                                         destinationNode, @"node", 
-                                                         [NSNumber numberWithUnsignedInteger:10], @"iteration", 
-                                                         nil];
+                        PithosActivity *activity = [activityFacility startActivityWithType:PithosActivityUpload 
+                                                                                   message:[NSString stringWithFormat:@"Uploading '%@' (0%%)", [objectRequest.userInfo valueForKey:@"fileName"]]
+                                                                                totalBytes:[[objectRequest.userInfo valueForKey:@"bytes"] unsignedIntegerValue]
+                                                                              currentBytes:0];
+                        [(NSMutableDictionary *)objectRequest.userInfo addEntriesFromDictionary:
+                         [NSDictionary dictionaryWithObjectsAndKeys:
+                          containerName, @"containerName", 
+                          objectName, @"objectName", 
+                          contentType, @"contentType", 
+                          [NSNumber numberWithUnsignedInteger:blockSize], @"blockSize", 
+                          blockHash, @"blockHash", 
+                          filePath, @"filePath", 
+                          hashes, @"hashes", 
+                          destinationNode, @"node", 
+                          [NSNumber numberWithUnsignedInteger:10], @"iteration", 
+                          activity, @"activity", 
+                          nil]];
                         if (destinationNode.sharingAccount)
-                            [userInfo setObject:destinationNode.sharingAccount forKey:@"sharingAccount"];
-                        objectRequest.userInfo = userInfo;
+                            [(NSMutableDictionary *)objectRequest.userInfo setObject:destinationNode.sharingAccount forKey:@"sharingAccount"];
                         [objectRequest startAsynchronous];
                     }
                 });
@@ -790,19 +817,24 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
                                 objectRequest.delegate = self;
                                 objectRequest.didFinishSelector = @selector(uploadObjectUsingHashMapFinished:);
                                 objectRequest.didFailSelector = @selector(uploadObjectUsingHashMapFailed:);
-                                NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
-                                                                 containerName, @"containerName", 
-                                                                 [objectNames objectAtIndex:i], @"objectName", 
-                                                                 [contentTypes objectAtIndex:i], @"contentType", 
-                                                                 [NSNumber numberWithUnsignedInteger:blockSize], @"blockSize", 
-                                                                 blockHash, @"blockHash", 
-                                                                 [filePaths objectAtIndex:i], @"filePath", 
-                                                                 [hashesArrays objectAtIndex:i], @"hashes", 
-                                                                 [NSNumber numberWithUnsignedInteger:10], @"iteration", 
-                                                                 nil];
+                                PithosActivity *activity = [activityFacility startActivityWithType:PithosActivityUpload 
+                                                                                           message:[NSString stringWithFormat:@"Uploading '%@' (0%%)", [objectRequest.userInfo valueForKey:@"fileName"]]
+                                                                                        totalBytes:[[objectRequest.userInfo valueForKey:@"bytes"] unsignedIntegerValue]
+                                                                                      currentBytes:0];
+                                [(NSMutableDictionary *)objectRequest.userInfo addEntriesFromDictionary:
+                                 [NSDictionary dictionaryWithObjectsAndKeys:
+                                  containerName, @"containerName", 
+                                  [objectNames objectAtIndex:i], @"objectName", 
+                                  [contentTypes objectAtIndex:i], @"contentType", 
+                                  [NSNumber numberWithUnsignedInteger:blockSize], @"blockSize", 
+                                  blockHash, @"blockHash", 
+                                  [filePaths objectAtIndex:i], @"filePath", 
+                                  [hashesArrays objectAtIndex:i], @"hashes", 
+                                  [NSNumber numberWithUnsignedInteger:10], @"iteration", 
+                                  activity, @"activity", 
+                                  nil]];
                                 if (destinationNode.sharingAccount)
-                                    [userInfo setObject:destinationNode.sharingAccount forKey:@"sharingAccount"];
-                                objectRequest.userInfo = userInfo;
+                                    [(NSMutableDictionary *)objectRequest.userInfo setObject:destinationNode.sharingAccount forKey:@"sharingAccount"];
                                 [objectRequest startAsynchronous];
                             }
                         }
@@ -961,11 +993,19 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
 
 - (void)downloadObjectFinished:(ASIPithosObjectRequest *)objectRequest {
     NSLog(@"Download completed: %@", [objectRequest url]);
+    
+    NSString *fileName = [objectRequest.userInfo objectForKey:@"fileName"];
+    NSString *filePath = [objectRequest.userInfo objectForKey:@"filePath"];
+    PithosActivity *activity = [objectRequest.userInfo objectForKey:@"activity"];
+    NSString *activityMessage;
+    NSUInteger totalBytes = activity.totalBytes;
+    NSUInteger currentBytes = activity.currentBytes;
+    
     if (objectRequest.responseStatusCode == 200) {
+        // XXX change contentLength to objectContentLength if it is fixed in the server
         if (([objectRequest contentLength] == 0) && (![[objectRequest contentType] isEqualToString:@"application/directory"])) {
             NSLog(@"Downloaded  0 bytes");
             NSFileManager *defaultManager = [NSFileManager defaultManager];
-            NSString *filePath = [objectRequest.userInfo objectForKey:@"filePath"];
             if (![defaultManager fileExistsAtPath:filePath]) {
                 if (![defaultManager createFileAtPath:filePath contents:nil attributes:nil]) {
                     NSAlert *alert = [[[NSAlert alloc] init] autorelease];
@@ -976,14 +1016,30 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
                 }
             }
         }
+        
+        currentBytes = [objectRequest objectContentLength];
+        if (currentBytes == 0)
+            currentBytes = totalBytes;
+        activityMessage = [NSString stringWithFormat:@"Downloading '%@' (100%%)", fileName];
+        
     } else {
         [PithosFileUtilities unexpectedResponseStatusAlertWithRequest:objectRequest];
+        
+        activityMessage = [NSString stringWithFormat:@"Downloading '%@' (failed)", fileName];
     }
+    
+    [activityFacility endActivity:activity withMessage:activityMessage totalBytes:totalBytes currentBytes:currentBytes];
 }
 
 - (void)downloadObjectFailed:(ASIPithosObjectRequest *)objectRequest {
     NSLog(@"Download failed");
+    NSString *fileName = [objectRequest.userInfo objectForKey:@"fileName"];
+    PithosActivity *activity = [objectRequest.userInfo objectForKey:@"activity"];
     [PithosFileUtilities httpRequestErrorAlertWithRequest:objectRequest];
+    [activityFacility endActivity:activity 
+                      withMessage:[NSString stringWithFormat:@"Downloading '%@' (failed)", fileName] 
+                       totalBytes:activity.totalBytes 
+                     currentBytes:activity.currentBytes];
 }
 
 - (void)uploadDirectoryObjectFinished:(ASIPithosObjectRequest *)objectRequest {
@@ -1003,8 +1059,16 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
 
 - (void)uploadObjectUsingHashMapFinished:(ASIPithosObjectRequest *)objectRequest {
     NSLog(@"Upload using hashmap completed: %@", [objectRequest url]);
+    NSString *fileName = [objectRequest.userInfo objectForKey:@"fileName"];
+    PithosActivity *activity = [objectRequest.userInfo objectForKey:@"activity"];
+    NSUInteger totalBytes = activity.totalBytes;
+    NSUInteger currentBytes = activity.currentBytes;
     if (objectRequest.responseStatusCode == 201) {
         NSLog(@"Object created: %@", [objectRequest url]);
+        [activityFacility endActivity:activity 
+                          withMessage:[NSString stringWithFormat:@"Uploading '%@' (100%%)", fileName] 
+                           totalBytes:totalBytes 
+                         currentBytes:totalBytes];
         PithosNode *node = [objectRequest.userInfo objectForKey:@"node"];
         if (node)
             [node refresh];
@@ -1014,10 +1078,14 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
         NSUInteger iteration = [[objectRequest.userInfo objectForKey:@"iteration"] unsignedIntegerValue] - 1;
         if (iteration == 0) {
             NSLog(@"Upload iteration limit reached: %@", [objectRequest url]);
+            [activityFacility endActivity:activity 
+                              withMessage:[NSString stringWithFormat:@"Uploading '%@' (failed)", fileName] 
+                               totalBytes:totalBytes 
+                             currentBytes:currentBytes];
             NSAlert *alert = [[[NSAlert alloc] init] autorelease];
             [alert setMessageText:@"Upload Timeout"];
             [alert setInformativeText:[NSString stringWithFormat:@"Upload iteration limit reached for object with path '%@'", 
-                                       [objectRequest.userInfo objectForKey:@"objectName"], [objectRequest.userInfo objectForKey:@"containerName"]]];
+                                       [objectRequest.userInfo objectForKey:@"objectName"]]];
             [alert addButtonWithTitle:@"OK"];
             [alert runModal];
             return;
@@ -1025,9 +1093,12 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
         NSLog(@"object is missing hashes: %@", [objectRequest url]);
         NSIndexSet *missingBlocks = [PithosFileUtilities missingBlocksForHashes:[objectRequest.userInfo objectForKey:@"hashes"]
                                                       withMissingHashesResponse:[objectRequest responseString]];
+        NSUInteger blockSize = [[objectRequest.userInfo objectForKey:@"blockSize"] unsignedIntegerValue];
+        if (totalBytes >= [missingBlocks count]*blockSize)
+            currentBytes = totalBytes - [missingBlocks count]*blockSize;
         NSUInteger missingBlockIndex = [missingBlocks firstIndex];
         ASIPithosContainerRequest *newContainerRequest = [PithosFileUtilities updateContainerDataRequestWithContainerName:[objectRequest.userInfo objectForKey:@"containerName"] 
-                                                                                                                blockSize:[[objectRequest.userInfo objectForKey:@"blockSize"] unsignedIntegerValue] 
+                                                                                                                blockSize:blockSize 
                                                                                                                   forFile:[objectRequest.userInfo objectForKey:@"filePath"] 
                                                                                                         missingBlockIndex:missingBlockIndex 
                                                                                                            sharingAccount:[objectRequest.userInfo objectForKey:@"sharingAccount"]];
@@ -1038,6 +1109,10 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
         [(NSMutableDictionary *)(newContainerRequest.userInfo) setObject:[NSNumber numberWithUnsignedInteger:iteration] forKey:@"iteration"];
         [(NSMutableDictionary *)(newContainerRequest.userInfo) setObject:missingBlocks forKey:@"missingBlocks"];
         [(NSMutableDictionary *)(newContainerRequest.userInfo) setObject:[NSNumber numberWithUnsignedInteger:missingBlockIndex] forKey:@"missingBlockIndex"];
+        [activityFacility updateActivity:activity 
+                          withMessage:[NSString stringWithFormat:@"Uploading '%@' (%.2f%%)", fileName, (100*(currentBytes + 0.0)/(totalBytes + 0.0))] 
+                           totalBytes:totalBytes 
+                         currentBytes:currentBytes];
         [newContainerRequest startAsynchronous];
     } else {
         [PithosFileUtilities unexpectedResponseStatusAlertWithRequest:objectRequest];
@@ -1046,11 +1121,24 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
 
 - (void)uploadObjectUsingHashMapFailed:(ASIPithosObjectRequest *)objectRequest {
     NSLog(@"Upload using hashmap failed");
+    NSString *fileName = [objectRequest.userInfo objectForKey:@"fileName"];
+    PithosActivity *activity = [objectRequest.userInfo objectForKey:@"activity"];
+    [activityFacility endActivity:activity 
+                      withMessage:[NSString stringWithFormat:@"Uploading '%@' (failed)", fileName] 
+                       totalBytes:activity.totalBytes 
+                     currentBytes:activity.currentBytes];
     [PithosFileUtilities httpRequestErrorAlertWithRequest:objectRequest];
 }
 
 - (void)uploadMissingBlockFinished:(ASIPithosContainerRequest *)containerRequest {
     NSLog(@"Upload of missing block completed: %@", [containerRequest url]);
+    NSUInteger blockSize = [[containerRequest.userInfo objectForKey:@"blockSize"] unsignedIntegerValue];
+    NSString *fileName = [containerRequest.userInfo objectForKey:@"fileName"];
+    PithosActivity *activity = [containerRequest.userInfo objectForKey:@"activity"];
+    NSUInteger totalBytes = activity.totalBytes;
+    NSUInteger currentBytes = activity.currentBytes + blockSize;
+    if (currentBytes > totalBytes)
+        currentBytes = totalBytes;
     if (containerRequest.responseStatusCode == 202) {
         NSIndexSet *missingBlocks = [containerRequest.userInfo objectForKey:@"missingBlocks"];
         NSUInteger missingBlockIndex = [[containerRequest.userInfo objectForKey:@"missingBlockIndex"] unsignedIntegerValue];
@@ -1060,7 +1148,7 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
             ASIPithosObjectRequest *newObjectRequest = [PithosFileUtilities writeObjectDataRequestWithContainerName:[containerRequest.userInfo objectForKey:@"containerName"] 
                                                                                                          objectName:[containerRequest.userInfo objectForKey:@"objectName"] 
                                                                                                         contentType:[containerRequest.userInfo objectForKey:@"contentType"] 
-                                                                                                          blockSize:[[containerRequest.userInfo objectForKey:@"blockSize"] unsignedIntegerValue] 
+                                                                                                          blockSize:blockSize 
                                                                                                           blockHash:[containerRequest.userInfo objectForKey:@"blockHash"]
                                                                                                             forFile:[containerRequest.userInfo objectForKey:@"filePath"] 
                                                                                                       checkIfExists:NO 
@@ -1072,6 +1160,10 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
             newObjectRequest.userInfo = containerRequest.userInfo;
             [(NSMutableDictionary *)(newObjectRequest.userInfo) removeObjectForKey:@"missingBlocks"];
             [(NSMutableDictionary *)(newObjectRequest.userInfo) removeObjectForKey:@"missingBlockIndex"];
+            [activityFacility updateActivity:activity 
+                                 withMessage:[NSString stringWithFormat:@"Uploading '%@' (%.2f%%)", fileName, (100*(currentBytes + 0.0)/(totalBytes + 0.0))] 
+                                  totalBytes:totalBytes 
+                                currentBytes:currentBytes];
             [newObjectRequest startAsynchronous];
         } else {
             ASIPithosContainerRequest *newContainerRequest = [PithosFileUtilities updateContainerDataRequestWithContainerName:[containerRequest.userInfo objectForKey:@"containerName"]
@@ -1084,15 +1176,29 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
             newContainerRequest.didFailSelector = @selector(uploadMissingBlockFailed:);
             newContainerRequest.userInfo = containerRequest.userInfo;
             [(NSMutableDictionary *)(newContainerRequest.userInfo) setObject:[NSNumber numberWithUnsignedInteger:missingBlockIndex] forKey:@"missingBlockIndex"];
+            [activityFacility updateActivity:activity 
+                                 withMessage:[NSString stringWithFormat:@"Uploading '%@' (%.2f%%)", fileName, (100*(currentBytes + 0.0)/(totalBytes + 0.0))] 
+                                  totalBytes:totalBytes 
+                                currentBytes:currentBytes];
             [newContainerRequest startAsynchronous];
         }
     } else {
+        [activityFacility endActivity:activity 
+                          withMessage:[NSString stringWithFormat:@"Uploading '%@' (failed)", fileName] 
+                           totalBytes:activity.totalBytes 
+                         currentBytes:activity.currentBytes];
         [PithosFileUtilities unexpectedResponseStatusAlertWithRequest:containerRequest];
     }
 }
 
 - (void)uploadMissingBlockFailed:(ASIPithosContainerRequest *)containerRequest {
     NSLog(@"Upload of missing block failed");
+    NSString *fileName = [containerRequest.userInfo objectForKey:@"fileName"];
+    PithosActivity *activity = [containerRequest.userInfo objectForKey:@"activity"];
+    [activityFacility endActivity:activity 
+                      withMessage:[NSString stringWithFormat:@"Uploading '%@' (failed)", fileName] 
+                       totalBytes:activity.totalBytes 
+                     currentBytes:activity.currentBytes];
     [PithosFileUtilities httpRequestErrorAlertWithRequest:containerRequest];
 }
 
@@ -1142,14 +1248,14 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
     if (splitView == verticalSplitView)
         return 120;
     else
-        return ([horizontalSplitView bounds].size.height - 87);
+        return ([horizontalSplitView bounds].size.height - 101);
 }
 
 - (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex {
     if (splitView == verticalSplitView)
         return 220;
     else
-        return ([horizontalSplitView bounds].size.height - 87);
+        return ([horizontalSplitView bounds].size.height - 101);
 }
 
 - (CGFloat)splitView:(NSSplitView *)splitView constrainSplitPosition:(CGFloat)proposedPosition ofSubviewAt:(NSInteger)dividerIndex {
@@ -1161,7 +1267,7 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
         else
             return proposedPosition;
     } else {
-        return ([horizontalSplitView bounds].size.height - 87);
+        return ([horizontalSplitView bounds].size.height - 101);
     }
 }
 
@@ -1771,5 +1877,31 @@ forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column {
     [PithosFileUtilities httpRequestErrorAlertWithRequest:objectRequest];
 }
 
+#pragma mark -
+#pragma mark PithosActivityFacilityDelegate
+
+- (void)activityUpdate:(NSDictionary *)info {
+    NSString *message = [info objectForKey:@"message"];
+    NSUInteger runningActivitiesCount = [[info objectForKey:@"runningActivitiesCount"] unsignedIntegerValue];
+//    NSUInteger endingActivitiesCount = [[info objectForKey:@"endingActivitiesCount"] unsignedIntegerValue];
+    NSUInteger totalUploadBytes = [[info objectForKey:@"totalUploadBytes"] unsignedIntegerValue];
+    NSUInteger currentUploadBytes = [[info objectForKey:@"currentUploadBytes"] unsignedIntegerValue];
+    NSUInteger totalDownloadBytes = [[info objectForKey:@"totalDownloadBytes"] unsignedIntegerValue];
+    NSUInteger currentDownloadBytes = [[info objectForKey:@"currentDownloadBytes"] unsignedIntegerValue];
+    NSUInteger totalBytes = totalUploadBytes + totalDownloadBytes;
+    if (runningActivitiesCount && totalBytes) {
+        [activityProgressIndicator setDoubleValue:((currentUploadBytes + currentDownloadBytes + 0.0)/(totalBytes + 0.0))];
+        [activityProgressIndicator startAnimation:self];
+    } else {
+        [activityProgressIndicator setDoubleValue:1.0];
+        [activityProgressIndicator stopAnimation:self];
+    }
+    
+    if (!message)
+        message = [NSString stringWithFormat:@"%@ used", 
+                   [[[[BytesExtendedSizeTransformer alloc] init] autorelease] transformedValue: 
+                    [NSNumber numberWithUnsignedInteger:accountNode.pithosAccount.bytesUsed]]];
+    [activityTextField setStringValue:message];
+}
 
 @end
\ No newline at end of file
index 40d9b21..98d1970 100755 (executable)
                                                                                                                                                <object class="NSOutlineView" id="392693553">
                                                                                                                                                        <reference key="NSNextResponder" ref="843429105"/>
                                                                                                                                                        <int key="NSvFlags">4352</int>
-                                                                                                                                                       <string key="NSFrameSize">{180, 313}</string>
+                                                                                                                                                       <string key="NSFrameSize">{180, 299}</string>
                                                                                                                                                        <reference key="NSSuperview" ref="843429105"/>
-                                                                                                                                                       <reference key="NSWindow"/>
                                                                                                                                                        <reference key="NSNextKeyView" ref="624286523"/>
                                                                                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                                                                                        <object class="_NSCornerView" key="NSCornerView">
                                                                                                                                                        <float key="NSOutlineViewIndentationPerLevelKey">14</float>
                                                                                                                                                </object>
                                                                                                                                        </object>
-                                                                                                                                       <string key="NSFrameSize">{180, 313}</string>
+                                                                                                                                       <string key="NSFrameSize">{180, 299}</string>
                                                                                                                                        <reference key="NSSuperview" ref="197496877"/>
-                                                                                                                                       <reference key="NSWindow"/>
                                                                                                                                        <reference key="NSNextKeyView" ref="392693553"/>
                                                                                                                                        <reference key="NSDocView" ref="392693553"/>
                                                                                                                                        <reference key="NSBGColor" ref="592883226"/>
                                                                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                                                                        <string key="NSFrame">{{224, 17}, {15, 102}}</string>
                                                                                                                                        <reference key="NSSuperview" ref="197496877"/>
-                                                                                                                                       <reference key="NSWindow"/>
                                                                                                                                        <reference key="NSNextKeyView" ref="1047973191"/>
                                                                                                                                        <reference key="NSTarget" ref="197496877"/>
                                                                                                                                        <string key="NSAction">_doScroller:</string>
                                                                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                                                                        <string key="NSFrame">{{-100, -100}, {144, 15}}</string>
                                                                                                                                        <reference key="NSSuperview" ref="197496877"/>
-                                                                                                                                       <reference key="NSWindow"/>
                                                                                                                                        <reference key="NSNextKeyView" ref="843429105"/>
                                                                                                                                        <int key="NSsFlags">1</int>
                                                                                                                                        <reference key="NSTarget" ref="197496877"/>
                                                                                                                                        <double key="NSPercent">0.97959183673469385</double>
                                                                                                                                </object>
                                                                                                                        </object>
-                                                                                                                       <string key="NSFrameSize">{180, 313}</string>
+                                                                                                                       <string key="NSFrameSize">{180, 299}</string>
                                                                                                                        <reference key="NSSuperview" ref="414504914"/>
-                                                                                                                       <reference key="NSWindow"/>
                                                                                                                        <reference key="NSNextKeyView" ref="205521010"/>
                                                                                                                        <int key="NSsFlags">528</int>
                                                                                                                        <reference key="NSVScroller" ref="624286523"/>
                                                                                                                        <bytes key="NSScrollAmts">QSAAAEEgAABBoAAAQaAAAA</bytes>
                                                                                                                </object>
                                                                                                        </object>
-                                                                                                       <string key="NSFrameSize">{180, 313}</string>
+                                                                                                       <string key="NSFrameSize">{180, 299}</string>
                                                                                                        <reference key="NSSuperview" ref="462572416"/>
-                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="197496877"/>
                                                                                                        <string key="NSClassName">NSView</string>
                                                                                                </object>
                                                                                                                        <reference key="NSNextResponder" ref="1047973191"/>
                                                                                                                        <int key="NSvFlags">1290</int>
                                                                                                                        <object class="NSPSMatrix" key="NSDrawMatrix"/>
-                                                                                                                       <string key="NSFrame">{{7, 21}, {166, 12}}</string>
+                                                                                                                       <string key="NSFrame">{{7, 35}, {166, 12}}</string>
                                                                                                                        <reference key="NSSuperview" ref="1047973191"/>
-                                                                                                                       <reference key="NSWindow"/>
                                                                                                                        <reference key="NSNextKeyView" ref="620067477"/>
                                                                                                                        <int key="NSpiFlags">16648</int>
                                                                                                                        <double key="NSMaxValue">100</double>
                                                                                                                <object class="NSTextField" id="620067477">
                                                                                                                        <reference key="NSNextResponder" ref="1047973191"/>
                                                                                                                        <int key="NSvFlags">266</int>
-                                                                                                                       <string key="NSFrame">{{5, 6}, {170, 14}}</string>
+                                                                                                                       <string key="NSFrame">{{5, 6}, {170, 28}}</string>
                                                                                                                        <reference key="NSSuperview" ref="1047973191"/>
-                                                                                                                       <reference key="NSWindow"/>
                                                                                                                        <reference key="NSNextKeyView" ref="987905504"/>
                                                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                                                        <object class="NSTextFieldCell" key="NSCell" id="667098628">
-                                                                                                                               <int key="NSCellFlags">68288064</int>
-                                                                                                                               <int key="NSCellFlags2">138413056</int>
-                                                                                                                               <string key="NSContents">Syncing</string>
+                                                                                                                               <int key="NSCellFlags">67239424</int>
+                                                                                                                               <int key="NSCellFlags2">138412544</int>
+                                                                                                                               <string key="NSContents"/>
                                                                                                                                <object class="NSFont" key="NSSupport">
                                                                                                                                        <string key="NSName">LucidaGrande-Bold</string>
                                                                                                                                        <double key="NSSize">11</double>
                                                                                                                                        <string>NeXT TIFF v4.0 pasteboard type</string>
                                                                                                                                </object>
                                                                                                                        </object>
-                                                                                                                       <string key="NSFrame">{{69, 38}, {42, 42}}</string>
+                                                                                                                       <string key="NSFrame">{{69, 52}, {42, 42}}</string>
                                                                                                                        <reference key="NSSuperview" ref="1047973191"/>
-                                                                                                                       <reference key="NSWindow"/>
                                                                                                                        <reference key="NSNextKeyView" ref="744849637"/>
                                                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                                                        <object class="NSImageCell" key="NSCell" id="280822281">
                                                                                                                        <bool key="NSEditable">YES</bool>
                                                                                                                </object>
                                                                                                        </object>
-                                                                                                       <string key="NSFrame">{{0, 314}, {180, 86}}</string>
+                                                                                                       <string key="NSFrame">{{0, 300}, {180, 100}}</string>
                                                                                                        <reference key="NSSuperview" ref="462572416"/>
-                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="805035077"/>
                                                                                                        <string key="NSClassName">NSView</string>
                                                                                                </object>
                                                                                        </object>
                                                                                        <string key="NSFrameSize">{180, 400}</string>
                                                                                        <reference key="NSSuperview" ref="581795577"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="414504914"/>
                                                                                        <int key="NSDividerStyle">2</int>
                                                                                </object>
                                                                        </object>
                                                                        <string key="NSFrameSize">{180, 400}</string>
                                                                        <reference key="NSSuperview" ref="374340452"/>
-                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="462572416"/>
                                                                        <string key="NSClassName">NSView</string>
                                                                </object>
                                                                                        <int key="NSvFlags">4370</int>
                                                                                        <string key="NSFrame">{{-1, -1}, {511, 402}}</string>
                                                                                        <reference key="NSSuperview" ref="987905504"/>
-                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSBrowserCell" key="NSCellPrototype">
                                                                        </object>
                                                                        <string key="NSFrame">{{181, 0}, {509, 400}}</string>
                                                                        <reference key="NSSuperview" ref="374340452"/>
-                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="259981942"/>
                                                                        <string key="NSClassName">NSView</string>
                                                                </object>
                                                        </object>
                                                        <string key="NSFrameSize">{690, 400}</string>
                                                        <reference key="NSSuperview" ref="1006"/>
-                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="581795577"/>
                                                        <bool key="NSIsVertical">YES</bool>
                                                        <int key="NSDividerStyle">2</int>
                                        </object>
                                        <string key="NSFrame">{{7, 11}, {690, 400}}</string>
                                        <reference key="NSSuperview"/>
-                                       <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="374340452"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
                                        </object>
                                        <int key="connectionID">175</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">activityProgressIndicator</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="744849637"/>
+                                       </object>
+                                       <int key="connectionID">176</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">activityTextField</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="620067477"/>
+                                       </object>
+                                       <int key="connectionID">177</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                                <reference key="parent" ref="462572416"/>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">147</int>
-                                               <reference key="object" ref="1047973191"/>
-                                               <object class="NSMutableArray" key="children">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="620067477"/>
-                                                       <reference ref="744849637"/>
-                                                       <reference ref="805035077"/>
-                                               </object>
-                                               <reference key="parent" ref="462572416"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
                                                <int key="objectID">27</int>
                                                <reference key="object" ref="197496877"/>
                                                <object class="NSMutableArray" key="children">
                                                <reference key="parent" ref="612034888"/>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">155</int>
-                                               <reference key="object" ref="620067477"/>
+                                               <int key="objectID">147</int>
+                                               <reference key="object" ref="1047973191"/>
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="667098628"/>
+                                                       <reference ref="620067477"/>
+                                                       <reference ref="744849637"/>
+                                                       <reference ref="805035077"/>
+                                               </object>
+                                               <reference key="parent" ref="462572416"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">165</int>
+                                               <reference key="object" ref="805035077"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="280822281"/>
                                                </object>
                                                <reference key="parent" ref="1047973191"/>
+                                               <string key="objectName">Image View</string>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">156</int>
-                                               <reference key="object" ref="667098628"/>
-                                               <reference key="parent" ref="620067477"/>
+                                               <int key="objectID">166</int>
+                                               <reference key="object" ref="280822281"/>
+                                               <reference key="parent" ref="805035077"/>
                                        </object>
                                        <object class="IBObjectRecord">
                                                <int key="objectID">162</int>
                                                <reference key="parent" ref="1047973191"/>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">165</int>
-                                               <reference key="object" ref="805035077"/>
+                                               <int key="objectID">155</int>
+                                               <reference key="object" ref="620067477"/>
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="280822281"/>
+                                                       <reference ref="667098628"/>
                                                </object>
                                                <reference key="parent" ref="1047973191"/>
-                                               <string key="objectName">Image View</string>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">166</int>
-                                               <reference key="object" ref="280822281"/>
-                                               <reference key="parent" ref="805035077"/>
+                                               <int key="objectID">156</int>
+                                               <reference key="object" ref="667098628"/>
+                                               <reference key="parent" ref="620067477"/>
                                        </object>
                                </object>
                        </object>
                                <reference key="dict.values" ref="0"/>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">175</int>
-               </object>
-               <object class="IBClassDescriber" key="IBDocument.Classes">
-                       <object class="NSMutableArray" key="referencedPartialClassDescriptions">
-                               <bool key="EncodedWithXMLCoder">YES</bool>
-                               <object class="IBPartialClassDescription">
-                                       <string key="className">PithosBrowserController</string>
-                                       <string key="superclassName">NSWindowController</string>
-                                       <object class="NSMutableDictionary" key="actions">
-                                               <string key="NS.key.0">refresh:</string>
-                                               <string key="NS.object.0">id</string>
-                                       </object>
-                                       <object class="NSMutableDictionary" key="actionInfosByName">
-                                               <string key="NS.key.0">refresh:</string>
-                                               <object class="IBActionInfo" key="NS.object.0">
-                                                       <string key="name">refresh:</string>
-                                                       <string key="candidateClassName">id</string>
-                                               </object>
-                                       </object>
-                                       <object class="NSMutableDictionary" key="outlets">
-                                               <bool key="EncodedWithXMLCoder">YES</bool>
-                                               <object class="NSArray" key="dict.sortedKeys">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <string>browser</string>
-                                                       <string>horizontalSplitView</string>
-                                                       <string>leftBottomView</string>
-                                                       <string>leftTopView</string>
-                                                       <string>outlineView</string>
-                                                       <string>verticalSplitView</string>
-                                               </object>
-                                               <object class="NSMutableArray" key="dict.values">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <string>NSBrowser</string>
-                                                       <string>NSSplitView</string>
-                                                       <string>NSView</string>
-                                                       <string>NSView</string>
-                                                       <string>NSOutlineView</string>
-                                                       <string>NSSplitView</string>
-                                               </object>
-                                       </object>
-                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
-                                               <bool key="EncodedWithXMLCoder">YES</bool>
-                                               <object class="NSArray" key="dict.sortedKeys">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <string>browser</string>
-                                                       <string>horizontalSplitView</string>
-                                                       <string>leftBottomView</string>
-                                                       <string>leftTopView</string>
-                                                       <string>outlineView</string>
-                                                       <string>verticalSplitView</string>
-                                               </object>
-                                               <object class="NSMutableArray" key="dict.values">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <object class="IBToOneOutletInfo">
-                                                               <string key="name">browser</string>
-                                                               <string key="candidateClassName">NSBrowser</string>
-                                                       </object>
-                                                       <object class="IBToOneOutletInfo">
-                                                               <string key="name">horizontalSplitView</string>
-                                                               <string key="candidateClassName">NSSplitView</string>
-                                                       </object>
-                                                       <object class="IBToOneOutletInfo">
-                                                               <string key="name">leftBottomView</string>
-                                                               <string key="candidateClassName">NSView</string>
-                                                       </object>
-                                                       <object class="IBToOneOutletInfo">
-                                                               <string key="name">leftTopView</string>
-                                                               <string key="candidateClassName">NSView</string>
-                                                       </object>
-                                                       <object class="IBToOneOutletInfo">
-                                                               <string key="name">outlineView</string>
-                                                               <string key="candidateClassName">NSOutlineView</string>
-                                                       </object>
-                                                       <object class="IBToOneOutletInfo">
-                                                               <string key="name">verticalSplitView</string>
-                                                               <string key="candidateClassName">NSSplitView</string>
-                                                       </object>
-                                               </object>
-                                       </object>
-                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
-                                               <string key="majorKey">IBProjectSource</string>
-                                               <string key="minorKey">./Classes/PithosBrowserController.h</string>
-                                       </object>
-                               </object>
-                       </object>
+                       <int key="maxID">177</int>
                </object>
+               <object class="IBClassDescriber" key="IBDocument.Classes"/>
                <int key="IBDocument.localizationMode">0</int>
                <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
index be68b9a..dd1ee20 100644 (file)
@@ -93,7 +93,7 @@
     if (sharingAccount)
         [objectRequest setRequestUserFromDefaultTo:sharingAccount];
     objectRequest.downloadDestinationPath = destinationPath;
-    objectRequest.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
+    objectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               fileName, @"fileName", 
                               destinationPath, @"filePath", 
                               nil];
             NSString *objectDirectoryPath = [directoryPath stringByAppendingPathComponent:subdirName];
             objectDirectoryPath = [objectDirectoryPath stringByAppendingPathComponent:[object.name substringWithRange:NSMakeRange(subdirPrefixLength, [object.name length] - subdirPrefixLength - [fileName length])]];
             
-            [objectRequests addObject:[self objectDataRequestWithContainerName:containerName 
-                                                                    objectName:object.name 
-                                                                   toDirectory:objectDirectoryPath 
-                                                                 checkIfExists:NO 
-                                                                sharingAccount:sharingAccount]];
+            ASIPithosObjectRequest *objectRequest = [self objectDataRequestWithContainerName:containerName 
+                                                                                  objectName:object.name 
+                                                                                 toDirectory:objectDirectoryPath 
+                                                                               checkIfExists:NO 
+                                                                              sharingAccount:sharingAccount];
+            [(NSMutableDictionary *)objectRequest.userInfo setObject:[NSNumber numberWithUnsignedInteger:object.bytes] forKey:@"bytes"];
+            [objectRequests addObject:objectRequest];
         }
     }
     
         *hashes = [HashMapHash calculateObjectHashMap:filePath withBlockHash:blockHash andBlockSize:blockSize];
     if (*hashes == nil)
         return nil;
+    NSString *fileName = [filePath lastPathComponent];
+    if ([filePath hasSuffix:@"/"])
+        fileName = [fileName stringByAppendingString:@"/"];
     NSUInteger bytes = [self bytesOfFile:filePath];
     ASIPithosObjectRequest *objectRequest = [ASIPithosObjectRequest writeObjectDataRequestWithContainerName:containerName 
                                                                                                  objectName:objectName 
                                                                                                       bytes:bytes];
     if (sharingAccount) 
         [objectRequest setRequestUserFromDefaultTo:sharingAccount];
+    objectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+                              fileName, @"fileName", 
+                              [NSNumber numberWithUnsignedInteger:bytes], @"bytes", 
+                              nil];
     return objectRequest;
 }
 
     NSUInteger bytes;
     NSString *contentType;
     NSString *filePath;
+    NSString *fileName;
     for (NSString *objectNameSuffix in subPaths) {
         filePath = [directoryPath stringByAppendingPathComponent:objectNameSuffix];
         if ([defaultManager fileExistsAtPath:filePath isDirectory:&isDirectory]) {
                 hashes = [HashMapHash calculateObjectHashMap:filePath withBlockHash:blockHash andBlockSize:blockSize];
                 if (hashes) {
                     subObjectName = [objectName stringByAppendingPathComponent:objectNameSuffix];
+                    fileName = [filePath lastPathComponent];
+                    if ([filePath hasSuffix:@"/"])
+                        fileName = [fileName stringByAppendingString:@"/"];
                     bytes = [self bytesOfFile:filePath];
                     error = nil;
                     contentType = [self contentTypeOfFile:filePath error:&error];
                                                                                               bytes:bytes];
                     if (sharingAccount)
                         [objectRequest setRequestUserFromDefaultTo:sharingAccount];
+                    objectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+                                              fileName, @"fileName", 
+                                              [NSNumber numberWithUnsignedInteger:bytes], @"bytes", 
+                                              nil];
                     [objectRequests addObject:objectRequest];
                     [*objectNames addObject:subObjectName];
                     [*contentTypes addObject:contentType];
index 091c4e9..cdb35c4 100644 (file)
 // or implied, of GRNET S.A.
 
 #import <Cocoa/Cocoa.h>
+@class PithosBrowserController;
 
 @interface PithosPreferencesController : NSWindowController <NSWindowDelegate> {
     NSUserDefaultsController *userDefaultsController;
+    PithosBrowserController *pithosBrowserController;
     
     NSTextField *authenticationUserTextField;
     NSTextField *authenticationTokenTextField;
     NSButton *authenticationRenewCheckBox;
+    
+    NSDictionaryController *groupsDictionaryController;
+    NSDictionaryController *selectedGroupMembersDictionaryController;
 }
 
 @property (nonatomic, assign) IBOutlet NSUserDefaultsController *userDefaultsController;
+@property (nonatomic, assign) IBOutlet PithosBrowserController *pithosBrowserController;
 
 @property (nonatomic, assign) IBOutlet NSTextField *authenticationUserTextField;
 @property (nonatomic, assign) IBOutlet NSTextField *authenticationTokenTextField;
 @property (nonatomic, assign) IBOutlet NSButton *authenticationRenewCheckBox;
 
+@property (nonatomic, assign) IBOutlet NSDictionaryController *groupsDictionaryController;
+@property (nonatomic, assign) IBOutlet NSDictionaryController *selectedGroupMembersDictionaryController;
+
+
 - (IBAction)toolbarItemSelected:(id)sender;
 
 - (IBAction)authenticationLogin:(id)sender;
index 373620e..b3807a9 100644 (file)
 // or implied, of GRNET S.A.
 
 #import "PithosPreferencesController.h"
+#import "PithosBrowserController.h"
+#import "PithosAccountNode.h"
 #import "pithos_macosAppDelegate.h"
 
 @implementation PithosPreferencesController
-@synthesize userDefaultsController;
+@synthesize userDefaultsController, pithosBrowserController;
 @synthesize authenticationUserTextField, authenticationTokenTextField, authenticationRenewCheckBox;
+@synthesize groupsDictionaryController, selectedGroupMembersDictionaryController;
+
+#pragma mark -
+#pragma mark Object Lifecycle
 
 - (id)init {
     return [super initWithWindowNibName:@"PithosPreferencesController"];
     
        // Select the first tab when the window is loaded for the first time.
        [[window valueForKeyPath:@"toolbar"] setSelectedItemIdentifier:@"0"];
-    
+
+    [groupsDictionaryController setInitialKey:@"group"];
+    [groupsDictionaryController setInitialValue:@"user"];
+    [selectedGroupMembersDictionaryController setInitialKey:@"user"];
+    [selectedGroupMembersDictionaryController setInitialValue:@""];
+
     [window setDelegate:self];
 }
 
     // XXX check the case where this happens for the first time
 }
 
+#pragma mark -
+#pragma mark Groups Actions
+
+- (void)applyGroups {
+    [[self window] makeFirstResponder:nil];
+    [pithosBrowserController.accountNode applyInfo];
+}
+
 @end
index 50000a6..84c1d7b 100644 (file)
@@ -27,6 +27,7 @@
                        <string>NSBox</string>
                        <string>NSView</string>
                        <string>NSPopUpButtonCell</string>
+                       <string>NSDictionaryController</string>
                        <string>NSToolbar</string>
                        <string>NSScrollView</string>
                        <string>NSTabViewItem</string>
                                                        <int key="NSvFlags">12</int>
                                                        <string key="NSFrameSize">{265, 159}</string>
                                                        <reference key="NSSuperview" ref="369507901"/>
-                                                       <reference key="NSNextKeyView" ref="865103585"/>
+                                                       <reference key="NSNextKeyView" ref="646652655"/>
                                                        <object class="NSMutableArray" key="NSTabViewItems">
                                                                <bool key="EncodedWithXMLCoder">YES</bool>
                                                                <object class="NSTabViewItem" id="874188166">
                                                                        <string key="NSIdentifier">0</string>
                                                                        <object class="NSView" key="NSView" id="865103585">
-                                                                               <reference key="NSNextResponder" ref="564742342"/>
+                                                                               <nil key="NSNextResponder"/>
                                                                                <int key="NSvFlags">274</int>
                                                                                <object class="NSMutableArray" key="NSSubviews">
                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                <int key="NSvFlags">289</int>
                                                                                                <string key="NSFrame">{{188, 2}, {72, 28}}</string>
                                                                                                <reference key="NSSuperview" ref="865103585"/>
-                                                                                               <reference key="NSNextKeyView"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="1023707124">
                                                                                                        <int key="NSCellFlags">-2080244224</int>
                                                                                        </object>
                                                                                </object>
                                                                                <string key="NSFrameSize">{265, 159}</string>
-                                                                               <reference key="NSSuperview" ref="564742342"/>
                                                                                <reference key="NSNextKeyView" ref="1054241470"/>
                                                                        </object>
                                                                        <string key="NSLabel">General</string>
                                                                <object class="NSTabViewItem" id="939681372">
                                                                        <string key="NSIdentifier">1</string>
                                                                        <object class="NSView" key="NSView" id="646652655">
-                                                                               <nil key="NSNextResponder"/>
+                                                                               <reference key="NSNextResponder" ref="564742342"/>
                                                                                <int key="NSvFlags">274</int>
                                                                                <object class="NSMutableArray" key="NSSubviews">
                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                <int key="NSvFlags">289</int>
                                                                                                <string key="NSFrame">{{188, 2}, {72, 28}}</string>
                                                                                                <reference key="NSSuperview" ref="646652655"/>
+                                                                                               <reference key="NSNextKeyView"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSButtonCell" key="NSCell" id="500680497">
                                                                                                        <int key="NSCellFlags">-2080244224</int>
                                                                                                                        <object class="NSTableView" id="30388460">
                                                                                                                                <reference key="NSNextResponder" ref="488621520"/>
                                                                                                                                <int key="NSvFlags">4352</int>
-                                                                                                                               <string key="NSFrameSize">{243, 78}</string>
+                                                                                                                               <string key="NSFrameSize">{120, 78}</string>
                                                                                                                                <reference key="NSSuperview" ref="488621520"/>
-                                                                                                                               <reference key="NSNextKeyView" ref="27951958"/>
+                                                                                                                               <reference key="NSNextKeyView" ref="541110138"/>
                                                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                                                <object class="NSTableHeaderView" key="NSHeaderView" id="750592955">
                                                                                                                                        <reference key="NSNextResponder" ref="177329431"/>
                                                                                                                                        <int key="NSvFlags">256</int>
-                                                                                                                                       <string key="NSFrameSize">{243, 17}</string>
+                                                                                                                                       <string key="NSFrameSize">{120, 17}</string>
                                                                                                                                        <reference key="NSSuperview" ref="177329431"/>
                                                                                                                                        <reference key="NSNextKeyView" ref="958839404"/>
                                                                                                                                        <reference key="NSTableView" ref="30388460"/>
                                                                                                                                <object class="NSMutableArray" key="NSTableColumns">
                                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                                        <object class="NSTableColumn" id="801247121">
-                                                                                                                                               <double key="NSWidth">101</double>
+                                                                                                                                               <double key="NSWidth">117</double>
                                                                                                                                                <double key="NSMinWidth">40</double>
                                                                                                                                                <double key="NSMaxWidth">1000</double>
                                                                                                                                                <object class="NSTableHeaderCell" key="NSHeaderCell">
                                                                                                                                                        <int key="NSCellFlags2">2048</int>
                                                                                                                                                        <string key="NSContents">Name</string>
                                                                                                                                                        <reference key="NSSupport" ref="26"/>
-                                                                                                                                                       <object class="NSColor" key="NSBackgroundColor" id="257590195">
+                                                                                                                                                       <object class="NSColor" key="NSBackgroundColor">
                                                                                                                                                                <int key="NSColorSpace">3</int>
                                                                                                                                                                <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
                                                                                                                                                        </object>
                                                                                                                                                <bool key="NSIsEditable">YES</bool>
                                                                                                                                                <reference key="NSTableView" ref="30388460"/>
                                                                                                                                        </object>
-                                                                                                                                       <object class="NSTableColumn" id="279631393">
-                                                                                                                                               <double key="NSWidth">136</double>
-                                                                                                                                               <double key="NSMinWidth">40</double>
-                                                                                                                                               <double key="NSMaxWidth">1000</double>
-                                                                                                                                               <object class="NSTableHeaderCell" key="NSHeaderCell">
-                                                                                                                                                       <int key="NSCellFlags">75628096</int>
-                                                                                                                                                       <int key="NSCellFlags2">2048</int>
-                                                                                                                                                       <string key="NSContents">Members</string>
-                                                                                                                                                       <reference key="NSSupport" ref="26"/>
-                                                                                                                                                       <reference key="NSBackgroundColor" ref="257590195"/>
-                                                                                                                                                       <reference key="NSTextColor" ref="479902038"/>
-                                                                                                                                               </object>
-                                                                                                                                               <object class="NSTextFieldCell" key="NSDataCell" id="131336657">
-                                                                                                                                                       <int key="NSCellFlags">337772096</int>
-                                                                                                                                                       <int key="NSCellFlags2">2048</int>
-                                                                                                                                                       <string key="NSContents">Text Cell</string>
-                                                                                                                                                       <reference key="NSSupport" ref="26"/>
-                                                                                                                                                       <reference key="NSControlView" ref="30388460"/>
-                                                                                                                                                       <reference key="NSBackgroundColor" ref="512560731"/>
-                                                                                                                                                       <reference key="NSTextColor" ref="44104873"/>
-                                                                                                                                               </object>
-                                                                                                                                               <int key="NSResizingMask">3</int>
-                                                                                                                                               <bool key="NSIsResizeable">YES</bool>
-                                                                                                                                               <bool key="NSIsEditable">YES</bool>
-                                                                                                                                               <reference key="NSTableView" ref="30388460"/>
-                                                                                                                                       </object>
                                                                                                                                </object>
                                                                                                                                <double key="NSIntercellSpacingWidth">3</double>
                                                                                                                                <double key="NSIntercellSpacingHeight">2</double>
                                                                                                                                <reference key="NSBackgroundColor" ref="712919987"/>
-                                                                                                                               <object class="NSColor" key="NSGridColor">
+                                                                                                                               <object class="NSColor" key="NSGridColor" id="1027158800">
                                                                                                                                        <int key="NSColorSpace">6</int>
                                                                                                                                        <string key="NSCatalogName">System</string>
                                                                                                                                        <string key="NSColorName">gridColor</string>
                                                                                                                                <int key="NSTableViewDraggingDestinationStyle">0</int>
                                                                                                                        </object>
                                                                                                                </object>
-                                                                                                               <string key="NSFrame">{{1, 17}, {243, 78}}</string>
+                                                                                                               <string key="NSFrame">{{1, 17}, {120, 78}}</string>
                                                                                                                <reference key="NSSuperview" ref="729122555"/>
                                                                                                                <reference key="NSNextKeyView" ref="30388460"/>
                                                                                                                <reference key="NSDocView" ref="30388460"/>
                                                                                                                <reference key="NSNextKeyView" ref="177329431"/>
                                                                                                                <reference key="NSTarget" ref="729122555"/>
                                                                                                                <string key="NSAction">_doScroller:</string>
-                                                                                                               <double key="NSCurValue">37</double>
-                                                                                                               <double key="NSPercent">0.1947367936372757</double>
+                                                                                                               <double key="NSPercent">0.80769230769230771</double>
                                                                                                        </object>
                                                                                                        <object class="NSScroller" id="541110138">
                                                                                                                <reference key="NSNextResponder" ref="729122555"/>
                                                                                                                <int key="NSvFlags">-2147483392</int>
                                                                                                                <string key="NSFrame">{{1, 119}, {223, 15}}</string>
                                                                                                                <reference key="NSSuperview" ref="729122555"/>
-                                                                                                               <reference key="NSNextKeyView" ref="988713632"/>
+                                                                                                               <reference key="NSNextKeyView" ref="202050240"/>
                                                                                                                <int key="NSsFlags">1</int>
                                                                                                                <reference key="NSTarget" ref="729122555"/>
                                                                                                                <string key="NSAction">_doScroller:</string>
-                                                                                                               <double key="NSPercent">0.57142859697341919</double>
+                                                                                                               <double key="NSPercent">0.97590361445783136</double>
                                                                                                        </object>
                                                                                                        <object class="NSClipView" id="177329431">
                                                                                                                <reference key="NSNextResponder" ref="729122555"/>
                                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                                                        <reference ref="750592955"/>
                                                                                                                </object>
-                                                                                                               <string key="NSFrame">{{1, 0}, {243, 17}}</string>
+                                                                                                               <string key="NSFrame">{{1, 0}, {120, 17}}</string>
                                                                                                                <reference key="NSSuperview" ref="729122555"/>
                                                                                                                <reference key="NSNextKeyView" ref="750592955"/>
                                                                                                                <reference key="NSDocView" ref="750592955"/>
                                                                                                        </object>
                                                                                                        <reference ref="958839404"/>
                                                                                                </object>
-                                                                                               <string key="NSFrame">{{10, 53}, {245, 96}}</string>
+                                                                                               <string key="NSFrame">{{10, 53}, {122, 96}}</string>
                                                                                                <reference key="NSSuperview" ref="646652655"/>
-                                                                                               <reference key="NSNextKeyView" ref="488621520"/>
+                                                                                               <reference key="NSNextKeyView" ref="27951958"/>
                                                                                                <int key="NSsFlags">562</int>
                                                                                                <reference key="NSVScroller" ref="27951958"/>
                                                                                                <reference key="NSHScroller" ref="541110138"/>
                                                                                                <reference key="NSCornerView" ref="958839404"/>
                                                                                                <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
                                                                                        </object>
+                                                                                       <object class="NSScrollView" id="202050240">
+                                                                                               <reference key="NSNextResponder" ref="646652655"/>
+                                                                                               <int key="NSvFlags">4371</int>
+                                                                                               <object class="NSMutableArray" key="NSSubviews">
+                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                       <object class="NSClipView" id="219950644">
+                                                                                                               <reference key="NSNextResponder" ref="202050240"/>
+                                                                                                               <int key="NSvFlags">2304</int>
+                                                                                                               <object class="NSMutableArray" key="NSSubviews">
+                                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                                       <object class="NSTableView" id="955904863">
+                                                                                                                               <reference key="NSNextResponder" ref="219950644"/>
+                                                                                                                               <int key="NSvFlags">4352</int>
+                                                                                                                               <string key="NSFrameSize">{120, 78}</string>
+                                                                                                                               <reference key="NSSuperview" ref="219950644"/>
+                                                                                                                               <reference key="NSNextKeyView" ref="529286880"/>
+                                                                                                                               <bool key="NSEnabled">YES</bool>
+                                                                                                                               <object class="NSTableHeaderView" key="NSHeaderView" id="917463045">
+                                                                                                                                       <reference key="NSNextResponder" ref="342545830"/>
+                                                                                                                                       <int key="NSvFlags">256</int>
+                                                                                                                                       <string key="NSFrameSize">{120, 17}</string>
+                                                                                                                                       <reference key="NSSuperview" ref="342545830"/>
+                                                                                                                                       <reference key="NSNextKeyView" ref="913709756"/>
+                                                                                                                                       <reference key="NSTableView" ref="955904863"/>
+                                                                                                                               </object>
+                                                                                                                               <object class="_NSCornerView" key="NSCornerView" id="913709756">
+                                                                                                                                       <reference key="NSNextResponder" ref="202050240"/>
+                                                                                                                                       <int key="NSvFlags">-2147483392</int>
+                                                                                                                                       <string key="NSFrame">{{224, 0}, {16, 17}}</string>
+                                                                                                                                       <reference key="NSSuperview" ref="202050240"/>
+                                                                                                                                       <reference key="NSNextKeyView" ref="219950644"/>
+                                                                                                                               </object>
+                                                                                                                               <object class="NSMutableArray" key="NSTableColumns">
+                                                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                                                       <object class="NSTableColumn" id="604806618">
+                                                                                                                                               <double key="NSWidth">117</double>
+                                                                                                                                               <double key="NSMinWidth">40</double>
+                                                                                                                                               <double key="NSMaxWidth">1000</double>
+                                                                                                                                               <object class="NSTableHeaderCell" key="NSHeaderCell">
+                                                                                                                                                       <int key="NSCellFlags">75628096</int>
+                                                                                                                                                       <int key="NSCellFlags2">2048</int>
+                                                                                                                                                       <string key="NSContents">Members</string>
+                                                                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                                                                       <object class="NSColor" key="NSBackgroundColor">
+                                                                                                                                                               <int key="NSColorSpace">3</int>
+                                                                                                                                                               <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
+                                                                                                                                                       </object>
+                                                                                                                                                       <reference key="NSTextColor" ref="479902038"/>
+                                                                                                                                               </object>
+                                                                                                                                               <object class="NSTextFieldCell" key="NSDataCell" id="809830821">
+                                                                                                                                                       <int key="NSCellFlags">337772096</int>
+                                                                                                                                                       <int key="NSCellFlags2">2048</int>
+                                                                                                                                                       <string key="NSContents">Text Cell</string>
+                                                                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                                                                       <reference key="NSControlView" ref="955904863"/>
+                                                                                                                                                       <reference key="NSBackgroundColor" ref="512560731"/>
+                                                                                                                                                       <reference key="NSTextColor" ref="44104873"/>
+                                                                                                                                               </object>
+                                                                                                                                               <int key="NSResizingMask">3</int>
+                                                                                                                                               <bool key="NSIsResizeable">YES</bool>
+                                                                                                                                               <bool key="NSIsEditable">YES</bool>
+                                                                                                                                               <reference key="NSTableView" ref="955904863"/>
+                                                                                                                                       </object>
+                                                                                                                               </object>
+                                                                                                                               <double key="NSIntercellSpacingWidth">3</double>
+                                                                                                                               <double key="NSIntercellSpacingHeight">2</double>
+                                                                                                                               <reference key="NSBackgroundColor" ref="712919987"/>
+                                                                                                                               <reference key="NSGridColor" ref="1027158800"/>
+                                                                                                                               <double key="NSRowHeight">17</double>
+                                                                                                                               <int key="NSTvFlags">1388314624</int>
+                                                                                                                               <reference key="NSDelegate"/>
+                                                                                                                               <reference key="NSDataSource"/>
+                                                                                                                               <int key="NSGridStyleMask">1</int>
+                                                                                                                               <int key="NSColumnAutoresizingStyle">4</int>
+                                                                                                                               <int key="NSDraggingSourceMaskForLocal">15</int>
+                                                                                                                               <int key="NSDraggingSourceMaskForNonLocal">0</int>
+                                                                                                                               <bool key="NSAllowsTypeSelect">YES</bool>
+                                                                                                                               <int key="NSTableViewDraggingDestinationStyle">0</int>
+                                                                                                                       </object>
+                                                                                                               </object>
+                                                                                                               <string key="NSFrame">{{1, 17}, {120, 78}}</string>
+                                                                                                               <reference key="NSSuperview" ref="202050240"/>
+                                                                                                               <reference key="NSNextKeyView" ref="955904863"/>
+                                                                                                               <reference key="NSDocView" ref="955904863"/>
+                                                                                                               <reference key="NSBGColor" ref="512560731"/>
+                                                                                                               <int key="NScvFlags">4</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSScroller" id="817353191">
+                                                                                                               <reference key="NSNextResponder" ref="202050240"/>
+                                                                                                               <int key="NSvFlags">-2147483392</int>
+                                                                                                               <string key="NSFrame">{{-100, -100}, {15, 102}}</string>
+                                                                                                               <reference key="NSSuperview" ref="202050240"/>
+                                                                                                               <reference key="NSNextKeyView" ref="342545830"/>
+                                                                                                               <reference key="NSTarget" ref="202050240"/>
+                                                                                                               <string key="NSAction">_doScroller:</string>
+                                                                                                               <double key="NSPercent">0.80769230769230771</double>
+                                                                                                       </object>
+                                                                                                       <object class="NSScroller" id="529286880">
+                                                                                                               <reference key="NSNextResponder" ref="202050240"/>
+                                                                                                               <int key="NSvFlags">-2147483392</int>
+                                                                                                               <string key="NSFrame">{{1, 119}, {223, 15}}</string>
+                                                                                                               <reference key="NSSuperview" ref="202050240"/>
+                                                                                                               <reference key="NSNextKeyView" ref="988713632"/>
+                                                                                                               <int key="NSsFlags">1</int>
+                                                                                                               <reference key="NSTarget" ref="202050240"/>
+                                                                                                               <string key="NSAction">_doScroller:</string>
+                                                                                                               <double key="NSPercent">0.97590361445783136</double>
+                                                                                                       </object>
+                                                                                                       <object class="NSClipView" id="342545830">
+                                                                                                               <reference key="NSNextResponder" ref="202050240"/>
+                                                                                                               <int key="NSvFlags">2304</int>
+                                                                                                               <object class="NSMutableArray" key="NSSubviews">
+                                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                                       <reference ref="917463045"/>
+                                                                                                               </object>
+                                                                                                               <string key="NSFrame">{{1, 0}, {120, 17}}</string>
+                                                                                                               <reference key="NSSuperview" ref="202050240"/>
+                                                                                                               <reference key="NSNextKeyView" ref="917463045"/>
+                                                                                                               <reference key="NSDocView" ref="917463045"/>
+                                                                                                               <reference key="NSBGColor" ref="512560731"/>
+                                                                                                               <int key="NScvFlags">4</int>
+                                                                                                       </object>
+                                                                                                       <reference ref="913709756"/>
+                                                                                               </object>
+                                                                                               <string key="NSFrame">{{133, 53}, {122, 96}}</string>
+                                                                                               <reference key="NSSuperview" ref="646652655"/>
+                                                                                               <reference key="NSNextKeyView" ref="817353191"/>
+                                                                                               <int key="NSsFlags">562</int>
+                                                                                               <reference key="NSVScroller" ref="817353191"/>
+                                                                                               <reference key="NSHScroller" ref="529286880"/>
+                                                                                               <reference key="NSContentView" ref="219950644"/>
+                                                                                               <reference key="NSHeaderClipView" ref="342545830"/>
+                                                                                               <reference key="NSCornerView" ref="913709756"/>
+                                                                                               <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+                                                                                       </object>
                                                                                        <object class="NSButton" id="988713632">
                                                                                                <reference key="NSNextResponder" ref="646652655"/>
                                                                                                <int key="NSvFlags">292</int>
                                                                                        </object>
                                                                                </object>
                                                                                <string key="NSFrameSize">{265, 159}</string>
+                                                                               <reference key="NSSuperview" ref="564742342"/>
                                                                                <reference key="NSNextKeyView" ref="729122555"/>
                                                                        </object>
                                                                        <string key="NSLabel">Groups</string>
                                                                        <reference key="NSTabView" ref="564742342"/>
                                                                </object>
                                                        </object>
-                                                       <reference key="NSSelectedTabViewItem" ref="874188166"/>
+                                                       <reference key="NSSelectedTabViewItem" ref="939681372"/>
                                                        <reference key="NSFont" ref="271467070"/>
                                                        <int key="NSTvFlags">6</int>
                                                        <bool key="NSAllowTruncatedLabels">YES</bool>
                                                        <bool key="NSDrawsBackground">YES</bool>
                                                        <object class="NSMutableArray" key="NSSubviews">
                                                                <bool key="EncodedWithXMLCoder">YES</bool>
-                                                               <reference ref="865103585"/>
+                                                               <reference ref="646652655"/>
                                                        </object>
                                                </object>
                                        </object>
                                        <reference key="NSSuperview"/>
                                        <reference key="NSNextKeyView" ref="564742342"/>
                                </object>
-                               <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+                               <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
                                <string key="NSMinSize">{265, 237}</string>
                                <string key="NSMaxSize">{265, 237}</string>
                        </object>
                        <object class="NSUserDefaultsController" id="700105088">
                                <bool key="NSSharedInstance">YES</bool>
                        </object>
+                       <object class="NSDictionaryController" id="980977849">
+                               <bool key="NSEditable">YES</bool>
+                               <bool key="NSAvoidsEmptySelection">YES</bool>
+                               <bool key="NSPreservesSelection">YES</bool>
+                               <bool key="NSSelectsInsertedObjects">YES</bool>
+                               <bool key="NSFilterRestrictsInsertion">YES</bool>
+                               <object class="NSArray" key="NSSortDescriptors">
+                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                       <object class="NSSortDescriptor">
+                                               <string key="NSKey">key</string>
+                                               <bool key="NSAscending">YES</bool>
+                                               <string key="NSSelector">compare:</string>
+                                       </object>
+                               </object>
+                               <bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
+                               <string key="NSInitialKey">key</string>
+                               <string key="NSInitialValue">value</string>
+                       </object>
+                       <object class="NSDictionaryController" id="665074782">
+                               <bool key="NSEditable">YES</bool>
+                               <bool key="NSAvoidsEmptySelection">YES</bool>
+                               <bool key="NSPreservesSelection">YES</bool>
+                               <bool key="NSSelectsInsertedObjects">YES</bool>
+                               <bool key="NSFilterRestrictsInsertion">YES</bool>
+                               <object class="NSArray" key="NSSortDescriptors">
+                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                       <object class="NSSortDescriptor">
+                                               <string key="NSKey">key</string>
+                                               <bool key="NSAscending">YES</bool>
+                                               <string key="NSSelector">compare:</string>
+                                       </object>
+                               </object>
+                               <bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
+                               <string key="NSInitialKey">key</string>
+                               <string key="NSInitialValue">value</string>
+                       </object>
+                       <object class="NSCustomObject" id="894212860">
+                               <string key="NSClassName">GroupAndGroupMemberFormatter</string>
+                       </object>
                </object>
                <object class="IBObjectContainer" key="IBDocument.Objects">
                        <object class="NSMutableArray" key="connectionRecords">
                                        </object>
                                        <int key="connectionID">374</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">target: pithosBrowserController.accountNode</string>
+                                               <reference key="source" ref="724709226"/>
+                                               <reference key="destination" ref="1001"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="724709226"/>
+                                                       <reference key="NSDestination" ref="1001"/>
+                                                       <string key="NSLabel">target: pithosBrowserController.accountNode</string>
+                                                       <string key="NSBinding">target</string>
+                                                       <string key="NSKeyPath">pithosBrowserController.accountNode</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <string key="NS.key.0">NSSelectorName</string>
+                                                               <string key="NS.object.0">refreshInfo</string>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">395</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">contentDictionary: pithosBrowserController.accountNode.pithosAccount.groups</string>
+                                               <reference key="source" ref="980977849"/>
+                                               <reference key="destination" ref="1001"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="980977849"/>
+                                                       <reference key="NSDestination" ref="1001"/>
+                                                       <string key="NSLabel">contentDictionary: pithosBrowserController.accountNode.pithosAccount.groups</string>
+                                                       <string key="NSBinding">contentDictionary</string>
+                                                       <string key="NSKeyPath">pithosBrowserController.accountNode.pithosAccount.groups</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">398</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">content: arrangedObjects</string>
+                                               <reference key="source" ref="30388460"/>
+                                               <reference key="destination" ref="980977849"/>
+                                               <object class="NSNibBindingConnector" key="connector" id="796087751">
+                                                       <reference key="NSSource" ref="30388460"/>
+                                                       <reference key="NSDestination" ref="980977849"/>
+                                                       <string key="NSLabel">content: arrangedObjects</string>
+                                                       <string key="NSBinding">content</string>
+                                                       <string key="NSKeyPath">arrangedObjects</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">399</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">selectionIndexes: selectionIndexes</string>
+                                               <reference key="source" ref="30388460"/>
+                                               <reference key="destination" ref="980977849"/>
+                                               <object class="NSNibBindingConnector" key="connector" id="511216149">
+                                                       <reference key="NSSource" ref="30388460"/>
+                                                       <reference key="NSDestination" ref="980977849"/>
+                                                       <string key="NSLabel">selectionIndexes: selectionIndexes</string>
+                                                       <string key="NSBinding">selectionIndexes</string>
+                                                       <string key="NSKeyPath">selectionIndexes</string>
+                                                       <reference key="NSPreviousConnector" ref="796087751"/>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">401</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">sortDescriptors: sortDescriptors</string>
+                                               <reference key="source" ref="30388460"/>
+                                               <reference key="destination" ref="980977849"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="30388460"/>
+                                                       <reference key="NSDestination" ref="980977849"/>
+                                                       <string key="NSLabel">sortDescriptors: sortDescriptors</string>
+                                                       <string key="NSBinding">sortDescriptors</string>
+                                                       <string key="NSKeyPath">sortDescriptors</string>
+                                                       <reference key="NSPreviousConnector" ref="511216149"/>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">403</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: arrangedObjects.key</string>
+                                               <reference key="source" ref="801247121"/>
+                                               <reference key="destination" ref="980977849"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="801247121"/>
+                                                       <reference key="NSDestination" ref="980977849"/>
+                                                       <string key="NSLabel">value: arrangedObjects.key</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">arrangedObjects.key</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                               <object class="NSArray" key="dict.sortedKeys">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <string>NSConditionallySetsEditable</string>
+                                                                       <string>NSValidatesImmediately</string>
+                                                               </object>
+                                                               <object class="NSMutableArray" key="dict.values">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <boolean value="NO"/>
+                                                                       <boolean value="YES"/>
+                                                               </object>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">407</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">content: arrangedObjects</string>
+                                               <reference key="source" ref="955904863"/>
+                                               <reference key="destination" ref="665074782"/>
+                                               <object class="NSNibBindingConnector" key="connector" id="918816983">
+                                                       <reference key="NSSource" ref="955904863"/>
+                                                       <reference key="NSDestination" ref="665074782"/>
+                                                       <string key="NSLabel">content: arrangedObjects</string>
+                                                       <string key="NSBinding">content</string>
+                                                       <string key="NSKeyPath">arrangedObjects</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">439</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">selectionIndexes: selectionIndexes</string>
+                                               <reference key="source" ref="955904863"/>
+                                               <reference key="destination" ref="665074782"/>
+                                               <object class="NSNibBindingConnector" key="connector" id="587343233">
+                                                       <reference key="NSSource" ref="955904863"/>
+                                                       <reference key="NSDestination" ref="665074782"/>
+                                                       <string key="NSLabel">selectionIndexes: selectionIndexes</string>
+                                                       <string key="NSBinding">selectionIndexes</string>
+                                                       <string key="NSKeyPath">selectionIndexes</string>
+                                                       <reference key="NSPreviousConnector" ref="918816983"/>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">441</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">sortDescriptors: sortDescriptors</string>
+                                               <reference key="source" ref="955904863"/>
+                                               <reference key="destination" ref="665074782"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="955904863"/>
+                                                       <reference key="NSDestination" ref="665074782"/>
+                                                       <string key="NSLabel">sortDescriptors: sortDescriptors</string>
+                                                       <string key="NSBinding">sortDescriptors</string>
+                                                       <string key="NSKeyPath">sortDescriptors</string>
+                                                       <reference key="NSPreviousConnector" ref="587343233"/>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">443</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: arrangedObjects.key</string>
+                                               <reference key="source" ref="604806618"/>
+                                               <reference key="destination" ref="665074782"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="604806618"/>
+                                                       <reference key="NSDestination" ref="665074782"/>
+                                                       <string key="NSLabel">value: arrangedObjects.key</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">arrangedObjects.key</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                               <object class="NSArray" key="dict.sortedKeys">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <string>NSConditionallySetsEditable</string>
+                                                                       <string>NSValidatesImmediately</string>
+                                                               </object>
+                                                               <object class="NSMutableArray" key="dict.values">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <boolean value="NO"/>
+                                                                       <boolean value="YES"/>
+                                                               </object>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">447</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">contentDictionary: selection.value</string>
+                                               <reference key="source" ref="665074782"/>
+                                               <reference key="destination" ref="980977849"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="665074782"/>
+                                                       <reference key="NSDestination" ref="980977849"/>
+                                                       <string key="NSLabel">contentDictionary: selection.value</string>
+                                                       <string key="NSBinding">contentDictionary</string>
+                                                       <string key="NSKeyPath">selection.value</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                               <object class="NSArray" key="dict.sortedKeys">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <string>NSValidatesImmediately</string>
+                                                                       <string>NSValueTransformerName</string>
+                                                               </object>
+                                                               <object class="NSMutableArray" key="dict.values">
+                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                       <boolean value="YES"/>
+                                                                       <string>GroupMembersDictionaryTransformer</string>
+                                                               </object>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">448</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">formatter</string>
+                                               <reference key="source" ref="410705345"/>
+                                               <reference key="destination" ref="894212860"/>
+                                       </object>
+                                       <int key="connectionID">450</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">formatter</string>
+                                               <reference key="source" ref="809830821"/>
+                                               <reference key="destination" ref="894212860"/>
+                                       </object>
+                                       <int key="connectionID">451</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">add:</string>
+                                               <reference key="source" ref="980977849"/>
+                                               <reference key="destination" ref="988713632"/>
+                                       </object>
+                                       <int key="connectionID">452</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">enabled: canRemove</string>
+                                               <reference key="source" ref="616473836"/>
+                                               <reference key="destination" ref="980977849"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="616473836"/>
+                                                       <reference key="NSDestination" ref="980977849"/>
+                                                       <string key="NSLabel">enabled: canRemove</string>
+                                                       <string key="NSBinding">enabled</string>
+                                                       <string key="NSKeyPath">canRemove</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">455</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">remove:</string>
+                                               <reference key="source" ref="980977849"/>
+                                               <reference key="destination" ref="616473836"/>
+                                       </object>
+                                       <int key="connectionID">456</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">add:</string>
+                                               <reference key="source" ref="665074782"/>
+                                               <reference key="destination" ref="566469435"/>
+                                       </object>
+                                       <int key="connectionID">457</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">remove:</string>
+                                               <reference key="source" ref="665074782"/>
+                                               <reference key="destination" ref="911168208"/>
+                                       </object>
+                                       <int key="connectionID">458</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">enabled: canRemove</string>
+                                               <reference key="source" ref="911168208"/>
+                                               <reference key="destination" ref="665074782"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="911168208"/>
+                                                       <reference key="NSDestination" ref="665074782"/>
+                                                       <string key="NSLabel">enabled: canRemove</string>
+                                                       <string key="NSBinding">enabled</string>
+                                                       <string key="NSKeyPath">canRemove</string>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">460</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">groupsDictionaryController</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="980977849"/>
+                                       </object>
+                                       <int key="connectionID">461</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">selectedGroupMembersDictionaryController</string>
+                                               <reference key="source" ref="1001"/>
+                                               <reference key="destination" ref="665074782"/>
+                                       </object>
+                                       <int key="connectionID">462</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">target: self</string>
+                                               <reference key="source" ref="131074952"/>
+                                               <reference key="destination" ref="1001"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="131074952"/>
+                                                       <reference key="NSDestination" ref="1001"/>
+                                                       <string key="NSLabel">target: self</string>
+                                                       <string key="NSBinding">target</string>
+                                                       <string key="NSKeyPath">self</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <string key="NS.key.0">NSSelectorName</string>
+                                                               <string key="NS.object.0">applyGroups</string>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">465</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                                        <reference ref="911168208"/>
                                                        <reference ref="724709226"/>
                                                        <reference ref="131074952"/>
+                                                       <reference ref="202050240"/>
                                                </object>
                                                <reference key="parent" ref="939681372"/>
                                        </object>
                                                <reference key="object" ref="30388460"/>
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="279631393"/>
                                                        <reference ref="801247121"/>
                                                </object>
                                                <reference key="parent" ref="729122555"/>
                                                <reference key="parent" ref="729122555"/>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">290</int>
-                                               <reference key="object" ref="279631393"/>
-                                               <object class="NSMutableArray" key="children">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="131336657"/>
-                                               </object>
-                                               <reference key="parent" ref="30388460"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
                                                <int key="objectID">291</int>
                                                <reference key="object" ref="801247121"/>
                                                <object class="NSMutableArray" key="children">
                                                <reference key="parent" ref="801247121"/>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">293</int>
-                                               <reference key="object" ref="131336657"/>
-                                               <reference key="parent" ref="279631393"/>
-                                               <string key="objectName">Text Field Cell - Text Cell</string>
-                                       </object>
-                                       <object class="IBObjectRecord">
                                                <int key="objectID">294</int>
                                                <reference key="object" ref="566469435"/>
                                                <object class="NSMutableArray" key="children">
                                                <reference key="object" ref="267610935"/>
                                                <reference key="parent" ref="212541681"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">382</int>
+                                               <reference key="object" ref="202050240"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="817353191"/>
+                                                       <reference ref="917463045"/>
+                                                       <reference ref="529286880"/>
+                                                       <reference ref="955904863"/>
+                                               </object>
+                                               <reference key="parent" ref="646652655"/>
+                                               <string key="objectName">Scroll View - Table View - Metadata</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">383</int>
+                                               <reference key="object" ref="817353191"/>
+                                               <reference key="parent" ref="202050240"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">384</int>
+                                               <reference key="object" ref="917463045"/>
+                                               <reference key="parent" ref="202050240"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">385</int>
+                                               <reference key="object" ref="529286880"/>
+                                               <reference key="parent" ref="202050240"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">386</int>
+                                               <reference key="object" ref="955904863"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="604806618"/>
+                                               </object>
+                                               <reference key="parent" ref="202050240"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">387</int>
+                                               <reference key="object" ref="604806618"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="809830821"/>
+                                               </object>
+                                               <reference key="parent" ref="955904863"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">388</int>
+                                               <reference key="object" ref="809830821"/>
+                                               <reference key="parent" ref="604806618"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">396</int>
+                                               <reference key="object" ref="980977849"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Dictionary Controller (Groups)</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">433</int>
+                                               <reference key="object" ref="665074782"/>
+                                               <reference key="parent" ref="0"/>
+                                               <string key="objectName">Dictionary Controller (Selected Group Members)</string>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">449</int>
+                                               <reference key="object" ref="894212860"/>
+                                               <reference key="parent" ref="0"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>287.IBPluginDependency</string>
                                        <string>288.IBPluginDependency</string>
                                        <string>289.IBPluginDependency</string>
-                                       <string>290.IBPluginDependency</string>
                                        <string>291.IBPluginDependency</string>
                                        <string>292.IBPluginDependency</string>
-                                       <string>293.IBPluginDependency</string>
                                        <string>294.IBPluginDependency</string>
                                        <string>295.IBPluginDependency</string>
                                        <string>296.IBPluginDependency</string>
                                        <string>370.IBPluginDependency</string>
                                        <string>371.IBPluginDependency</string>
                                        <string>372.IBPluginDependency</string>
+                                       <string>382.IBPluginDependency</string>
+                                       <string>383.IBPluginDependency</string>
+                                       <string>384.IBPluginDependency</string>
+                                       <string>385.IBPluginDependency</string>
+                                       <string>386.IBPluginDependency</string>
+                                       <string>387.IBPluginDependency</string>
+                                       <string>388.IBPluginDependency</string>
+                                       <string>396.IBPluginDependency</string>
                                        <string>4.IBPluginDependency</string>
+                                       <string>433.IBPluginDependency</string>
+                                       <string>449.IBPluginDependency</string>
                                        <string>5.IBPluginDependency</string>
                                        <string>6.IBPluginDependency</string>
                                </object>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>{{438, 560}, {520, 345}}</string>
                                        <boolean value="NO"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="unlocalizedProperties">
                                <reference key="dict.values" ref="0"/>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">374</int>
+                       <int key="maxID">465</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes"/>
                <int key="IBDocument.localizationMode">0</int>
index 3469508..471a028 100644 (file)
@@ -90,7 +90,7 @@
 }
 
 - (id)reverseTransformedValue:(id)value {
-    if (value == nil || ([(NSMutableDictionary *)value count] == 0))
+    if ((value == nil) || ([(NSMutableDictionary *)value count] == 0))
         return nil;
     
     NSString *readSharingString = nil;
index 0a8b869..98f82bd 100644 (file)
                                        </object>
                                        <int key="connectionID">558</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">pithosBrowserController</string>
+                                               <reference key="source" ref="726846575"/>
+                                               <reference key="destination" ref="462345653"/>
+                                       </object>
+                                       <int key="connectionID">559</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                <reference key="dict.values" ref="0"/>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">558</int>
+                       <int key="maxID">560</int>
+               </object>
+               <object class="IBClassDescriber" key="IBDocument.Classes">
+                       <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+                               <bool key="EncodedWithXMLCoder">YES</bool>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">NSDocument</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>printDocument:</string>
+                                                       <string>revertDocumentToSaved:</string>
+                                                       <string>runPageLayout:</string>
+                                                       <string>saveDocument:</string>
+                                                       <string>saveDocumentAs:</string>
+                                                       <string>saveDocumentTo:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>printDocument:</string>
+                                                       <string>revertDocumentToSaved:</string>
+                                                       <string>runPageLayout:</string>
+                                                       <string>saveDocument:</string>
+                                                       <string>saveDocumentAs:</string>
+                                                       <string>saveDocumentTo:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">printDocument:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">revertDocumentToSaved:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">runPageLayout:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">saveDocument:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">saveDocumentAs:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">saveDocumentTo:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/NSDocument.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">PithosBrowserController</string>
+                                       <string key="superclassName">NSWindowController</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <string key="NS.key.0">refresh:</string>
+                                               <string key="NS.object.0">id</string>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <string key="NS.key.0">refresh:</string>
+                                               <object class="IBActionInfo" key="NS.object.0">
+                                                       <string key="name">refresh:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>activityProgressIndicator</string>
+                                                       <string>activityTextField</string>
+                                                       <string>browser</string>
+                                                       <string>horizontalSplitView</string>
+                                                       <string>leftBottomView</string>
+                                                       <string>leftTopView</string>
+                                                       <string>outlineView</string>
+                                                       <string>verticalSplitView</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>NSProgressIndicator</string>
+                                                       <string>NSTextField</string>
+                                                       <string>NSBrowser</string>
+                                                       <string>NSSplitView</string>
+                                                       <string>NSView</string>
+                                                       <string>NSView</string>
+                                                       <string>NSOutlineView</string>
+                                                       <string>NSSplitView</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>activityProgressIndicator</string>
+                                                       <string>activityTextField</string>
+                                                       <string>browser</string>
+                                                       <string>horizontalSplitView</string>
+                                                       <string>leftBottomView</string>
+                                                       <string>leftTopView</string>
+                                                       <string>outlineView</string>
+                                                       <string>verticalSplitView</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">activityProgressIndicator</string>
+                                                               <string key="candidateClassName">NSProgressIndicator</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">activityTextField</string>
+                                                               <string key="candidateClassName">NSTextField</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">browser</string>
+                                                               <string key="candidateClassName">NSBrowser</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">horizontalSplitView</string>
+                                                               <string key="candidateClassName">NSSplitView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">leftBottomView</string>
+                                                               <string key="candidateClassName">NSView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">leftTopView</string>
+                                                               <string key="candidateClassName">NSView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">outlineView</string>
+                                                               <string key="candidateClassName">NSOutlineView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">verticalSplitView</string>
+                                                               <string key="candidateClassName">NSSplitView</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/PithosBrowserController.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">PithosPreferencesController</string>
+                                       <string key="superclassName">NSWindowController</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationLogin:</string>
+                                                       <string>toolbarItemSelected:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationLogin:</string>
+                                                       <string>toolbarItemSelected:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">authenticationLogin:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">toolbarItemSelected:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationRenewCheckBox</string>
+                                                       <string>authenticationTokenTextField</string>
+                                                       <string>authenticationUserTextField</string>
+                                                       <string>pithosBrowserController</string>
+                                                       <string>userDefaultsController</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>NSButton</string>
+                                                       <string>NSTextField</string>
+                                                       <string>NSTextField</string>
+                                                       <string>PithosBrowserController</string>
+                                                       <string>NSUserDefaultsController</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>authenticationRenewCheckBox</string>
+                                                       <string>authenticationTokenTextField</string>
+                                                       <string>authenticationUserTextField</string>
+                                                       <string>pithosBrowserController</string>
+                                                       <string>userDefaultsController</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">authenticationRenewCheckBox</string>
+                                                               <string key="candidateClassName">NSButton</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">authenticationTokenTextField</string>
+                                                               <string key="candidateClassName">NSTextField</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">authenticationUserTextField</string>
+                                                               <string key="candidateClassName">NSTextField</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">pithosBrowserController</string>
+                                                               <string key="candidateClassName">PithosBrowserController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">userDefaultsController</string>
+                                                               <string key="candidateClassName">NSUserDefaultsController</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/PithosPreferencesController.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">pithos_macosAppDelegate</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>aboutPithos:</string>
+                                                       <string>showPithosBrowser:</string>
+                                                       <string>showPithosPreferences:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>aboutPithos:</string>
+                                                       <string>showPithosBrowser:</string>
+                                                       <string>showPithosPreferences:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">aboutPithos:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">showPithosBrowser:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">showPithosPreferences:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>pithosBrowserController</string>
+                                                       <string>pithosPreferencesController</string>
+                                                       <string>statusMenu</string>
+                                                       <string>userDefaultsController</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>PithosBrowserController</string>
+                                                       <string>PithosPreferencesController</string>
+                                                       <string>NSMenu</string>
+                                                       <string>NSUserDefaultsController</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>pithosBrowserController</string>
+                                                       <string>pithosPreferencesController</string>
+                                                       <string>statusMenu</string>
+                                                       <string>userDefaultsController</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">pithosBrowserController</string>
+                                                               <string key="candidateClassName">PithosBrowserController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">pithosPreferencesController</string>
+                                                               <string key="candidateClassName">PithosPreferencesController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">statusMenu</string>
+                                                               <string key="candidateClassName">NSMenu</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">userDefaultsController</string>
+                                                               <string key="candidateClassName">NSUserDefaultsController</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/pithos_macosAppDelegate.h</string>
+                                       </object>
+                               </object>
+                       </object>
                </object>
-               <object class="IBClassDescriber" key="IBDocument.Classes"/>
                <int key="IBDocument.localizationMode">0</int>
                <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">