aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-20 04:24:23 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-20 04:24:23 +0100
commitfbe101eabbadfb16b4888e85e076ef2544134917 (patch)
treea3d534f09cedf1da7492d77c3c6b77baa20f4070 /WireGuard/WireGuard
parentmacOS: Login item: Add a simple login item (diff)
downloadwireguard-apple-fbe101eabbadfb16b4888e85e076ef2544134917.tar.xz
wireguard-apple-fbe101eabbadfb16b4888e85e076ef2544134917.zip
macOS: Privacy notice is provided by system dialogs
So it really doesn't make sense to add our own. This causes several popups when trying to add a tunnel, which is madness. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/macOS/AppStorePrivacyNotice.swift29
-rw-r--r--WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift4
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift18
3 files changed, 9 insertions, 42 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppStorePrivacyNotice.swift b/WireGuard/WireGuard/UI/macOS/AppStorePrivacyNotice.swift
deleted file mode 100644
index 15aeb8d..0000000
--- a/WireGuard/WireGuard/UI/macOS/AppStorePrivacyNotice.swift
+++ /dev/null
@@ -1,29 +0,0 @@
-// SPDX-License-Identifier: MIT
-// Copyright © 2018-2019 WireGuard LLC. All Rights Reserved.
-
-import Cocoa
-
-class AppStorePrivacyNotice {
- // The App Store Review Board does not comprehend the fact that this application
- // is not a service and does not have any servers of its own. They therefore require
- // us to give a notice regarding collection of user data using our non-existent
- // servers. This demand is obviously impossible to fulfill, since it doesn't make sense,
- // but we do our best here to show something in that category.
- static func show(from sourceVC: NSViewController?, into tunnelsManager: TunnelsManager, _ callback: @escaping () -> Void) {
- if tunnelsManager.numberOfTunnels() > 0 {
- callback()
- return
- }
- let alert = NSAlert()
-
- alert.messageText = tr("macPrivacyNoticeMessage")
- alert.informativeText = tr("macPrivacyNoticeInfo")
- alert.alertStyle = NSAlert.Style.warning
- if let window = sourceVC?.view.window {
- alert.beginSheetModal(for: window) { _ in callback() }
- } else {
- alert.runModal()
- callback()
- }
- }
-}
diff --git a/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift b/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift
index 67b074c..d081f8c 100644
--- a/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift
+++ b/WireGuard/WireGuard/UI/macOS/ImportPanelPresenter.swift
@@ -13,9 +13,7 @@ class ImportPanelPresenter {
openPanel.beginSheetModal(for: window) { [weak tunnelsManager] response in
guard let tunnelsManager = tunnelsManager else { return }
guard response == .OK else { return }
- AppStorePrivacyNotice.show(from: sourceVC, into: tunnelsManager) {
- TunnelImporter.importFromFile(urls: openPanel.urls, into: tunnelsManager, sourceVC: sourceVC, errorPresenterType: ErrorPresenter.self)
- }
+ TunnelImporter.importFromFile(urls: openPanel.urls, into: tunnelsManager, sourceVC: sourceVC, errorPresenterType: ErrorPresenter.self)
}
}
}
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
index 3d959cf..13433c0 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
@@ -243,17 +243,15 @@ class TunnelEditViewController: NSViewController {
}
} else {
// We're creating a new tunnel
- AppStorePrivacyNotice.show(from: self, into: tunnelsManager) { [weak self] in
- self?.tunnelsManager.add(tunnelConfiguration: tunnelConfiguration, onDemandOption: onDemandOption) { [weak self] result in
- self?.setUserInteractionEnabled(true)
- if let error = result.error {
- ErrorPresenter.showErrorAlert(error: error, from: self)
- return
- }
- let tunnel: TunnelContainer = result.value!
- self?.dismiss(self)
- self?.delegate?.tunnelSaved(tunnel: tunnel)
+ self.tunnelsManager.add(tunnelConfiguration: tunnelConfiguration, onDemandOption: onDemandOption) { [weak self] result in
+ self?.setUserInteractionEnabled(true)
+ if let error = result.error {
+ ErrorPresenter.showErrorAlert(error: error, from: self)
+ return
}
+ let tunnel: TunnelContainer = result.value!
+ self?.dismiss(self)
+ self?.delegate?.tunnelSaved(tunnel: tunnel)
}
}
}