Add down/up indication of data count

Other improvements:

- TunnelKit reports 0 rather than nil upon connection.
- Fall back to "Unavailable" rather than empty string.
This commit is contained in:
Davide De Rosa 2019-03-30 23:26:28 +01:00
parent 4ab70ea747
commit 3197f49368
5 changed files with 13 additions and 10 deletions

View File

@ -760,7 +760,7 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
if let count = currentDataCount, vpn.status == .connected { if let count = currentDataCount, vpn.status == .connected {
cell.rightText = L10n.Service.Cells.DataCount.value(count.0.dataUnitDescription, count.1.dataUnitDescription) cell.rightText = L10n.Service.Cells.DataCount.value(count.0.dataUnitDescription, count.1.dataUnitDescription)
} else { } else {
cell.rightText = nil cell.rightText = L10n.Service.Cells.DataCount.none
} }
cell.accessoryType = .none cell.accessoryType = .none
cell.isTappable = false cell.isTappable = false

View File

@ -108,7 +108,8 @@
"service.cells.trusted_policy.caption" = "Trust disables VPN"; "service.cells.trusted_policy.caption" = "Trust disables VPN";
"service.cells.test_connectivity.caption" = "Test connectivity"; "service.cells.test_connectivity.caption" = "Test connectivity";
"service.cells.data_count.caption" = "Exchanged data count"; "service.cells.data_count.caption" = "Exchanged data count";
"service.cells.data_count.value" = "%@ / %@"; "service.cells.data_count.value" = "↓%@ / ↑%@";
"service.cells.data_count.none" = "Unavailable";
"service.cells.debug_log.caption" = "Debug log"; "service.cells.debug_log.caption" = "Debug log";
"service.cells.masks_private_data.caption" = "Mask network data"; "service.cells.masks_private_data.caption" = "Mask network data";
"service.cells.report_issue.caption" = "Report connectivity issue"; "service.cells.report_issue.caption" = "Report connectivity issue";

View File

@ -543,7 +543,9 @@ public enum L10n {
public enum DataCount { public enum DataCount {
/// Exchanged data count /// Exchanged data count
public static let caption = L10n.tr("Localizable", "service.cells.data_count.caption") public static let caption = L10n.tr("Localizable", "service.cells.data_count.caption")
/// %@ / %@ /// Unavailable
public static let `none` = L10n.tr("Localizable", "service.cells.data_count.none")
/// %@ / %@
public static func value(_ p1: String, _ p2: String) -> String { public static func value(_ p1: String, _ p2: String) -> String {
return L10n.tr("Localizable", "service.cells.data_count.value", p1, p2) return L10n.tr("Localizable", "service.cells.data_count.value", p1, p2)
} }

View File

@ -5,8 +5,8 @@ use_frameworks!
def shared_pods def shared_pods
#pod 'TunnelKit', '~> 1.5.0' #pod 'TunnelKit', '~> 1.5.0'
#pod 'TunnelKit/LZO', '~> 1.5.0' #pod 'TunnelKit/LZO', '~> 1.5.0'
pod 'TunnelKit', :git => 'https://github.com/keeshux/tunnelkit', :commit => '93a7729' pod 'TunnelKit', :git => 'https://github.com/keeshux/tunnelkit', :commit => 'a638767'
pod 'TunnelKit/LZO', :git => 'https://github.com/keeshux/tunnelkit', :commit => '93a7729' pod 'TunnelKit/LZO', :git => 'https://github.com/keeshux/tunnelkit', :commit => 'a638767'
#pod 'TunnelKit', :path => '../../personal/tunnelkit' #pod 'TunnelKit', :path => '../../personal/tunnelkit'
#pod 'TunnelKit/LZO', :path => '../../personal/tunnelkit' #pod 'TunnelKit/LZO', :path => '../../personal/tunnelkit'
end end

View File

@ -15,8 +15,8 @@ PODS:
DEPENDENCIES: DEPENDENCIES:
- MBProgressHUD - MBProgressHUD
- TunnelKit (from `https://github.com/keeshux/tunnelkit`, commit `93a7729`) - TunnelKit (from `https://github.com/keeshux/tunnelkit`, commit `a638767`)
- TunnelKit/LZO (from `https://github.com/keeshux/tunnelkit`, commit `93a7729`) - TunnelKit/LZO (from `https://github.com/keeshux/tunnelkit`, commit `a638767`)
SPEC REPOS: SPEC REPOS:
https://github.com/cocoapods/specs.git: https://github.com/cocoapods/specs.git:
@ -26,12 +26,12 @@ SPEC REPOS:
EXTERNAL SOURCES: EXTERNAL SOURCES:
TunnelKit: TunnelKit:
:commit: 93a7729 :commit: a638767
:git: https://github.com/keeshux/tunnelkit :git: https://github.com/keeshux/tunnelkit
CHECKOUT OPTIONS: CHECKOUT OPTIONS:
TunnelKit: TunnelKit:
:commit: 93a7729 :commit: a638767
:git: https://github.com/keeshux/tunnelkit :git: https://github.com/keeshux/tunnelkit
SPEC CHECKSUMS: SPEC CHECKSUMS:
@ -40,6 +40,6 @@ SPEC CHECKSUMS:
SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165 SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165
TunnelKit: 9d8089c4600ea9b3a54841391b4969f2faa9c17f TunnelKit: 9d8089c4600ea9b3a54841391b4969f2faa9c17f
PODFILE CHECKSUM: 6010aa429513f9c70c23f9087ac02d60b1a183b6 PODFILE CHECKSUM: 41cfe6321ea8695a6288fd8009199854a1a8fbe2
COCOAPODS: 1.6.1 COCOAPODS: 1.6.1