-
Notifications
You must be signed in to change notification settings - Fork 6
/
Context.m
84 lines (63 loc) · 2.62 KB
/
Context.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
////////////////////////////////////////////////////////////////////////////////////
// //
// OCSINVENTORY-NG //
// //
// Copyleft Guillaume PROTET 2012 //
// Web : http://www.ocsinventory-ng.org //
// //
// //
// This code is open source and may be copied and modified as long as the source //
// code is always made freely available. //
// Please refer to the General Public Licence http://www.gnu.org/ //
// //
////////////////////////////////////////////////////////////////////////////////////
#import "Context.h"
#import "ConfigurationWindowController.h"
#import "ExportWindowController.h"
#import "Configuration.h"
@implementation Context
- (ConfigurationWindowController *) configurationWindowController {
return [[configurationWindowController retain] autorelease];
}
- (ExportWindowController *) exportWindowController {
return [[exportWindowController retain] autorelease];
}
- (Configuration *) configuration {
return [[configuration retain] autorelease];
}
- (void) setConfigurationWindowController:(ConfigurationWindowController *)object {
if (configurationWindowController != object) {
[configurationWindowController release];
[object retain];
configurationWindowController = object;
}
}
- (void) setExportWindowController:(ExportWindowController *)object {
if (exportWindowController != object) {
[exportWindowController release];
[object retain];
exportWindowController = object;
}
}
- (void) setConfiguration:(Configuration *)object {
if (configuration != object) {
[configuration release];
[object retain];
configuration = object;
}
}
- (void) displayAlert:(NSString *)alertMessage comment:(NSString *)alertComment style:(NSAlertStyle)alertStyle {
//Display a simple alert with an OK button
NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"OK"];
[alert setMessageText:alertMessage];
[alert setInformativeText:alertComment];
[alert setAlertStyle:alertStyle];
[alert runModal];
[alert release];
}
//Famous dealloc for memory management
- (void) dealloc {
[super dealloc];
}
@end