From f7b2f73015b51d939d38ed5284f40cd46c73237f Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 7 Jan 2019 13:04:50 +0530 Subject: [PATCH] macOS: Rename *Cell to *Row Signed-off-by: Roopesh Chander --- WireGuard/WireGuard.xcodeproj/project.pbxproj | 16 ++++++++-------- .../{KeyValueCell.swift => KeyValueRow.swift} | 2 +- ...{TunnelListCell.swift => TunnelListRow.swift} | 6 +++--- .../TunnelDetailTableViewController.swift | 4 ++-- .../TunnelsListTableViewController.swift | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) rename WireGuard/WireGuard/UI/macOS/View/{KeyValueCell.swift => KeyValueRow.swift} (98%) rename WireGuard/WireGuard/UI/macOS/View/{TunnelListCell.swift => TunnelListRow.swift} (92%) diff --git a/WireGuard/WireGuard.xcodeproj/project.pbxproj b/WireGuard/WireGuard.xcodeproj/project.pbxproj index e9a9a21..b132fdd 100644 --- a/WireGuard/WireGuard.xcodeproj/project.pbxproj +++ b/WireGuard/WireGuard.xcodeproj/project.pbxproj @@ -26,14 +26,14 @@ 5FF7B96321CC95DE00A7DD74 /* InterfaceConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FF7B96121CC95DE00A7DD74 /* InterfaceConfiguration.swift */; }; 5FF7B96521CC95FA00A7DD74 /* PeerConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FF7B96421CC95FA00A7DD74 /* PeerConfiguration.swift */; }; 5FF7B96621CC95FA00A7DD74 /* PeerConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FF7B96421CC95FA00A7DD74 /* PeerConfiguration.swift */; }; - 6F4DD16B21DA558800690EAE /* TunnelListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4DD16A21DA558800690EAE /* TunnelListCell.swift */; }; + 6F4DD16B21DA558800690EAE /* TunnelListRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4DD16A21DA558800690EAE /* TunnelListRow.swift */; }; 6F4DD16C21DA558F00690EAE /* NSTableView+Reuse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4DD16721DA552B00690EAE /* NSTableView+Reuse.swift */; }; 6F4DD16E21DBEA0700690EAE /* ManageTunnelsRootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4DD16D21DBEA0700690EAE /* ManageTunnelsRootViewController.swift */; }; 6F5A2B4621AFDED40081EDD8 /* FileManager+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F5A2B4421AFDE020081EDD8 /* FileManager+Extension.swift */; }; 6F5A2B4821AFF49A0081EDD8 /* FileManager+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F5A2B4421AFDE020081EDD8 /* FileManager+Extension.swift */; }; 6F5D0C1D218352EF000F85AD /* PacketTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F5D0C1C218352EF000F85AD /* PacketTunnelProvider.swift */; }; 6F5D0C22218352EF000F85AD /* WireGuardNetworkExtensioniOS.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 6F5D0C1A218352EF000F85AD /* WireGuardNetworkExtensioniOS.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 6F613D9B21DE33B8004B217A /* KeyValueCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F613D9A21DE33B8004B217A /* KeyValueCell.swift */; }; + 6F613D9B21DE33B8004B217A /* KeyValueRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F613D9A21DE33B8004B217A /* KeyValueRow.swift */; }; 6F61F1E921B932F700483816 /* WireGuardAppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F61F1E821B932F700483816 /* WireGuardAppError.swift */; }; 6F61F1EB21B937EF00483816 /* WireGuardResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F61F1EA21B937EF00483816 /* WireGuardResult.swift */; }; 6F628C3D217F09E9003482A3 /* TunnelViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F628C3C217F09E9003482A3 /* TunnelViewModel.swift */; }; @@ -222,7 +222,7 @@ 5FF7B96121CC95DE00A7DD74 /* InterfaceConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceConfiguration.swift; sourceTree = ""; }; 5FF7B96421CC95FA00A7DD74 /* PeerConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PeerConfiguration.swift; sourceTree = ""; }; 6F4DD16721DA552B00690EAE /* NSTableView+Reuse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSTableView+Reuse.swift"; sourceTree = ""; }; - 6F4DD16A21DA558800690EAE /* TunnelListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelListCell.swift; sourceTree = ""; }; + 6F4DD16A21DA558800690EAE /* TunnelListRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelListRow.swift; sourceTree = ""; }; 6F4DD16D21DBEA0700690EAE /* ManageTunnelsRootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageTunnelsRootViewController.swift; sourceTree = ""; }; 6F5A2B4421AFDE020081EDD8 /* FileManager+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileManager+Extension.swift"; sourceTree = ""; }; 6F5D0C1421832391000F85AD /* DNSResolver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DNSResolver.swift; sourceTree = ""; }; @@ -232,7 +232,7 @@ 6F5D0C1F218352EF000F85AD /* WireGuardNetworkExtension_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WireGuardNetworkExtension_iOS.entitlements; sourceTree = ""; }; 6F5D0C3421839E37000F85AD /* WireGuardNetworkExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WireGuardNetworkExtension-Bridging-Header.h"; sourceTree = ""; }; 6F5D0C472183C6A3000F85AD /* PacketTunnelSettingsGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PacketTunnelSettingsGenerator.swift; sourceTree = ""; }; - 6F613D9A21DE33B8004B217A /* KeyValueCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyValueCell.swift; sourceTree = ""; }; + 6F613D9A21DE33B8004B217A /* KeyValueRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyValueRow.swift; sourceTree = ""; }; 6F61F1E821B932F700483816 /* WireGuardAppError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WireGuardAppError.swift; sourceTree = ""; }; 6F61F1EA21B937EF00483816 /* WireGuardResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WireGuardResult.swift; sourceTree = ""; }; 6F628C3C217F09E9003482A3 /* TunnelViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelViewModel.swift; sourceTree = ""; }; @@ -370,8 +370,8 @@ 6F4DD16921DA556600690EAE /* View */ = { isa = PBXGroup; children = ( - 6F4DD16A21DA558800690EAE /* TunnelListCell.swift */, - 6F613D9A21DE33B8004B217A /* KeyValueCell.swift */, + 6F4DD16A21DA558800690EAE /* TunnelListRow.swift */, + 6F613D9A21DE33B8004B217A /* KeyValueRow.swift */, ); path = View; sourceTree = ""; @@ -1084,12 +1084,12 @@ 6FB1BDBC21D50F0200A991BF /* ringlogger.c in Sources */, 6FB1BDBD21D50F0200A991BF /* ringlogger.h in Sources */, 6FBA103F21D6B6FF0051C35F /* TunnelImporter.swift in Sources */, - 6F4DD16B21DA558800690EAE /* TunnelListCell.swift in Sources */, + 6F4DD16B21DA558800690EAE /* TunnelListRow.swift in Sources */, 6FB1BDBE21D50F0200A991BF /* Logger.swift in Sources */, 6FB1BDBF21D50F0200A991BF /* TunnelConfiguration+WgQuickConfig.swift in Sources */, 6FB1BDC021D50F0200A991BF /* NETunnelProviderProtocol+Extension.swift in Sources */, 6FBA101821D656000051C35F /* StatusMenu.swift in Sources */, - 6F613D9B21DE33B8004B217A /* KeyValueCell.swift in Sources */, + 6F613D9B21DE33B8004B217A /* KeyValueRow.swift in Sources */, 6FB1BDC121D50F0200A991BF /* String+ArrayConversion.swift in Sources */, 6FB1BDC221D50F0300A991BF /* LegacyConfigMigration.swift in Sources */, 6FBA104021D6B7040051C35F /* ErrorPresenterProtocol.swift in Sources */, diff --git a/WireGuard/WireGuard/UI/macOS/View/KeyValueCell.swift b/WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift similarity index 98% rename from WireGuard/WireGuard/UI/macOS/View/KeyValueCell.swift rename to WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift index 47f9263..4e9fa7d 100644 --- a/WireGuard/WireGuard/UI/macOS/View/KeyValueCell.swift +++ b/WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift @@ -3,7 +3,7 @@ import Cocoa -class KeyValueCell: NSView { +class KeyValueRow: NSView { let keyLabel: NSTextField = { let keyLabel = NSTextField() keyLabel.isEditable = false diff --git a/WireGuard/WireGuard/UI/macOS/View/TunnelListCell.swift b/WireGuard/WireGuard/UI/macOS/View/TunnelListRow.swift similarity index 92% rename from WireGuard/WireGuard/UI/macOS/View/TunnelListCell.swift rename to WireGuard/WireGuard/UI/macOS/View/TunnelListRow.swift index 11bf73c..1a2f6a8 100644 --- a/WireGuard/WireGuard/UI/macOS/View/TunnelListCell.swift +++ b/WireGuard/WireGuard/UI/macOS/View/TunnelListRow.swift @@ -3,7 +3,7 @@ import Cocoa -class TunnelListCell: NSView { +class TunnelListRow: NSView { var tunnel: TunnelContainer? { didSet(value) { // Bind to the tunnel's name @@ -12,9 +12,9 @@ class TunnelListCell: NSView { self?.nameLabel.stringValue = tunnel.name } // Bind to the tunnel's status - statusImageView.image = TunnelListCell.image(for: tunnel?.status) + statusImageView.image = TunnelListRow.image(for: tunnel?.status) statusObservationToken = tunnel?.observe(\TunnelContainer.status) { [weak self] tunnel, _ in - self?.statusImageView.image = TunnelListCell.image(for: tunnel.status) + self?.statusImageView.image = TunnelListRow.image(for: tunnel.status) } } } diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift index 4a10f7d..8e7db43 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelDetailTableViewController.swift @@ -215,14 +215,14 @@ extension TunnelDetailTableViewController: NSTableViewDelegate { let modelRow = tableViewModelRows[row] switch modelRow { case .interfaceFieldRow(let field): - let cell: KeyValueCell = tableView.dequeueReusableCell() + let cell: KeyValueRow = tableView.dequeueReusableCell() let localizedKeyString = modelRow.isTitleRow() ? modelRow.localizedSectionKeyString() : field.localizedUIString cell.key = tr(format: "macDetailFieldKey (%@)", localizedKeyString) cell.value = tunnelViewModel.interfaceData[field] cell.isKeyInBold = modelRow.isTitleRow() return cell case .peerFieldRow(let peerData, let field): - let cell: KeyValueCell = tableView.dequeueReusableCell() + let cell: KeyValueRow = tableView.dequeueReusableCell() let localizedKeyString = modelRow.isTitleRow() ? modelRow.localizedSectionKeyString() : field.localizedUIString cell.key = tr(format: "macDetailFieldKey (%@)", localizedKeyString) cell.value = peerData[field] diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift index 7eee345..723814e 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift @@ -258,7 +258,7 @@ extension TunnelsListTableViewController: NSTableViewDataSource { extension TunnelsListTableViewController: NSTableViewDelegate { func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { - let cell: TunnelListCell = tableView.dequeueReusableCell() + let cell: TunnelListRow = tableView.dequeueReusableCell() cell.tunnel = tunnelsManager.tunnel(at: row) return cell }