Sync folder can be selected in the preferences.
authorMiltiadis Vasilakis <mvasilak@gmail.com>
Tue, 25 Oct 2011 13:41:33 +0000 (16:41 +0300)
committerMiltiadis Vasilakis <mvasilak@gmail.com>
Tue, 25 Oct 2011 13:41:33 +0000 (16:41 +0300)
Improvements in handling of user properties.

13 files changed:
pithos-macos.xcodeproj/project.pbxproj
pithos-macos/DirPathFileURLTransformer.h [new file with mode: 0644]
pithos-macos/DirPathFileURLTransformer.m [new file with mode: 0644]
pithos-macos/PithosActivityFacility.m
pithos-macos/PithosPreferencesController.h
pithos-macos/PithosPreferencesController.m
pithos-macos/PithosPreferencesController.xib
pithos-macos/PithosSyncDaemon.h
pithos-macos/PithosSyncDaemon.m
pithos-macos/en.lproj/MainMenu.xib
pithos-macos/pithos-macos-Info.plist
pithos-macos/pithos_macosAppDelegate.h
pithos-macos/pithos_macosAppDelegate.m

index d33e610..c59a1b1 100644 (file)
@@ -52,6 +52,7 @@
                6154BF4B145554D600EE353A /* pithos-logo-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 6154BF4A145554D600EE353A /* pithos-logo-small.png */; };
                6154BF4D145558E300EE353A /* pithos.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6154BF4C145558E300EE353A /* pithos.icns */; };
                6154BF501456A83200EE353A /* UsingSizeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6154BF4F1456A83100EE353A /* UsingSizeTransformer.m */; };
+               6154BF531456EE4900EE353A /* DirPathFileURLTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6154BF521456EE4700EE353A /* DirPathFileURLTransformer.m */; };
                615615DD140CECDB00017BD4 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 615615DC140CECDB00017BD4 /* libz.dylib */; };
                615A444E140F8A5700308614 /* MetadataKeyTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 615A444D140F8A5700308614 /* MetadataKeyTransformer.m */; };
                615A4451140F8A7F00308614 /* MetadataKeyFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 615A4450140F8A7F00308614 /* MetadataKeyFormatter.m */; };
                6154BF4C145558E300EE353A /* pithos.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = pithos.icns; path = ../pithos.icns; sourceTree = "<group>"; };
                6154BF4E1456A83100EE353A /* UsingSizeTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UsingSizeTransformer.h; path = "pithos-macos/UsingSizeTransformer.h"; sourceTree = "<group>"; };
                6154BF4F1456A83100EE353A /* UsingSizeTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UsingSizeTransformer.m; path = "pithos-macos/UsingSizeTransformer.m"; sourceTree = "<group>"; };
+               6154BF511456EE4600EE353A /* DirPathFileURLTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirPathFileURLTransformer.h; path = "pithos-macos/DirPathFileURLTransformer.h"; sourceTree = "<group>"; };
+               6154BF521456EE4700EE353A /* DirPathFileURLTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DirPathFileURLTransformer.m; path = "pithos-macos/DirPathFileURLTransformer.m"; sourceTree = "<group>"; };
                615615DC140CECDB00017BD4 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
                615A444C140F8A5700308614 /* MetadataKeyTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MetadataKeyTransformer.h; path = "pithos-macos/MetadataKeyTransformer.h"; sourceTree = "<group>"; };
                615A444D140F8A5700308614 /* MetadataKeyTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MetadataKeyTransformer.m; path = "pithos-macos/MetadataKeyTransformer.m"; sourceTree = "<group>"; };
                                6164B2DC1450E55C00D4C1AB /* LastCompletedSyncTransformer.m */,
                                6154BF4E1456A83100EE353A /* UsingSizeTransformer.h */,
                                6154BF4F1456A83100EE353A /* UsingSizeTransformer.m */,
+                               6154BF511456EE4600EE353A /* DirPathFileURLTransformer.h */,
+                               6154BF521456EE4700EE353A /* DirPathFileURLTransformer.m */,
                        );
                        name = "Value Transformers";
                        sourceTree = "<group>";
                                61F04133144DB97600A0C788 /* PithosSyncDaemon.m in Sources */,
                                6164B2DD1450E55C00D4C1AB /* LastCompletedSyncTransformer.m in Sources */,
                                6154BF501456A83200EE353A /* UsingSizeTransformer.m in Sources */,
+                               6154BF531456EE4900EE353A /* DirPathFileURLTransformer.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/pithos-macos/DirPathFileURLTransformer.h b/pithos-macos/DirPathFileURLTransformer.h
new file mode 100644 (file)
index 0000000..ba458c5
--- /dev/null
@@ -0,0 +1,39 @@
+//
+//  DirPathFileURLTransformer.h
+//  pithos-macos
+//
+// Copyright 2011 GRNET S.A. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+// 
+//   1. Redistributions of source code must retain the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above
+//      copyright notice, this list of conditions and the following
+//      disclaimer in the documentation and/or other materials
+//      provided with the distribution.
+// 
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// 
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
+
+@interface DirPathFileURLTransformer : NSValueTransformer
+@end
diff --git a/pithos-macos/DirPathFileURLTransformer.m b/pithos-macos/DirPathFileURLTransformer.m
new file mode 100644 (file)
index 0000000..b8e4cab
--- /dev/null
@@ -0,0 +1,66 @@
+//
+//  DirPathFileURLTransformer.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 "DirPathFileURLTransformer.h"
+
+@implementation DirPathFileURLTransformer
+
++ (Class)transformedValueClass {
+       return [NSURL class];
+}
+
++ (BOOL)allowsReverseTransformation {
+       return YES;
+}
+
+- (id)transformedValue:(id)value {
+    if (value == nil)
+               return nil;
+    return [NSURL fileURLWithPath:(NSString *)value];
+}
+
+- (id)reverseTransformedValue:(id)value {
+    if (value == nil)
+               return nil;
+    return [(NSURL *)value path];
+}
+
++ (void)initialize {
+    [[NSValueTransformer class] setValueTransformer:[self new] forName:@"DirPathFileURLTransformer"];
+}
+
+@end
index a11ab79..ae692cf 100644 (file)
@@ -178,7 +178,6 @@ static PithosActivityFacility *defaultPithosActivityFacility = nil;
         [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];
index cdb35c4..4017bbc 100644 (file)
@@ -39,7 +39,6 @@
 @class PithosBrowserController;
 
 @interface PithosPreferencesController : NSWindowController <NSWindowDelegate> {
-    NSUserDefaultsController *userDefaultsController;
     PithosBrowserController *pithosBrowserController;
     
     NSTextField *authenticationUserTextField;
@@ -50,7 +49,6 @@
     NSDictionaryController *selectedGroupMembersDictionaryController;
 }
 
-@property (nonatomic, assign) IBOutlet NSUserDefaultsController *userDefaultsController;
 @property (nonatomic, assign) IBOutlet PithosBrowserController *pithosBrowserController;
 
 @property (nonatomic, assign) IBOutlet NSTextField *authenticationUserTextField;
index 43f6d2b..3dc3635 100644 (file)
@@ -41,7 +41,7 @@
 #import "pithos_macosAppDelegate.h"
 
 @implementation PithosPreferencesController
-@synthesize userDefaultsController, pithosBrowserController;
+@synthesize pithosBrowserController;
 @synthesize authenticationUserTextField, authenticationTokenTextField, authenticationRenewCheckBox;
 @synthesize groupsDictionaryController, selectedGroupMembersDictionaryController;
 
@@ -72,9 +72,7 @@
 
 - (void)windowWillClose:(NSNotification *)notification {
     [[self window] makeFirstResponder:nil];
-    NSString *authUser = [[userDefaultsController values] valueForKey:@"authUser"];
-    NSString *authToken = [[userDefaultsController values] valueForKey:@"authToken"];
-    [(pithos_macosAppDelegate *)[[NSApplication sharedApplication] delegate] authenticateWithAuthUser:authUser authToken:authToken];
+    [(pithos_macosAppDelegate *)[[NSApplication sharedApplication] delegate] authenticate];
 }
 
 - (IBAction)toolbarItemSelected:(id)sender {
@@ -84,7 +82,6 @@
 #pragma Authentication
 
 - (IBAction)authenticationLogin:(id)sender {
-    // XXX hardcoded for now
     NSProcessInfo *processInfo = [NSProcessInfo processInfo];
     NSString *loginURL = [NSString stringWithFormat:@"%@?next=pithos://%@_%d",
                           ((pithos_macosAppDelegate *)[[NSApplication sharedApplication] delegate]).loginURLPrefix, 
@@ -94,8 +91,6 @@
         loginURL = [loginURL stringByAppendingString:@"&renew="];
     NSLog(@"loginURL: %@", loginURL);
     [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:loginURL]];
-    // XXX Should we wait for results or do something else?
-    // XXX check the case where this happens for the first time
 }
 
 #pragma mark -
index 84c1d7b..d0e200f 100644 (file)
@@ -12,9 +12,7 @@
                </object>
                <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <string>NSTabView</string>
-                       <string>NSMenuItem</string>
-                       <string>NSMenu</string>
+                       <string>NSPathCell</string>
                        <string>NSToolbarItem</string>
                        <string>NSButton</string>
                        <string>NSCustomObject</string>
                        <string>NSTableColumn</string>
                        <string>NSBox</string>
                        <string>NSView</string>
-                       <string>NSPopUpButtonCell</string>
                        <string>NSDictionaryController</string>
                        <string>NSToolbar</string>
                        <string>NSScrollView</string>
                        <string>NSTabViewItem</string>
                        <string>NSUserDefaultsController</string>
+                       <string>NSPathControl</string>
                        <string>NSScroller</string>
                        <string>NSTableHeaderView</string>
-                       <string>NSPopUpButton</string>
+                       <string>NSTabView</string>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <int key="NSvFlags">12</int>
                                                        <string key="NSFrameSize">{265, 159}</string>
                                                        <reference key="NSSuperview" ref="369507901"/>
-                                                       <reference key="NSNextKeyView" ref="646652655"/>
+                                                       <reference key="NSNextKeyView" ref="865103585"/>
                                                        <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">
-                                                                               <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">268</int>
                                                                                                <string key="NSFrame">{{12, 116}, {83, 14}}</string>
                                                                                                <reference key="NSSuperview" ref="865103585"/>
-                                                                                               <reference key="NSNextKeyView" ref="268662027"/>
+                                                                                               <reference key="NSNextKeyView" ref="193312849"/>
                                                                                                <bool key="NSEnabled">YES</bool>
                                                                                                <object class="NSTextFieldCell" key="NSCell" id="899323867">
                                                                                                        <int key="NSCellFlags">68288064</int>
                                                                                                <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>
                                                                                                        <int key="NSPeriodicInterval">25</int>
                                                                                                </object>
                                                                                        </object>
-                                                                                       <object class="NSPopUpButton" id="268662027">
+                                                                                       <object class="NSPathControl" id="193312849">
                                                                                                <reference key="NSNextResponder" ref="865103585"/>
                                                                                                <int key="NSvFlags">268</int>
-                                                                                               <string key="NSFrame">{{97, 111}, {161, 22}}</string>
+                                                                                               <object class="NSMutableSet" key="NSDragTypes">
+                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                       <object class="NSArray" key="set.sortedObjects">
+                                                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                               <string>Apple URL pasteboard type</string>
+                                                                                                               <string>NSFilenamesPboardType</string>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                               <string key="NSFrame">{{97, 110}, {161, 22}}</string>
                                                                                                <reference key="NSSuperview" ref="865103585"/>
                                                                                                <reference key="NSNextKeyView" ref="701502029"/>
                                                                                                <bool key="NSEnabled">YES</bool>
-                                                                                               <object class="NSPopUpButtonCell" key="NSCell" id="1034234411">
-                                                                                                       <int key="NSCellFlags">-2076049856</int>
-                                                                                                       <int key="NSCellFlags2">133120</int>
-                                                                                                       <reference key="NSSupport" ref="26"/>
-                                                                                                       <reference key="NSControlView" ref="268662027"/>
-                                                                                                       <int key="NSButtonFlags">109199615</int>
-                                                                                                       <int key="NSButtonFlags2">129</int>
-                                                                                                       <string key="NSAlternateContents"/>
-                                                                                                       <string key="NSKeyEquivalent"/>
-                                                                                                       <int key="NSPeriodicDelay">400</int>
-                                                                                                       <int key="NSPeriodicInterval">75</int>
-                                                                                                       <object class="NSMenuItem" key="NSMenuItem" id="727687586">
-                                                                                                               <reference key="NSMenu" ref="212541681"/>
-                                                                                                               <string key="NSTitle">Item 1</string>
-                                                                                                               <string key="NSKeyEquiv"/>
-                                                                                                               <int key="NSKeyEquivModMask">1048576</int>
-                                                                                                               <int key="NSMnemonicLoc">2147483647</int>
-                                                                                                               <int key="NSState">1</int>
-                                                                                                               <object class="NSCustomResource" key="NSOnImage" id="880420468">
-                                                                                                                       <string key="NSClassName">NSImage</string>
-                                                                                                                       <string key="NSResourceName">NSMenuCheckmark</string>
-                                                                                                               </object>
-                                                                                                               <object class="NSCustomResource" key="NSMixedImage" id="566173693">
-                                                                                                                       <string key="NSClassName">NSImage</string>
-                                                                                                                       <string key="NSResourceName">NSMenuMixedState</string>
+                                                                                               <object class="NSPathCell" key="NSCell" id="238772973">
+                                                                                                       <int key="NSCellFlags">337772033</int>
+                                                                                                       <int key="NSCellFlags2">131072</int>
+                                                                                                       <object class="NSURL" key="NSContents">
+                                                                                                               <nil key="NS.base"/>
+                                                                                                               <object class="NSMutableString" key="NS.relative">
+                                                                                                                       <characters key="NS.bytes">file://localhost/</characters>
                                                                                                                </object>
-                                                                                                               <string key="NSAction">_popUpItemAction:</string>
-                                                                                                               <reference key="NSTarget" ref="1034234411"/>
                                                                                                        </object>
-                                                                                                       <bool key="NSMenuItemRespectAlignment">YES</bool>
-                                                                                                       <object class="NSMenu" key="NSMenu" id="212541681">
-                                                                                                               <string key="NSTitle">OtherViews</string>
-                                                                                                               <object class="NSMutableArray" key="NSMenuItems">
-                                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                                                                                       <reference ref="727687586"/>
-                                                                                                                       <object class="NSMenuItem" id="108252208">
-                                                                                                                               <reference key="NSMenu" ref="212541681"/>
-                                                                                                                               <string key="NSTitle">Item 2</string>
-                                                                                                                               <string key="NSKeyEquiv"/>
-                                                                                                                               <int key="NSKeyEquivModMask">1048576</int>
-                                                                                                                               <int key="NSMnemonicLoc">2147483647</int>
-                                                                                                                               <reference key="NSOnImage" ref="880420468"/>
-                                                                                                                               <reference key="NSMixedImage" ref="566173693"/>
-                                                                                                                               <string key="NSAction">_popUpItemAction:</string>
-                                                                                                                               <reference key="NSTarget" ref="1034234411"/>
+                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                       <reference key="NSControlView" ref="193312849"/>
+                                                                                                       <object class="NSMutableArray" key="NSPathComponentCells">
+                                                                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                               <object class="NSPathComponentCell">
+                                                                                                                       <int key="NSCellFlags">67239488</int>
+                                                                                                                       <int key="NSCellFlags2">1024</int>
+                                                                                                                       <string key="NSContents">karvouni4</string>
+                                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                                       <reference key="NSBackgroundColor" ref="1019997203"/>
+                                                                                                                       <reference key="NSTextColor" ref="44104873"/>
+                                                                                                                       <object class="NSURL" key="NSURL">
+                                                                                                                               <nil key="NS.base"/>
+                                                                                                                               <string key="NS.relative">file://localhost//</string>
                                                                                                                        </object>
-                                                                                                                       <object class="NSMenuItem" id="267610935">
-                                                                                                                               <reference key="NSMenu" ref="212541681"/>
-                                                                                                                               <string key="NSTitle">Item 3</string>
-                                                                                                                               <string key="NSKeyEquiv"/>
-                                                                                                                               <int key="NSKeyEquivModMask">1048576</int>
-                                                                                                                               <int key="NSMnemonicLoc">2147483647</int>
-                                                                                                                               <reference key="NSOnImage" ref="880420468"/>
-                                                                                                                               <reference key="NSMixedImage" ref="566173693"/>
-                                                                                                                               <string key="NSAction">_popUpItemAction:</string>
-                                                                                                                               <reference key="NSTarget" ref="1034234411"/>
+                                                                                                               </object>
+                                                                                                               <object class="NSPathComponentCell">
+                                                                                                                       <int key="NSCellFlags">67239488</int>
+                                                                                                                       <int key="NSCellFlags2">1024</int>
+                                                                                                                       <string key="NSContents">Macintosh HD</string>
+                                                                                                                       <reference key="NSSupport" ref="26"/>
+                                                                                                                       <reference key="NSBackgroundColor" ref="1019997203"/>
+                                                                                                                       <reference key="NSTextColor" ref="44104873"/>
+                                                                                                                       <object class="NSURL" key="NSURL">
+                                                                                                                               <nil key="NS.base"/>
+                                                                                                                               <string key="NS.relative">file://localhost//</string>
                                                                                                                        </object>
                                                                                                                </object>
-                                                                                                               <reference key="NSMenuFont" ref="271467070"/>
                                                                                                        </object>
-                                                                                                       <int key="NSPreferredEdge">1</int>
-                                                                                                       <bool key="NSUsesItemFromMenu">YES</bool>
-                                                                                                       <bool key="NSAltersState">YES</bool>
-                                                                                                       <int key="NSArrowPosition">2</int>
+                                                                                                       <int key="NSPathStyle">2</int>
+                                                                                                       <reference key="NSDelegate" ref="193312849"/>
                                                                                                </object>
                                                                                        </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">
-                                                                               <reference key="NSNextResponder" ref="564742342"/>
+                                                                               <nil key="NSNextResponder"/>
                                                                                <int key="NSvFlags">274</int>
                                                                                <object class="NSMutableArray" key="NSSubviews">
                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                        </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="939681372"/>
+                                                       <reference key="NSSelectedTabViewItem" ref="874188166"/>
                                                        <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="646652655"/>
+                                                               <reference ref="865103585"/>
                                                        </object>
                                                </object>
                                        </object>
                                        </object>
                                        <int key="connectionID">465</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBBindingConnection" key="connection">
+                                               <string key="label">value: values.pithosSyncDirectoryPath</string>
+                                               <reference key="source" ref="193312849"/>
+                                               <reference key="destination" ref="700105088"/>
+                                               <object class="NSNibBindingConnector" key="connector">
+                                                       <reference key="NSSource" ref="193312849"/>
+                                                       <reference key="NSDestination" ref="700105088"/>
+                                                       <string key="NSLabel">value: values.pithosSyncDirectoryPath</string>
+                                                       <string key="NSBinding">value</string>
+                                                       <string key="NSKeyPath">values.pithosSyncDirectoryPath</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>DirPathFileURLTransformer</string>
+                                                               </object>
+                                                       </object>
+                                                       <int key="NSNibBindingConnectorVersion">2</int>
+                                               </object>
+                                       </object>
+                                       <int key="connectionID">477</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                                        <reference ref="1054241470"/>
                                                        <reference ref="892129196"/>
                                                        <reference ref="852692720"/>
-                                                       <reference ref="268662027"/>
+                                                       <reference ref="193312849"/>
                                                </object>
                                                <reference key="parent" ref="874188166"/>
                                        </object>
                                                <reference key="parent" ref="1054241470"/>
                                        </object>
                                        <object class="IBObjectRecord">
-                                               <int key="objectID">367</int>
-                                               <reference key="object" ref="268662027"/>
-                                               <object class="NSMutableArray" key="children">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="1034234411"/>
-                                               </object>
-                                               <reference key="parent" ref="865103585"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">368</int>
-                                               <reference key="object" ref="1034234411"/>
-                                               <object class="NSMutableArray" key="children">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="212541681"/>
-                                               </object>
-                                               <reference key="parent" ref="268662027"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">369</int>
-                                               <reference key="object" ref="212541681"/>
-                                               <object class="NSMutableArray" key="children">
-                                                       <bool key="EncodedWithXMLCoder">YES</bool>
-                                                       <reference ref="727687586"/>
-                                                       <reference ref="108252208"/>
-                                                       <reference ref="267610935"/>
-                                               </object>
-                                               <reference key="parent" ref="1034234411"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">370</int>
-                                               <reference key="object" ref="727687586"/>
-                                               <reference key="parent" ref="212541681"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">371</int>
-                                               <reference key="object" ref="108252208"/>
-                                               <reference key="parent" ref="212541681"/>
-                                       </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">372</int>
-                                               <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">
                                                <reference key="object" ref="894212860"/>
                                                <reference key="parent" ref="0"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">470</int>
+                                               <reference key="object" ref="193312849"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="238772973"/>
+                                               </object>
+                                               <reference key="parent" ref="865103585"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">471</int>
+                                               <reference key="object" ref="238772973"/>
+                                               <reference key="parent" ref="193312849"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>341.IBPluginDependency</string>
                                        <string>343.IBPluginDependency</string>
                                        <string>344.IBPluginDependency</string>
-                                       <string>367.IBPluginDependency</string>
-                                       <string>368.IBPluginDependency</string>
-                                       <string>369.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>4.IBPluginDependency</string>
                                        <string>433.IBPluginDependency</string>
                                        <string>449.IBPluginDependency</string>
+                                       <string>470.IBPluginDependency</string>
+                                       <string>471.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>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">465</int>
+                       <int key="maxID">477</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes"/>
                <int key="IBDocument.localizationMode">0</int>
                                <bool key="EncodedWithXMLCoder">YES</bool>
                                <string>NSAddTemplate</string>
                                <string>NSEveryone</string>
-                               <string>NSMenuCheckmark</string>
-                               <string>NSMenuMixedState</string>
                                <string>NSPreferencesGeneral</string>
                                <string>NSRemoveTemplate</string>
                                <string>NSSwitch</string>
                                <bool key="EncodedWithXMLCoder">YES</bool>
                                <string>{8, 8}</string>
                                <string>{32, 32}</string>
-                               <string>{9, 8}</string>
-                               <string>{7, 2}</string>
                                <string>{32, 32}</string>
                                <string>{8, 8}</string>
                                <string>{15, 15}</string>
index caec13f..dfd3d77 100644 (file)
@@ -75,6 +75,7 @@
 @property (nonatomic, retain) NSMutableDictionary *storedLocalObjectStates;
 @property (nonatomic, retain) NSMutableDictionary *currentLocalObjectStates;
 
+@property (nonatomic, readonly) NSString *directoryPath;
 @property (nonatomic, readonly) NSString *containerDirectoryPath;
 @property (nonatomic, readonly) NSString *pithosStateFilePath;
 @property (nonatomic, readonly) NSString *tempDownloadsDirPath;
index 15d5a0e..5ecb9c6 100644 (file)
@@ -69,7 +69,7 @@
 
 @implementation PithosSyncDaemon
 @synthesize blockHash, blockSize, lastModified, lastCompletedSync, remoteObjects, storedLocalObjectStates, currentLocalObjectStates;
-@synthesize containerDirectoryPath, pithosStateFilePath, tempDownloadsDirPath, tempTrashDirPath;
+@synthesize directoryPath, containerDirectoryPath, pithosStateFilePath, tempDownloadsDirPath, tempTrashDirPath;
 
 #pragma mark -
 #pragma Object Lifecycle
index 5cb878b..a507cf2 100644 (file)
@@ -12,7 +12,6 @@
                </object>
                <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <string>NSUserDefaultsController</string>
                        <string>NSMenu</string>
                        <string>NSMenuItem</string>
                        <string>NSCustomObject</string>
                                        </object>
                                </object>
                        </object>
-                       <object class="NSUserDefaultsController" id="231416877">
-                               <bool key="NSAppliesImmediately">YES</bool>
-                       </object>
                </object>
                <object class="IBObjectContainer" key="IBDocument.Objects">
                        <object class="NSMutableArray" key="connectionRecords">
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
-                                               <string key="label">userDefaultsController</string>
-                                               <reference key="source" ref="976324537"/>
-                                               <reference key="destination" ref="231416877"/>
-                                       </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"/>
                                                <reference key="parent" ref="0"/>
                                                <string key="objectName">PithosPreferencesController</string>
                                        </object>
-                                       <object class="IBObjectRecord">
-                                               <int key="objectID">557</int>
-                                               <reference key="object" ref="231416877"/>
-                                               <reference key="parent" ref="0"/>
-                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>544.IBPluginDependency</string>
                                        <string>545.IBPluginDependency</string>
                                        <string>546.IBPluginDependency</string>
-                                       <string>557.IBPluginDependency</string>
                                        <string>56.IBPluginDependency</string>
                                        <string>57.IBPluginDependency</string>
                                        <string>58.IBPluginDependency</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">
                        <nil key="sourceID"/>
                        <int key="maxID">575</int>
                </object>
-               <object class="IBClassDescriber" key="IBDocument.Classes"/>
+               <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">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>forceRefresh:</string>
+                                                       <string>refresh:</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>forceRefresh:</string>
+                                                       <string>refresh:</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">forceRefresh:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">refresh:</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>activityProgressIndicator</string>
+                                                       <string>activityTextField</string>
+                                                       <string>browser</string>
+                                                       <string>browserMenu</string>
+                                                       <string>horizontalSplitView</string>
+                                                       <string>leftBottomView</string>
+                                                       <string>leftTopView</string>
+                                                       <string>outlineView</string>
+                                                       <string>outlineViewMenu</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>NSMenu</string>
+                                                       <string>NSSplitView</string>
+                                                       <string>NSView</string>
+                                                       <string>NSView</string>
+                                                       <string>NSOutlineView</string>
+                                                       <string>NSMenu</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>browserMenu</string>
+                                                       <string>horizontalSplitView</string>
+                                                       <string>leftBottomView</string>
+                                                       <string>leftTopView</string>
+                                                       <string>outlineView</string>
+                                                       <string>outlineViewMenu</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">browserMenu</string>
+                                                               <string key="candidateClassName">NSMenu</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">outlineViewMenu</string>
+                                                               <string key="candidateClassName">NSMenu</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>groupsDictionaryController</string>
+                                                       <string>pithosBrowserController</string>
+                                                       <string>selectedGroupMembersDictionaryController</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>NSDictionaryController</string>
+                                                       <string>PithosBrowserController</string>
+                                                       <string>NSDictionaryController</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>groupsDictionaryController</string>
+                                                       <string>pithosBrowserController</string>
+                                                       <string>selectedGroupMembersDictionaryController</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">groupsDictionaryController</string>
+                                                               <string key="candidateClassName">NSDictionaryController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">pithosBrowserController</string>
+                                                               <string key="candidateClassName">PithosBrowserController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">selectedGroupMembersDictionaryController</string>
+                                                               <string key="candidateClassName">NSDictionaryController</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">PithosSyncDaemon</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/PithosSyncDaemon.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>
+                                                       <string>syncNow:</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>
+                                               </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>
+                                                       <string>syncNow:</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 class="IBActionInfo">
+                                                               <string key="name">syncNow:</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>pithosSyncDaemon</string>
+                                                       <string>statusMenu</string>
+                                               </object>
+                                               <object class="NSMutableArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>PithosBrowserController</string>
+                                                       <string>PithosPreferencesController</string>
+                                                       <string>PithosSyncDaemon</string>
+                                                       <string>NSMenu</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>pithosSyncDaemon</string>
+                                                       <string>statusMenu</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">pithosSyncDaemon</string>
+                                                               <string key="candidateClassName">PithosSyncDaemon</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">statusMenu</string>
+                                                               <string key="candidateClassName">NSMenu</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>
                <int key="IBDocument.localizationMode">0</int>
                <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
index c67f429..7ba208d 100644 (file)
@@ -24,7 +24,7 @@
        <array>
                <dict>
                        <key>CFBundleURLName</key>
-                       <string>Pithos' URL</string>
+                       <string>Pithos&apos; URL</string>
                        <key>CFBundleURLSchemes</key>
                        <array>
                                <string>pithos</string>
@@ -49,8 +49,6 @@
        <string>https://pithos.dev.grnet.gr/v1</string>
        <key>PithosSyncContainerName</key>
        <string>pithos</string>
-       <key>PithosSyncDirectoryPath</key>
-       <string></string>
        <key>PithosSyncTimeInterval</key>
        <real>180</real>
 </dict>
index b5d50c2..326616d 100644 (file)
     IBOutlet PithosBrowserController *pithosBrowserController;
     IBOutlet PithosPreferencesController *pithosPreferencesController;
     
-    IBOutlet PithosSyncDaemon *pithosSyncDaemon;
+    PithosSyncDaemon *pithosSyncDaemon;
     BOOL alwaysNo;
 
     IBOutlet NSMenu *statusMenu;
     NSStatusItem *statusItem;
     
-    IBOutlet NSUserDefaultsController *userDefaultsController;
-    
     NSString *storageURLPrefix;
     NSString *publicURLPrefix;
     NSString *loginURLPrefix;
     NSString *aboutURL;
     
-    NSString *syncDirectoryPath;
     NSString *syncContainerName;
     NSTimeInterval syncTimeInterval;
 }
 - (IBAction)aboutPithos:(id)sender;
 - (IBAction)syncNow:(id)sender;
 
-- (void)authenticateWithAuthUser:(NSString *)authUser authToken:(NSString *)authToken;
+- (void)authenticate;
 - (void)startSyncWithDirectoryPath:(NSString *)directoryPath containerName:(NSString *)containerName;
 
 @property (nonatomic, readonly) NSString *storageURLPrefix;
 @property (nonatomic, readonly) NSString *publicURLPrefix;
 @property (nonatomic, readonly) NSString *loginURLPrefix;
 @property (nonatomic, readonly) NSString *aboutURL;
-@property (nonatomic, readonly) NSString *syncDirectoryPath;
 @property (nonatomic, readonly) NSString *syncContainerName;
 @property (nonatomic, assign) NSTimeInterval syncTimeInterval;
 
index 47260f1..d9b51f2 100644 (file)
@@ -44,7 +44,7 @@
 
 @implementation pithos_macosAppDelegate
 @synthesize storageURLPrefix, publicURLPrefix, loginURLPrefix, aboutURL;
-@synthesize syncDirectoryPath, syncContainerName, syncTimeInterval, pithosBrowserController, pithosSyncDaemon, alwaysNo;
+@synthesize syncContainerName, syncTimeInterval, pithosBrowserController, pithosSyncDaemon, alwaysNo;
 
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
     NSURL *testURL;
     }
     [aboutURL retain];
     
-    syncDirectoryPath = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"PithosSyncDirectoryPath"];
+    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+    NSString *syncDirectoryPath = [userDefaults stringForKey:@"pithosSyncDirectoryPath"];
     if (!syncDirectoryPath || ![syncDirectoryPath length]) {
         syncDirectoryPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"Pithos"];
     } else {
+        NSFileManager *fileManager = [NSFileManager defaultManager];
         BOOL isDirectory;
-        if ([[NSFileManager defaultManager] fileExistsAtPath:syncDirectoryPath isDirectory:&isDirectory] && !isDirectory)
+        BOOL fileExists = [fileManager fileExistsAtPath:syncDirectoryPath isDirectory:&isDirectory];
+        NSError *error = nil;
+        if ((fileExists && !isDirectory) || 
+            (!fileExists && (![fileManager createDirectoryAtPath:syncDirectoryPath withIntermediateDirectories:YES attributes:nil error:&error] || error))) {
             syncDirectoryPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"Pithos"];
+        }   
     }
-    [syncDirectoryPath retain];
+    [userDefaults setObject:syncDirectoryPath forKey:@"pithosSyncDirectoryPath"];
+    [userDefaults synchronize];
     
     syncContainerName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"PithosSyncContainerName"];
     if (!syncContainerName || ![syncContainerName length] || [syncContainerName isEqualToString:@"trash"]) {
                                                         andEventID:kAEGetURL];
     [self showPithosBrowser:self];
     
-    [self authenticateWithAuthUser:[[userDefaultsController values] valueForKey:@"authUser"] 
-                         authToken:[[userDefaultsController values] valueForKey:@"authToken"]];
+    [self authenticate];
 }
 
 // Based on: http://cocoatutorial.grapewave.com/2010/01/creating-a-status-bar-application/
         
         NSLog(@"query authUser: '%@', authToken: '%@'", authUser, authToken);
         if ([authUser length] && [authToken length]) {
-            [[userDefaultsController values] setValue:authUser forKey:@"authUser"];
-            [[userDefaultsController values] setValue:authToken forKey:@"authToken"];
-            
-            [self authenticateWithAuthUser:authUser authToken:authToken];
+            NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+            [userDefaults setObject:authUser forKey:@"authUser"];
+            [userDefaults setObject:authToken forKey:@"authToken"];
+            [userDefaults synchronize];
+
+            [self authenticate];
         }
         // XXX else maybe show an error message?
     }
 #pragma mark -
 #pragma Authentication
 
-- (void)authenticateWithAuthUser:(NSString *)authUser authToken:(NSString *)authToken {
+- (void)authenticate {
+    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+    NSString *authUser = [userDefaults stringForKey:@"authUser"];
+    NSString *authToken = [userDefaults stringForKey:@"authToken"];
+    NSString *syncDirectoryPath = [userDefaults stringForKey:@"pithosSyncDirectoryPath"];
     NSLog(@"Authentication - storageURLPrefix:%@, authUser:%@, authToken:%@", storageURLPrefix, authUser, authToken);
     if ([authUser length] && [authToken length] && 
         (![[ASIPithosRequest authUser] isEqualToString:authUser] || ![[ASIPithosRequest authToken] isEqualToString:authToken])) {
         [self startSyncWithDirectoryPath:syncDirectoryPath containerName:syncContainerName];
         
         [[NSNotificationCenter defaultCenter] postNotificationName:@"PithosAuthenticationCredentialsUpdated" object:self];
+        return;
     }
+    if (![pithosSyncDaemon.directoryPath isEqualToString:syncDirectoryPath])
+        [self startSyncWithDirectoryPath:syncDirectoryPath containerName:syncContainerName];
 }
 
 - (void)startSyncWithDirectoryPath:(NSString *)directoryPath containerName:(NSString *)containerName {
-    self.pithosSyncDaemon = [[[PithosSyncDaemon alloc] initWithDirectoryPath:syncDirectoryPath 
-                                                               containerName:syncContainerName 
+    self.pithosSyncDaemon = [[[PithosSyncDaemon alloc] initWithDirectoryPath:directoryPath 
+                                                               containerName:containerName 
                                                                 timeInterval:syncTimeInterval] autorelease];
 }