f8ac9b2a2c79bebb69e0fe96d936c040787b1aec
[openafs.git] / src / platform / DARWIN / afscell / afscellPane.m
1 //
2 //  afscellPane.m
3 //  afscell
4 //
5 //  Created by David Botsch on 10/23/07.
6 //  Copyright (c) 2007 __MyCompanyName__. All rights reserved.
7 //
8
9 #import "afscellPane.h"
10
11
12 @implementation afscellPane
13
14 - (NSString *)title
15 {
16         return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil];
17 }
18
19
20
21 /* called when user clicks "Continue" -- return value indicates if application should exit pane */
22 - (BOOL)shouldExitPane:(InstallerSectionDirection)dir
23 {
24         if(InstallerDirectionForward == dir) {
25                 
26                 /* Update ThisCell and CellAlias files with input */
27                 NSString * WSCell = [ThisCell stringValue];
28                 NSString * WSAlias = [CellAlias stringValue];
29                 
30                 
31                                         
32                                 BOOL wr1 = [WSCell writeToFile:@"/private/tmp/ThisCell" atomically:YES];
33                                 BOOL wr2;
34                 
35                                 if ([WSAlias length] != 0) {
36                                         NSMutableString * aliasString = [[NSMutableString alloc] init];
37                                         [aliasString appendString:WSCell];
38                                         [aliasString appendFormat:@" "];
39                                         [aliasString appendString:WSAlias];
40                                         wr2 = [aliasString writeToFile:@"/private/tmp/CellAlias" atomically:YES];
41                                 }
42                 
43                                 NSMutableString * results = [[NSMutableString alloc] init];
44                                 [results appendFormat:@"Write 1 is %d and write 2 is %d\n", wr1, wr2];
45                                 [results writeToFile:@"/private/tmp/writefile" atomically:YES];
46                         
47                 return YES;
48         }
49         return YES;
50 }
51
52 @end
53