root / pithos-macos / PithosSubdirNode.m @ 4e6acad7
History | View | Annotate | Download (24.7 kB)
1 |
// |
---|---|
2 |
// PithosSubdirNode.m |
3 |
// pithos-macos |
4 |
// |
5 |
// Copyright 2011-2012 GRNET S.A. All rights reserved. |
6 |
// |
7 |
// Redistribution and use in source and binary forms, with or |
8 |
// without modification, are permitted provided that the following |
9 |
// conditions are met: |
10 |
// |
11 |
// 1. Redistributions of source code must retain the above |
12 |
// copyright notice, this list of conditions and the following |
13 |
// disclaimer. |
14 |
// |
15 |
// 2. Redistributions in binary form must reproduce the above |
16 |
// copyright notice, this list of conditions and the following |
17 |
// disclaimer in the documentation and/or other materials |
18 |
// provided with the distribution. |
19 |
// |
20 |
// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
21 |
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
22 |
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
23 |
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
24 |
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
25 |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
26 |
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
27 |
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
28 |
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
29 |
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
30 |
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
31 |
// POSSIBILITY OF SUCH DAMAGE. |
32 |
// |
33 |
// The views and conclusions contained in the software and |
34 |
// documentation are those of the authors and should not be |
35 |
// interpreted as representing official policies, either expressed |
36 |
// or implied, of GRNET S.A. |
37 |
|
38 |
#import "PithosSubdirNode.h" |
39 |
#import "ASIPithosRequest.h" |
40 |
#import "ASIPithos.h" |
41 |
#import "ASIPithosObjectRequest.h" |
42 |
#import "ASIPithosContainer.h" |
43 |
#import "ASIPithosObject.h" |
44 |
#import "ASINetworkQueue.h" |
45 |
#import "ASIDownloadCache.h" |
46 |
#import "PithosUtilities.h" |
47 |
#import "PithosObjectNodeInfoController.h" |
48 |
|
49 |
static NSImage *sharedIcon = nil; |
50 |
|
51 |
@implementation PithosSubdirNode |
52 |
@synthesize pithosObject, versions; |
53 |
@synthesize isPublic; |
54 |
|
55 |
+ (void)initialize { |
56 |
if (self == [PithosSubdirNode class]) |
57 |
sharedIcon = [[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericFolderIcon)] retain]; |
58 |
} |
59 |
|
60 |
#pragma mark - |
61 |
#pragma mark Object Lifecycle |
62 |
|
63 |
- (id)initWithPithos:(ASIPithos *)aPithos |
64 |
pithosContainer:(ASIPithosContainer *)aPithosContainer |
65 |
pithosObject:(ASIPithosObject *)aPithosObject { |
66 |
if ((self = [super init])) { |
67 |
self.pithos = aPithos; |
68 |
self.pithosContainer = aPithosContainer; |
69 |
self.pithosObject = aPithosObject; |
70 |
refreshParent = NO; |
71 |
} |
72 |
return self; |
73 |
} |
74 |
|
75 |
- (void)dealloc { |
76 |
[refreshVersionsObjectRequest clearDelegatesAndCancel]; |
77 |
[refreshVersionsObjectRequest release]; |
78 |
[refreshMetadataObjectRequest clearDelegatesAndCancel]; |
79 |
[refreshMetadataObjectRequest release]; |
80 |
[applyMetadataObjectRequest clearDelegatesAndCancel]; |
81 |
[applyMetadataObjectRequest release]; |
82 |
[versions release]; |
83 |
[pithosObject release]; |
84 |
[super dealloc]; |
85 |
} |
86 |
|
87 |
#pragma mark - |
88 |
#pragma mark Properties |
89 |
|
90 |
- (void)setPithos:(ASIPithos *)aPithos { |
91 |
if (aPithos && ![aPithos isEqualTo:pithos]) { |
92 |
[pithos release]; |
93 |
pithos = [aPithos retain]; |
94 |
[url release]; |
95 |
url = nil; |
96 |
} |
97 |
} |
98 |
|
99 |
- (NSString *)url { |
100 |
if (url == nil) |
101 |
url = [[NSString alloc] initWithFormat:@"subdir %@/%@/%@%@", |
102 |
(sharingAccount ? [pithos storageURLWithAuthUser:sharingAccount] : pithos.storageURL), |
103 |
pithosContainer.name, |
104 |
prefix, |
105 |
(shared ? @"?shared" : @"")]; |
106 |
return url; |
107 |
} |
108 |
|
109 |
- (NSString *)displayName { |
110 |
if (displayName == nil) { |
111 |
displayName = [pithosObject.name lastPathComponent]; |
112 |
if (!pithosObject.subdir && [pithosObject.name hasSuffix:@"/"]) |
113 |
displayName = [displayName stringByAppendingString:@"/"]; |
114 |
[displayName retain]; |
115 |
} |
116 |
return [[displayName copy] autorelease]; |
117 |
} |
118 |
|
119 |
- (void)setDisplayName:(NSString *)aDisplayName { |
120 |
} |
121 |
|
122 |
- (NSImage *)icon { |
123 |
if (icon == nil) |
124 |
icon = [sharedIcon retain]; |
125 |
return icon; |
126 |
} |
127 |
|
128 |
- (void)setPithosObject:(ASIPithosObject *)aPithosObject { |
129 |
if (![pithosObject isEqualTo:aPithosObject]) { |
130 |
[pithosObject release]; |
131 |
pithosObject = [aPithosObject retain]; |
132 |
} |
133 |
if (pithosObject.subdir) { |
134 |
self.prefix = [pithosObject.name substringToIndex:([pithosObject.name length] - 1)]; |
135 |
} else { |
136 |
self.prefix = [NSString stringWithString:pithosObject.name]; |
137 |
} |
138 |
self.isPublic = (pithosObject.publicURI != nil); |
139 |
// Refresh browser if the object is in my shared and is no longer shared |
140 |
if (shared && !pithosObject.subdir && !pithosObject.sharing) { |
141 |
[[NSNotificationCenter defaultCenter] postNotificationName:@"PithosBrowserRefreshNeeeded" object:self]; |
142 |
} |
143 |
} |
144 |
|
145 |
- (void)setLimitedPithosObject:(ASIPithosObject *)aPithosObject { |
146 |
if (![pithosObject isEqualTo:aPithosObject]) { |
147 |
self.pithosObject.subdir = aPithosObject.subdir; |
148 |
self.pithosObject.name = aPithosObject.name; |
149 |
self.pithosObject.hash = aPithosObject.hash; |
150 |
self.pithosObject.objectHash = aPithosObject.objectHash; |
151 |
self.pithosObject.UUID = aPithosObject.UUID; |
152 |
self.pithosObject.bytes = aPithosObject.bytes; |
153 |
self.pithosObject.contentType = aPithosObject.contentType; |
154 |
self.pithosObject.lastModified = aPithosObject.lastModified; |
155 |
self.pithosObject.version = aPithosObject.version; |
156 |
self.pithosObject.versionTimestamp = aPithosObject.versionTimestamp; |
157 |
self.pithosObject.modifiedBy = aPithosObject.modifiedBy; |
158 |
self.pithosObject.sharedBy = aPithosObject.sharedBy; |
159 |
self.pithosObject.allowedTo = aPithosObject.allowedTo; |
160 |
if (!pithosNodeInfoController) { |
161 |
self.pithosObject.sharing = aPithosObject.sharing; |
162 |
self.pithosObject.publicURI = aPithosObject.publicURI; |
163 |
self.pithosObject = pithosObject; |
164 |
} |
165 |
} |
166 |
} |
167 |
|
168 |
#pragma mark - |
169 |
#pragma mark ASIHTTPRequestDelegate |
170 |
|
171 |
- (void)objectRequestFinished:(ASIPithosObjectRequest *)request { |
172 |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
173 |
NSLog(@"URL: %@", [request url]); |
174 |
NSLog(@"cached: %d", [request didUseCachedResponse]); |
175 |
|
176 |
if ([request isEqualTo:applyMetadataObjectRequest]) { |
177 |
int responseStatusCode = applyMetadataObjectRequest.responseStatusCode; |
178 |
if ((responseStatusCode != 201) && (responseStatusCode != 202)) |
179 |
[PithosUtilities unexpectedResponseStatusAlertWithRequest:applyMetadataObjectRequest]; |
180 |
@synchronized(self) { |
181 |
[applyMetadataObjectRequest release]; |
182 |
applyMetadataObjectRequest = nil; |
183 |
} |
184 |
if ((responseStatusCode == 201) || (responseStatusCode == 202)) |
185 |
[self refreshInfo]; |
186 |
} else if ([request isEqualTo:refreshMetadataObjectRequest]) { |
187 |
[[pithosNodeInfoController window] makeFirstResponder:nil]; |
188 |
self.pithosObject = [refreshMetadataObjectRequest object]; |
189 |
if (refreshParent) { |
190 |
// Ask the parent for refresh for the case where an object was removed |
191 |
// It is done here so that it doesn't affect the info window refresh |
192 |
[parent refresh]; |
193 |
refreshParent = NO; |
194 |
} |
195 |
@synchronized(self) { |
196 |
[refreshMetadataObjectRequest release]; |
197 |
refreshMetadataObjectRequest = nil; |
198 |
} |
199 |
} else if ([request isEqualTo:refreshVersionsObjectRequest]) { |
200 |
[[pithosNodeInfoController window] makeFirstResponder:nil]; |
201 |
self.versions = [refreshVersionsObjectRequest versions]; |
202 |
@synchronized(self) { |
203 |
[refreshVersionsObjectRequest release]; |
204 |
refreshVersionsObjectRequest = nil; |
205 |
} |
206 |
} |
207 |
[pool drain]; |
208 |
} |
209 |
|
210 |
- (void)objectRequestFailed:(ASIPithosObjectRequest *)request { |
211 |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
212 |
NSUInteger retries = [[request.userInfo objectForKey:@"retries"] unsignedIntegerValue]; |
213 |
if (retries > 0) { |
214 |
ASIPithosObjectRequest *newRequest = (ASIPithosObjectRequest *)[[PithosUtilities copyRequest:request] autorelease]; |
215 |
[(NSMutableDictionary *)(newRequest.userInfo)setObject:[NSNumber numberWithUnsignedInteger:(--retries)] forKey:@"retries"]; |
216 |
if ([request isEqualTo:applyMetadataObjectRequest]) { |
217 |
@synchronized(self) { |
218 |
[applyMetadataObjectRequest release]; |
219 |
applyMetadataObjectRequest = newRequest; |
220 |
} |
221 |
} else if ([request isEqualTo:refreshMetadataObjectRequest]) { |
222 |
@synchronized(self) { |
223 |
[refreshMetadataObjectRequest release]; |
224 |
refreshMetadataObjectRequest = newRequest; |
225 |
} |
226 |
} else if ([request isEqualTo:refreshVersionsObjectRequest]) { |
227 |
@synchronized(self) { |
228 |
[refreshVersionsObjectRequest release]; |
229 |
refreshVersionsObjectRequest = newRequest; |
230 |
} |
231 |
} |
232 |
[[PithosUtilities prepareRequest:newRequest priority:[[newRequest.userInfo objectForKey:@"priority"] integerValue]] startAsynchronous]; |
233 |
} else { |
234 |
if ([request isEqualTo:applyMetadataObjectRequest]) { |
235 |
dispatch_async(dispatch_get_main_queue(), ^{ |
236 |
[PithosUtilities httpRequestErrorAlertWithRequest:applyMetadataObjectRequest]; |
237 |
}); |
238 |
@synchronized(self) { |
239 |
[applyMetadataObjectRequest release]; |
240 |
applyMetadataObjectRequest = nil; |
241 |
} |
242 |
} else if ([request isEqualTo:refreshMetadataObjectRequest]) { |
243 |
dispatch_async(dispatch_get_main_queue(), ^{ |
244 |
[PithosUtilities httpRequestErrorAlertWithRequest:refreshMetadataObjectRequest]; |
245 |
}); |
246 |
@synchronized(self) { |
247 |
[refreshMetadataObjectRequest release]; |
248 |
refreshMetadataObjectRequest = nil; |
249 |
} |
250 |
} else if ([request isEqualTo:refreshVersionsObjectRequest]) { |
251 |
dispatch_async(dispatch_get_main_queue(), ^{ |
252 |
[PithosUtilities httpRequestErrorAlertWithRequest:refreshVersionsObjectRequest]; |
253 |
}); |
254 |
@synchronized(self) { |
255 |
[refreshVersionsObjectRequest release]; |
256 |
refreshVersionsObjectRequest = nil; |
257 |
} |
258 |
} |
259 |
} |
260 |
[pool drain]; |
261 |
} |
262 |
|
263 |
#pragma mark - |
264 |
#pragma mark Info |
265 |
|
266 |
- (void)applyInfo { |
267 |
@synchronized(self) { |
268 |
if (applyMetadataObjectRequest == nil) { |
269 |
if (pithosObject.subdir) { |
270 |
BOOL createObject = NO; |
271 |
NSAlert *alert; |
272 |
ASIPithosObjectRequest *request = [ASIPithosObjectRequest objectMetadataRequestWithPithos:pithos |
273 |
containerName:pithosContainer.name |
274 |
objectName:prefix]; |
275 |
ASINetworkQueue *networkQueue = [ASINetworkQueue queue]; |
276 |
[networkQueue go]; |
277 |
[networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:request]] waitUntilFinished:YES]; |
278 |
if ([request error]) { |
279 |
alert = [[[NSAlert alloc] init] autorelease]; |
280 |
[alert setMessageText:@"HTTP Request Error"]; |
281 |
[alert setInformativeText:[NSString stringWithFormat:@"An error occured: %@", [request error]]]; |
282 |
[alert addButtonWithTitle:@"OK"]; |
283 |
[alert runModal]; |
284 |
return; |
285 |
} else if (request.responseStatusCode == 200) { |
286 |
alert = [[[NSAlert alloc] init] autorelease]; |
287 |
[alert setMessageText:@"Apply changes"]; |
288 |
[alert setInformativeText:[NSString stringWithFormat:@"In order to apply the changes in '%@', the object at the same path must be replaced. Continue?", self.displayName]]; |
289 |
[alert addButtonWithTitle:@"OK"]; |
290 |
[alert addButtonWithTitle:@"Cancel"]; |
291 |
NSInteger choice = [alert runModal]; |
292 |
if (choice == NSAlertFirstButtonReturn) { |
293 |
request = [ASIPithosObjectRequest deleteObjectRequestWithPithos:pithos |
294 |
containerName:pithosContainer.name |
295 |
objectName:prefix]; |
296 |
ASINetworkQueue *networkQueue = [ASINetworkQueue queue]; |
297 |
[networkQueue go]; |
298 |
[networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:request]] waitUntilFinished:YES]; |
299 |
if ([request error]) { |
300 |
alert = [[[NSAlert alloc] init] autorelease]; |
301 |
[alert setMessageText:@"HTTP Request Error"]; |
302 |
[alert setInformativeText:[NSString stringWithFormat:@"An error occured: %@", [request error]]]; |
303 |
[alert addButtonWithTitle:@"OK"]; |
304 |
[alert runModal]; |
305 |
return; |
306 |
} else if (request.responseStatusCode != 204) { |
307 |
[PithosUtilities unexpectedResponseStatusAlertWithRequest:request]; |
308 |
return; |
309 |
} |
310 |
refreshParent = YES; |
311 |
createObject = YES; |
312 |
} else { |
313 |
return; |
314 |
} |
315 |
} else if (request.responseStatusCode == 404) { |
316 |
createObject = YES; |
317 |
} else { |
318 |
[PithosUtilities unexpectedResponseStatusAlertWithRequest:request]; |
319 |
return; |
320 |
} |
321 |
if (createObject) { |
322 |
[[pithosNodeInfoController window] makeFirstResponder:nil]; |
323 |
applyMetadataObjectRequest = [[ASIPithosObjectRequest writeObjectDataRequestWithPithos:pithos |
324 |
containerName:pithosContainer.name |
325 |
objectName:prefix |
326 |
eTag:nil |
327 |
contentType:@"application/directory" |
328 |
contentEncoding:pithosObject.contentEncoding |
329 |
contentDisposition:pithosObject.contentDisposition |
330 |
manifest:pithosObject.manifest |
331 |
sharing:pithosObject.sharing |
332 |
isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) |
333 |
metadata:pithosObject.metadata |
334 |
data:[NSData data]] retain]; |
335 |
pithosObject.subdir = NO; |
336 |
applyMetadataObjectRequest.delegate = self; |
337 |
applyMetadataObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
338 |
applyMetadataObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
339 |
applyMetadataObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
340 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
341 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
342 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
343 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
344 |
nil]; |
345 |
[[PithosUtilities prepareRequest:applyMetadataObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
346 |
} |
347 |
} else { |
348 |
[[pithosNodeInfoController window] makeFirstResponder:nil]; |
349 |
if (sharingAccount) { |
350 |
applyMetadataObjectRequest = [[ASIPithosObjectRequest updateObjectMetadataRequestWithPithos:pithos |
351 |
containerName:pithosContainer.name |
352 |
objectName:pithosObject.name |
353 |
contentEncoding:nil |
354 |
contentDisposition:nil |
355 |
manifest:nil |
356 |
sharing:nil |
357 |
isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) |
358 |
metadata:pithosObject.metadata |
359 |
update:NO] retain]; |
360 |
[applyMetadataObjectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos]; |
361 |
} else { |
362 |
applyMetadataObjectRequest = [[ASIPithosObjectRequest updateObjectMetadataRequestWithPithos:pithos |
363 |
containerName:pithosContainer.name |
364 |
objectName:pithosObject.name |
365 |
contentEncoding:pithosObject.contentEncoding |
366 |
contentDisposition:pithosObject.contentDisposition |
367 |
manifest:pithosObject.manifest |
368 |
sharing:(pithosObject.sharing ? pithosObject.sharing : @"") |
369 |
isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) |
370 |
metadata:pithosObject.metadata |
371 |
update:NO] retain]; |
372 |
} |
373 |
applyMetadataObjectRequest.delegate = self; |
374 |
applyMetadataObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
375 |
applyMetadataObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
376 |
applyMetadataObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
377 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
378 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
379 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
380 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
381 |
nil]; |
382 |
[[PithosUtilities prepareRequest:applyMetadataObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
383 |
} |
384 |
} |
385 |
} |
386 |
} |
387 |
|
388 |
- (void)refreshInfo { |
389 |
@synchronized(self) { |
390 |
if (pithosObject.subdir) { |
391 |
self.pithosObject = [ASIPithosObject subdirWithName:pithosObject.name]; |
392 |
return; |
393 |
} else if (refreshMetadataObjectRequest == nil) { |
394 |
refreshMetadataObjectRequest = [[ASIPithosObjectRequest objectMetadataRequestWithPithos:pithos |
395 |
containerName:pithosContainer.name |
396 |
objectName:prefix] retain]; |
397 |
if (sharingAccount) |
398 |
[refreshMetadataObjectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos]; |
399 |
refreshMetadataObjectRequest.delegate = self; |
400 |
refreshMetadataObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
401 |
refreshMetadataObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
402 |
refreshMetadataObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
403 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
404 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
405 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
406 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
407 |
nil]; |
408 |
refreshMetadataObjectRequest.downloadCache = [ASIDownloadCache sharedCache]; |
409 |
[[PithosUtilities prepareRequest:refreshMetadataObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
410 |
} |
411 |
} |
412 |
[self refreshVersions]; |
413 |
} |
414 |
|
415 |
#pragma mark - |
416 |
#pragma mark Versions |
417 |
|
418 |
- (void)refreshVersions { |
419 |
@synchronized(self) { |
420 |
if (pithosObject.subdir) { |
421 |
return; |
422 |
} else if (refreshVersionsObjectRequest == nil) { |
423 |
refreshVersionsObjectRequest = [[ASIPithosObjectRequest objectVersionsRequestWithPithos:pithos |
424 |
containerName:pithosContainer.name |
425 |
objectName:pithosObject.name] retain]; |
426 |
if (sharingAccount) |
427 |
[refreshVersionsObjectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos]; |
428 |
refreshVersionsObjectRequest.delegate = self; |
429 |
refreshVersionsObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
430 |
refreshVersionsObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
431 |
refreshVersionsObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
432 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
433 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
434 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
435 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
436 |
nil]; |
437 |
refreshVersionsObjectRequest.downloadCache = [ASIDownloadCache sharedCache]; |
438 |
[[PithosUtilities prepareRequest:refreshVersionsObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
439 |
} |
440 |
} |
441 |
} |
442 |
|
443 |
#pragma mark - |
444 |
#pragma mark Actions |
445 |
|
446 |
- (void)showPithosNodeInfo:(id)sender { |
447 |
if (!pithosNodeInfoController) { |
448 |
pithosNodeInfoController = [[PithosObjectNodeInfoController alloc] initWithPithosNode:self]; |
449 |
[self refreshInfo]; |
450 |
} |
451 |
[pithosNodeInfoController showWindow:sender]; |
452 |
[[pithosNodeInfoController window] makeKeyAndOrderFront:sender]; |
453 |
[NSApp activateIgnoringOtherApps:YES]; |
454 |
} |
455 |
|
456 |
@end |