Move "Copy HTTP Proxy Export" from preference panel to menu.

This commit is contained in:
Charlie Qiu
2017-03-02 22:47:37 +08:00
parent b981b93f5f
commit aabb67f2c5
4 changed files with 68 additions and 61 deletions
@@ -27,13 +27,4 @@ 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);export https_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)
}
}