root / pithos-macos / PithosSubdirNode.m @ 9990166e
History | View | Annotate | Download (24.5 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 |
DLog(@"URL: %@", [request url]); |
174 |
DLog(@"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]; |
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 |
[PithosUtilities httpRequestErrorAlertWithRequest:applyMetadataObjectRequest]; |
236 |
@synchronized(self) { |
237 |
[applyMetadataObjectRequest release]; |
238 |
applyMetadataObjectRequest = nil; |
239 |
} |
240 |
} else if ([request isEqualTo:refreshMetadataObjectRequest]) { |
241 |
[PithosUtilities httpRequestErrorAlertWithRequest:refreshMetadataObjectRequest]; |
242 |
@synchronized(self) { |
243 |
[refreshMetadataObjectRequest release]; |
244 |
refreshMetadataObjectRequest = nil; |
245 |
} |
246 |
} else if ([request isEqualTo:refreshVersionsObjectRequest]) { |
247 |
[PithosUtilities httpRequestErrorAlertWithRequest:refreshVersionsObjectRequest]; |
248 |
@synchronized(self) { |
249 |
[refreshVersionsObjectRequest release]; |
250 |
refreshVersionsObjectRequest = nil; |
251 |
} |
252 |
} |
253 |
} |
254 |
[pool drain]; |
255 |
} |
256 |
|
257 |
#pragma mark - |
258 |
#pragma mark Info |
259 |
|
260 |
- (void)applyInfo { |
261 |
@synchronized(self) { |
262 |
if (applyMetadataObjectRequest == nil) { |
263 |
if (pithosObject.subdir) { |
264 |
BOOL createObject = NO; |
265 |
NSAlert *alert; |
266 |
ASIPithosObjectRequest *request = [ASIPithosObjectRequest objectMetadataRequestWithPithos:pithos |
267 |
containerName:pithosContainer.name |
268 |
objectName:prefix]; |
269 |
ASINetworkQueue *networkQueue = [ASINetworkQueue queue]; |
270 |
[networkQueue go]; |
271 |
[networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:request]] waitUntilFinished:YES]; |
272 |
if ([request error]) { |
273 |
alert = [[[NSAlert alloc] init] autorelease]; |
274 |
[alert setMessageText:@"HTTP Request Error"]; |
275 |
[alert setInformativeText:[NSString stringWithFormat:@"An error occured: %@", [[request error] localizedDescription]]]; |
276 |
[alert addButtonWithTitle:@"OK"]; |
277 |
[alert runModal]; |
278 |
return; |
279 |
} else if (request.responseStatusCode == 200) { |
280 |
alert = [[[NSAlert alloc] init] autorelease]; |
281 |
[alert setMessageText:@"Apply changes"]; |
282 |
[alert setInformativeText:[NSString stringWithFormat:@"In order to apply the changes in '%@', the object at the same path must be replaced. Continue?", self.displayName]]; |
283 |
[alert addButtonWithTitle:@"OK"]; |
284 |
[alert addButtonWithTitle:@"Cancel"]; |
285 |
NSInteger choice = [alert runModal]; |
286 |
if (choice == NSAlertFirstButtonReturn) { |
287 |
request = [ASIPithosObjectRequest deleteObjectRequestWithPithos:pithos |
288 |
containerName:pithosContainer.name |
289 |
objectName:prefix]; |
290 |
ASINetworkQueue *networkQueue = [ASINetworkQueue queue]; |
291 |
[networkQueue go]; |
292 |
[networkQueue addOperations:[NSArray arrayWithObject:[PithosUtilities prepareRequest:request]] waitUntilFinished:YES]; |
293 |
if ([request error]) { |
294 |
alert = [[[NSAlert alloc] init] autorelease]; |
295 |
[alert setMessageText:@"HTTP Request Error"]; |
296 |
[alert setInformativeText:[NSString stringWithFormat:@"An error occured: %@", [[request error] localizedDescription]]]; |
297 |
[alert addButtonWithTitle:@"OK"]; |
298 |
[alert runModal]; |
299 |
return; |
300 |
} else if (request.responseStatusCode != 204) { |
301 |
[PithosUtilities unexpectedResponseStatusAlertWithRequest:request]; |
302 |
return; |
303 |
} |
304 |
refreshParent = YES; |
305 |
createObject = YES; |
306 |
} else { |
307 |
return; |
308 |
} |
309 |
} else if (request.responseStatusCode == 404) { |
310 |
createObject = YES; |
311 |
} else { |
312 |
[PithosUtilities unexpectedResponseStatusAlertWithRequest:request]; |
313 |
return; |
314 |
} |
315 |
if (createObject) { |
316 |
[[pithosNodeInfoController window] makeFirstResponder:nil]; |
317 |
applyMetadataObjectRequest = [[ASIPithosObjectRequest writeObjectDataRequestWithPithos:pithos |
318 |
containerName:pithosContainer.name |
319 |
objectName:prefix |
320 |
eTag:nil |
321 |
contentType:@"application/directory" |
322 |
contentEncoding:pithosObject.contentEncoding |
323 |
contentDisposition:pithosObject.contentDisposition |
324 |
manifest:pithosObject.manifest |
325 |
sharing:pithosObject.sharing |
326 |
isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) |
327 |
metadata:pithosObject.metadata |
328 |
data:[NSData data]] retain]; |
329 |
pithosObject.subdir = NO; |
330 |
applyMetadataObjectRequest.delegate = self; |
331 |
applyMetadataObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
332 |
applyMetadataObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
333 |
applyMetadataObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
334 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
335 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
336 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
337 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
338 |
nil]; |
339 |
[[PithosUtilities prepareRequest:applyMetadataObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
340 |
} |
341 |
} else { |
342 |
[[pithosNodeInfoController window] makeFirstResponder:nil]; |
343 |
if (sharingAccount) { |
344 |
applyMetadataObjectRequest = [[ASIPithosObjectRequest updateObjectMetadataRequestWithPithos:pithos |
345 |
containerName:pithosContainer.name |
346 |
objectName:pithosObject.name |
347 |
contentEncoding:nil |
348 |
contentDisposition:nil |
349 |
manifest:nil |
350 |
sharing:nil |
351 |
isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) |
352 |
metadata:pithosObject.metadata |
353 |
update:NO] retain]; |
354 |
[applyMetadataObjectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos]; |
355 |
} else { |
356 |
applyMetadataObjectRequest = [[ASIPithosObjectRequest updateObjectMetadataRequestWithPithos:pithos |
357 |
containerName:pithosContainer.name |
358 |
objectName:pithosObject.name |
359 |
contentEncoding:pithosObject.contentEncoding |
360 |
contentDisposition:pithosObject.contentDisposition |
361 |
manifest:pithosObject.manifest |
362 |
sharing:(pithosObject.sharing ? pithosObject.sharing : @"") |
363 |
isPublic:(isPublic ? ASIPithosObjectRequestPublicTrue : ASIPithosObjectRequestPublicFalse) |
364 |
metadata:pithosObject.metadata |
365 |
update:NO] retain]; |
366 |
} |
367 |
applyMetadataObjectRequest.delegate = self; |
368 |
applyMetadataObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
369 |
applyMetadataObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
370 |
applyMetadataObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
371 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
372 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
373 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
374 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
375 |
nil]; |
376 |
[[PithosUtilities prepareRequest:applyMetadataObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
377 |
} |
378 |
} |
379 |
} |
380 |
} |
381 |
|
382 |
- (void)refreshInfo { |
383 |
@synchronized(self) { |
384 |
if (pithosObject.subdir) { |
385 |
self.pithosObject = [ASIPithosObject subdirWithName:pithosObject.name]; |
386 |
return; |
387 |
} else if (refreshMetadataObjectRequest == nil) { |
388 |
refreshMetadataObjectRequest = [[ASIPithosObjectRequest objectMetadataRequestWithPithos:pithos |
389 |
containerName:pithosContainer.name |
390 |
objectName:prefix] retain]; |
391 |
if (sharingAccount) |
392 |
[refreshMetadataObjectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos]; |
393 |
refreshMetadataObjectRequest.delegate = self; |
394 |
refreshMetadataObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
395 |
refreshMetadataObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
396 |
refreshMetadataObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
397 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
398 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
399 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
400 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
401 |
nil]; |
402 |
if (!sharingAccount) |
403 |
refreshMetadataObjectRequest.downloadCache = [ASIDownloadCache sharedCache]; |
404 |
[[PithosUtilities prepareRequest:refreshMetadataObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
405 |
} |
406 |
} |
407 |
[self refreshVersions]; |
408 |
} |
409 |
|
410 |
#pragma mark - |
411 |
#pragma mark Versions |
412 |
|
413 |
- (void)refreshVersions { |
414 |
@synchronized(self) { |
415 |
if (pithosObject.subdir) { |
416 |
return; |
417 |
} else if (refreshVersionsObjectRequest == nil) { |
418 |
refreshVersionsObjectRequest = [[ASIPithosObjectRequest objectVersionsRequestWithPithos:pithos |
419 |
containerName:pithosContainer.name |
420 |
objectName:pithosObject.name] retain]; |
421 |
if (sharingAccount) |
422 |
[refreshVersionsObjectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos]; |
423 |
refreshVersionsObjectRequest.delegate = self; |
424 |
refreshVersionsObjectRequest.didFinishSelector = @selector(performRequestFinishedDelegateInBackground:); |
425 |
refreshVersionsObjectRequest.didFailSelector = @selector(performRequestFailedDelegateInBackground:); |
426 |
refreshVersionsObjectRequest.userInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys: |
427 |
[NSNumber numberWithInteger:NSOperationQueuePriorityHigh], @"priority", |
428 |
[NSNumber numberWithUnsignedInteger:10], @"retries", |
429 |
NSStringFromSelector(@selector(objectRequestFinished:)), @"didFinishSelector", |
430 |
NSStringFromSelector(@selector(objectRequestFailed:)), @"didFailSelector", |
431 |
nil]; |
432 |
if (!sharingAccount) |
433 |
refreshVersionsObjectRequest.downloadCache = [ASIDownloadCache sharedCache]; |
434 |
[[PithosUtilities prepareRequest:refreshVersionsObjectRequest priority:NSOperationQueuePriorityHigh] startAsynchronous]; |
435 |
} |
436 |
} |
437 |
} |
438 |
|
439 |
#pragma mark - |
440 |
#pragma mark Actions |
441 |
|
442 |
- (void)showPithosNodeInfo:(id)sender { |
443 |
if (!pithosNodeInfoController) { |
444 |
pithosNodeInfoController = [[PithosObjectNodeInfoController alloc] initWithPithosNode:self]; |
445 |
[self refreshInfo]; |
446 |
} |
447 |
[pithosNodeInfoController showWindow:sender]; |
448 |
[[pithosNodeInfoController window] makeKeyAndOrderFront:sender]; |
449 |
[NSApp activateIgnoringOtherApps:YES]; |
450 |
} |
451 |
|
452 |
@end |