mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-11-01 23:40:06 +00:00
Add Subscribe Class
Subscribe Class Now Can download the Server Profiles To local. TODO add manual update subscribe and period update subscribe and finish subscribe manager functions
This commit is contained in:
@@ -12,16 +12,30 @@ class SubscribePreferenceWindowController: NSWindowController {
|
||||
|
||||
@IBOutlet weak var FeedLabel: NSTextField!
|
||||
@IBOutlet weak var OKButton: NSButton!
|
||||
|
||||
@IBOutlet weak var FeedTextField: NSTextField!
|
||||
@IBOutlet weak var TokenTextField: NSTextField!
|
||||
@IBOutlet weak var GroupTextField: NSTextField!
|
||||
@IBOutlet weak var MaxCountTextField: NSTextField!
|
||||
|
||||
override func windowDidLoad() {
|
||||
super.windowDidLoad()
|
||||
|
||||
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
|
||||
// TODO load stored subscribes and prepare the manager
|
||||
}
|
||||
|
||||
@IBAction func onOk(_ sender: NSButton) {
|
||||
print(FeedTextField.stringValue)
|
||||
// TODO append to manager and save
|
||||
var subscribe = Subscribe.init(initUrlString: FeedTextField.stringValue, initGroupName: GroupTextField.stringValue, initToken: TokenTextField.stringValue, initMaxCount: MaxCountTextField.integerValue)
|
||||
window?.performClose(self)
|
||||
}
|
||||
|
||||
func bindSubscribe(index: Int){
|
||||
if index >= 0 && index <= SubscribeManager.instance.subscribes.count {
|
||||
var editSubscribe = SubscribeManager.instance.subscribes[index]
|
||||
FeedTextField.bind("value", to: editSubscribe, withKeyPath: "subscribeFeed", options: [NSContinuouslyUpdatesValueBindingOption: true])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user