mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-21 06:54:41 +00:00
init white list
This commit is contained in:
@@ -29,6 +29,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
@IBOutlet weak var autoModeMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var globalModeMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var manualModeMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var whiteListModeMenuItem: NSMenuItem!
|
||||
|
||||
@IBOutlet weak var serversMenuItem: NSMenuItem!
|
||||
@IBOutlet var showQRCodeMenuItem: NSMenuItem!
|
||||
@@ -159,6 +160,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
ProxyConfHelper.enableGlobalProxy()
|
||||
} else if mode == "manual" {
|
||||
ProxyConfHelper.disableProxy()
|
||||
} else if mode == "whiteList"{
|
||||
//ProxyConfHelper.enableWhiteListProxy()
|
||||
}
|
||||
} else {
|
||||
StopSSLocal()
|
||||
@@ -181,6 +184,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
UpdatePACFromGFWList()
|
||||
}
|
||||
|
||||
@IBAction func updateWhiteList(sender: NSMenuItem) {
|
||||
}
|
||||
|
||||
@IBAction func editUserRulesForPAC(sender: NSMenuItem) {
|
||||
if editUserRulesWinCtrl != nil {
|
||||
editUserRulesWinCtrl.close()
|
||||
@@ -252,6 +258,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
applyConfig()
|
||||
}
|
||||
|
||||
@IBAction func selectWhiteListMode(sender: NSMenuItem) {
|
||||
let defaults = NSUserDefaults.standardUserDefaults()
|
||||
defaults.setValue("whiteList", forKey: "ShadowsocksRunningMode")
|
||||
updateRunningModeMenu()
|
||||
applyConfig()
|
||||
}
|
||||
|
||||
@IBAction func editServerPreferences(sender: NSMenuItem) {
|
||||
if preferencesWinCtrl != nil {
|
||||
preferencesWinCtrl.close()
|
||||
|
||||
@@ -45,3 +45,5 @@
|
||||
"Proxy - Global" = "Proxy - Global";
|
||||
|
||||
"Proxy - Manual" = "Proxy - Manual";
|
||||
|
||||
"Proxy - WhiteList" = "Proxy - WhiteList";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
|
||||
</dependencies>
|
||||
@@ -26,6 +26,7 @@
|
||||
<outlet property="showQRCodeMenuItem" destination="R6A-96-Zcb" id="XHz-pz-nCz"/>
|
||||
<outlet property="statusMenu" destination="Hob-KD-bx9" id="clA-ZW-0pT"/>
|
||||
<outlet property="toggleRunningMenuItem" destination="GSu-Tf-StS" id="XHw-pU-nCa"/>
|
||||
<outlet property="whiteListModeMenuItem" destination="wBP-24-Xo8" id="jpq-gv-HHX"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
@@ -63,6 +64,12 @@
|
||||
<action selector="selectManualMode:" target="Voe-Tx-rLC" id="Xxb-28-6fi"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Wihte List Mode" id="wBP-24-Xo8">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="selectWhiteListMode:" target="Voe-Tx-rLC" id="KnS-FW-UMx"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="V92-VH-Agn"/>
|
||||
<menuItem title="Update PAC from GFW List" id="TFc-Ec-duM">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
@@ -70,6 +77,12 @@
|
||||
<action selector="updateGFWList:" target="Voe-Tx-rLC" id="Ztt-PS-F3T"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Update Wihte List" id="gde-ZE-086">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="updateWhiteList:" target="Voe-Tx-rLC" id="2Iv-M4-k9C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Edit User Rules For PAC..." id="rms-p0-CvB">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
|
||||
@@ -18,4 +18,6 @@
|
||||
|
||||
+ (void)disableProxy;
|
||||
|
||||
+ (void)enableWhiteListProxy;
|
||||
|
||||
@end
|
||||
|
||||
@@ -149,4 +149,8 @@
|
||||
[self callHelper:args];
|
||||
}
|
||||
|
||||
+ (void)enableWhiteListProxy {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -50,3 +50,5 @@
|
||||
|
||||
"Proxy - Manual" = "代理 - 手动";
|
||||
|
||||
"Proxy - WhiteList" = "代理 - 白名单";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user