1 | //␊ |
2 | // EfiInject.mm␊ |
3 | // ChameleonPrefPane␊ |
4 | //␊ |
5 | // Created by Rekursor on 1/26/10.␊ |
6 | //␊ |
7 | ␊ |
8 | #import "EfiInjectController.h"␊ |
9 | ␊ |
10 | ␊ |
11 | static EfiInjectController *gInstance = NULL;␊ |
12 | ␊ |
13 | @implementation EfiInjectController␊ |
14 | //--------------------------------------------------------------------------␊ |
15 | - (id) init␊ |
16 | {␊ |
17 | ␉self = [super init];␊ |
18 | ␉return (gInstance = self);␊ |
19 | }␉␊ |
20 | ␊ |
21 | //--------------------------------------------------------------------------␊ |
22 | - (void) addOptionsDesc␊ |
23 | {␊ |
24 | BootProp::instance().addOptionDesc(mEfiInject, mEfiInjectText, OptionString, "device-properties", "");␊ |
25 | }␊ |
26 | ␊ |
27 | //--------------------------------------------------------------------------␊ |
28 | -(void) setDefaultsValues: (NSMutableDictionary*) dict␊ |
29 | {␊ |
30 | }␊ |
31 | ␊ |
32 | //--------------------------------------------------------------------------␊ |
33 | - (void) refreshLockStates␊ |
34 | {␊ |
35 | ␉// automatic, nothing to do␊ |
36 | }␊ |
37 | ␊ |
38 | //--------------------------------------------------------------------------␊ |
39 | -(void) loadOptionsFromPreferencesFile: (NSMutableDictionary*) dict␊ |
40 | {␊ |
41 | ␉␊ |
42 | }␊ |
43 | ␊ |
44 | //--------------------------------------------------------------------------␊ |
45 | -(IBAction) onCheckButtonChange: (NSButton*) sender␊ |
46 | {␊ |
47 | ␉if(sender == mCurrentGfxInjection)␊ |
48 | ␉{␊ |
49 | ␉␉NSTask *gfxutil = [[NSTask alloc] init];␊ |
50 | ␉␉NSString * pathTask = [self getResourcePath:@"getDevProp" ofType:@"sh"];␊ |
51 | ␉␉[gfxutil setLaunchPath:pathTask];␊ |
52 | ␉␉[gfxutil launch];␊ |
53 | ␉␉␊ |
54 | ␉␉//[progressIndicator startAnimation: self]; //lancement de l'anim␊ |
55 | ␉␉[gfxutil waitUntilExit]; //surveille le script et bloque le bouton␊ |
56 | ␉␉int status = [gfxutil terminationStatus];␊ |
57 | ␉␉␊ |
58 | ␉␉if (status == 0) { //script terminé avec succès␊ |
59 | ␉␉␉//[progressIndicator stopAnimation: self];␊ |
60 | ␉␉␉NSLog(@"dev-props checked.");␊ |
61 | ␉␉}␊ |
62 | ␉␉else {␊ |
63 | ␉␉␉//[progressIndicator stopAnimation: self]; //problème avec le script␉␊ |
64 | ␉␉␉NSLog(@"no dev-props.");␊ |
65 | ␉␉}␉␊ |
66 | ␉␉␊ |
67 | ␉}␊ |
68 | ␉else␊ |
69 | ␉␉[self handleSender: sender];␊ |
70 | }␊ |
71 | ␊ |
72 | //--------------------------------------------------------------------------␊ |
73 | -(IBAction) onTextFiedChange: (NSTextField*) sender␊ |
74 | {␊ |
75 | ␉[self handleSender: sender];␊ |
76 | }␊ |
77 | ␊ |
78 | + (EfiInjectController *)instance { return(gInstance);}␊ |
79 | ␊ |
80 | @end␊ |
81 | |