Chameleon Applications

Chameleon Applications Svn Source Tree

Root/trunk/ChameleonPrefPane/EfiInjectController.mm

1//
2// EfiInject.mm
3// ChameleonPrefPane
4//
5// Created by Rekursor on 1/26/10.
6//
7
8#import "EfiInjectController.h"
9
10
11static EfiInjectController *gInstance = NULL;
12
13@implementation EfiInjectController
14//--------------------------------------------------------------------------
15- (id) init
16{
17self = [super init];
18return (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{
47if(sender == mCurrentGfxInjection)
48{
49NSTask *gfxutil = [[NSTask alloc] init];
50NSString * 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
56int status = [gfxutil terminationStatus];
57
58if (status == 0) { //script terminé avec succès
59//[progressIndicator stopAnimation: self];
60NSLog(@"dev-props checked.");
61}
62else {
63//[progressIndicator stopAnimation: self]; //problème avec le script
64NSLog(@"no dev-props.");
65}
66
67}
68else
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

Archive Download this file

Revision: 65