Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 8db5df4

Browse files
committed
streamSetting for every server; codes improvement
1 parent ed1a759 commit 8db5df4

File tree

9 files changed

+380
-245
lines changed

9 files changed

+380
-245
lines changed

V2RayX/AppDelegate.h

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,51 @@
66
//
77

88
#import <Cocoa/Cocoa.h>
9-
#import "ConfigWindowController.h"
109

11-
@interface AppDelegate : NSObject <NSApplicationDelegate, ConfigWindowControllerDelegate>
10+
#define kV2RayXHelper @"/Library/Application Support/V2RayX/v2rayx_sysconf"
11+
#define kSysconfVersion @"v2rayx_sysconf 1.0.0"
12+
#define kV2RayXSettingVersion 3
13+
#define nilCoalescing(a,b) ( (a != nil) ? (a) : (b) ) // equivalent to ?? operator in Swift
14+
15+
typedef enum ProxyMode : NSInteger{
16+
rules,
17+
pac,
18+
global,
19+
manual
20+
} ProxyMode;
21+
22+
23+
@interface AppDelegate : NSObject <NSApplicationDelegate> {
24+
BOOL proxyState;
25+
ProxyMode proxyMode;
26+
NSInteger localPort;
27+
NSInteger httpPort;
28+
BOOL udpSupport;
29+
BOOL shareOverLan;
30+
NSInteger selectedServerIndex;
31+
NSString* dnsString;
32+
NSMutableArray *profiles;
33+
NSString* logLevel;
34+
35+
36+
NSString* plistPath;
37+
NSString* pacPath;
38+
NSString* logDirPath;
39+
}
40+
41+
@property NSString* logDirPath;
42+
43+
@property BOOL proxyState;
44+
@property ProxyMode proxyMode;
45+
@property NSInteger localPort;
46+
@property NSInteger httpPort;
47+
@property BOOL udpSupport;
48+
@property BOOL shareOverLan;
49+
@property NSInteger selectedServerIndex;
50+
@property NSString* dnsString;
51+
@property NSMutableArray *profiles;
52+
@property NSString* logLevel;
53+
1254

1355
- (IBAction)showHelp:(id)sender;
1456
- (IBAction)enableProxy:(id)sender;
@@ -18,9 +60,11 @@
1860
- (IBAction)chooseManualMode:(id)sender;
1961
- (IBAction)showConfigWindow:(id)sender;
2062
- (IBAction)editPac:(id)sender;
63+
- (IBAction)viewLog:(id)sender;
64+
65+
- (void)configurationDidChange;
2166
- (NSString*)logDirPath;
22-
//- (NSArray*)readDefaultsAsArray;
23-
- (NSDictionary*)readDefaultsAsDictionary;
67+
2468
@property (strong, nonatomic) NSStatusItem *statusBarItem;
2569
@property (strong, nonatomic) IBOutlet NSMenu *statusBarMenu;
2670
@property (weak, nonatomic) IBOutlet NSMenuItem *v2rayStatusItem;

0 commit comments

Comments
 (0)