macOS: Rename *Cell to *Row

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander
2019-01-07 13:04:50 +05:30
parent c72f7056b3
commit f7b2f73015
5 changed files with 15 additions and 15 deletions
@@ -3,7 +3,7 @@
import Cocoa
class KeyValueCell: NSView {
class KeyValueRow: NSView {
let keyLabel: NSTextField = {
let keyLabel = NSTextField()
keyLabel.isEditable = false
@@ -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)
}
}
}
@@ -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]
@@ -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
}