aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-17 00:38:44 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-17 00:38:44 +0530
commit47c5f23a0aa15c43f77477391b8c12fad0442b09 (patch)
treee942252d34ba9f73988a9f3f4f4bd2dbfee40b0f /WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
parentmacOS: Support window management keyboard shortcuts (diff)
downloadwireguard-apple-47c5f23a0aa15c43f77477391b8c12fad0442b09.tar.xz
wireguard-apple-47c5f23a0aa15c43f77477391b8c12fad0442b09.zip
macOS: Tunnels list: Rename action handling methods
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift20
1 files changed, 10 insertions, 10 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
index 130cf303..95859463 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
@@ -37,15 +37,15 @@ class TunnelsListTableViewController: NSViewController {
let addMenu: NSMenu = {
let addMenu = NSMenu(title: "TunnelsListAdd")
- addMenu.addItem(withTitle: tr("macMenuAddEmptyTunnel"), action: #selector(addEmptyTunnelClicked), keyEquivalent: "")
- addMenu.addItem(withTitle: tr("macMenuImportTunnels"), action: #selector(importTunnelClicked), keyEquivalent: "")
+ addMenu.addItem(withTitle: tr("macMenuAddEmptyTunnel"), action: #selector(handleAddEmptyTunnelAction), keyEquivalent: "")
+ addMenu.addItem(withTitle: tr("macMenuImportTunnels"), action: #selector(handleImportTunnelAction), keyEquivalent: "")
return addMenu
}()
let actionMenu: NSMenu = {
let actionMenu = NSMenu(title: "TunnelsListAction")
- actionMenu.addItem(withTitle: tr("macMenuExportLog"), action: #selector(exportLogClicked), keyEquivalent: "")
- actionMenu.addItem(withTitle: tr("macMenuExportTunnels"), action: #selector(exportTunnelsClicked), keyEquivalent: "")
+ actionMenu.addItem(withTitle: tr("macMenuExportLog"), action: #selector(handleExportLogAction), keyEquivalent: "")
+ actionMenu.addItem(withTitle: tr("macMenuExportTunnels"), action: #selector(handleExportTunnelsAction), keyEquivalent: "")
return actionMenu
}()
@@ -119,23 +119,23 @@ class TunnelsListTableViewController: NSViewController {
let segmentBottomLeft = NSPoint(x: 0, y: buttonBar.bounds.height + 2)
addMenu.popUp(positioning: nil, at: segmentBottomLeft, in: buttonBar)
} else if buttonBar.selectedSegment == 1 {
- removeTunnelClicked()
+ handleRemoveTunnelAction()
} else if buttonBar.selectedSegment == 2 {
let segmentBottomLeft = NSPoint(x: buttonBar.bounds.width * 0.66, y: buttonBar.bounds.height + 2)
actionMenu.popUp(positioning: nil, at: segmentBottomLeft, in: buttonBar)
}
}
- @objc func addEmptyTunnelClicked() {
+ @objc func handleAddEmptyTunnelAction() {
let tunnelEditVC = TunnelEditViewController(tunnelsManager: tunnelsManager, tunnel: nil)
presentAsSheet(tunnelEditVC)
}
- @objc func importTunnelClicked() {
+ @objc func handleImportTunnelAction() {
ImportPanelPresenter.presentImportPanel(tunnelsManager: tunnelsManager, sourceVC: self)
}
- @objc func removeTunnelClicked() {
+ @objc func handleRemoveTunnelAction() {
guard let window = view.window else { return }
let selectedTunnelIndex = tableView.selectedRow
guard selectedTunnelIndex >= 0 && selectedTunnelIndex < tunnelsManager.numberOfTunnels() else { return }
@@ -163,7 +163,7 @@ class TunnelsListTableViewController: NSViewController {
}
}
- @objc func exportLogClicked() {
+ @objc func handleExportLogAction() {
guard let window = view.window else { return }
let savePanel = NSSavePanel()
savePanel.prompt = tr("macSheetButtonExportLog")
@@ -196,7 +196,7 @@ class TunnelsListTableViewController: NSViewController {
}
}
- @objc func exportTunnelsClicked() {
+ @objc func handleExportTunnelsAction() {
guard let window = view.window else { return }
let savePanel = NSSavePanel()
savePanel.allowedFileTypes = ["zip"]