mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-11-05 23:05:05 +00:00
CustomSetting
This commit is contained in:
@@ -10,6 +10,9 @@ import Cocoa
|
||||
|
||||
class HTTPPreferencesWindowController: NSWindowController, NSWindowDelegate {
|
||||
|
||||
@IBOutlet weak var address: NSTextField!
|
||||
@IBOutlet weak var port: NSTextField!
|
||||
|
||||
override func windowDidLoad() {
|
||||
super.windowDidLoad()
|
||||
|
||||
@@ -24,4 +27,13 @@ class HTTPPreferencesWindowController: NSWindowController, NSWindowDelegate {
|
||||
.post(name: Notification.Name(rawValue: NOTIFY_HTTP_CONF_CHANGED), object: nil)
|
||||
}
|
||||
|
||||
@IBAction func copyExportCommand(_ sender: Any) {
|
||||
let command = "export http_proxy=http://\(address.stringValue):\(port.stringValue)"
|
||||
NSPasteboard.general().clearContents()
|
||||
NSPasteboard.general().setString(command, forType: NSStringPboardType)
|
||||
let notification = NSUserNotification()
|
||||
notification.title = "Export Command Copied.".localized
|
||||
NSUserNotificationCenter.default
|
||||
.deliver(notification)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user