-
Notifications
You must be signed in to change notification settings - Fork 0
/
EzVPNModule.m
41 lines (35 loc) · 787 Bytes
/
EzVPNModule.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
#import "EzVPNModule.h"
@interface NEVPNManager ()
+(BOOL)isEnabled;
+(void)setEnabled:(BOOL)arg1;
@end
@interface UIImage ()
+ (UIImage *)imageNamed:(NSString *)name inBundle:(NSBundle *)bundle;
@end
@implementation EzVPNModule
- (UIImage *)iconGlyph {
return [UIImage imageNamed:@"Icon" inBundle:[NSBundle bundleForClass:[self class]]];
}
- (UIColor *)selectedColor {
return [UIColor yellowColor];
}
- (BOOL)isSelected {
if ([NEVPNManager isEnabled]) {
self.ezvpn = TRUE;
} else {
self.ezvpn = FALSE;
}
return self.ezvpn;
}
- (void)setSelected:(BOOL)selected {
if ([NEVPNManager isEnabled]) {
[NEVPNManager setEnabled:FALSE];
selected = FALSE;
} else {
[NEVPNManager setEnabled:TRUE];
selected = TRUE;
}
self.ezvpn = selected;
[super refreshState];
}
@end