-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIFLibrarySettings.m
61 lines (45 loc) · 1.48 KB
/
IFLibrarySettings.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// IFLibrarySettings.m
// Inform
//
// Created by Andrew Hunter on 10/10/2004.
// Copyright 2004 Andrew Hunter. All rights reserved.
//
#import "IFLibrarySettings.h"
@implementation IFLibrarySettings
- (id) init {
return [self initWithNibName: @"LibrarySettings"];
}
- (NSString*) title {
return [[NSBundle mainBundle] localizedStringForKey: @"Library Settings"
value: @"Library Settings"
table: nil];
}
// = Setting up =
- (void) updateFromCompilerSettings {
IFCompilerSettings* settings = [self compilerSettings];
// Library versions
NSArray* libraryDirectory = [IFCompilerSettings availableLibraries];
NSEnumerator* libEnum = [libraryDirectory objectEnumerator];
NSString* libVer;
NSString* currentLibVer = [settings libraryToUse];
[libraryVersion removeAllItems];
while (libVer = [libEnum nextObject]) {
[libraryVersion addItemWithTitle: libVer];
if ([libVer isEqualToString: currentLibVer]) {
[libraryVersion selectItemAtIndex: [libraryVersion numberOfItems]-1];
}
}
}
- (void) setSettings {
IFCompilerSettings* settings = [self compilerSettings];
[settings setLibraryToUse: [libraryVersion itemTitleAtIndex: [libraryVersion indexOfSelectedItem]]];
}
- (BOOL) enableForCompiler: (NSString*) compiler {
// These settings are unsafe to change while using Natural Inform
if ([compiler isEqualToString: IFCompilerNaturalInform])
return NO;
else
return YES;
}
@end