Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

Spelling #1

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Pods/Local Podspecs/vpncore.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Pods/Pods-ProtonVPN-metadata.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Pods/Pods-ProtonVPNTests-metadata.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions ProtonVPN.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
D5D6A94A230D296400A432D1 /* DependencyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D6A949230D296400A432D1 /* DependencyContainer.swift */; };
E10FA80522C21AC100CD03B2 /* Srp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E10FA80422C21AC100CD03B2 /* Srp.framework */; };
E1144E3E22E8D4770087A685 /* ObfuscatedConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1144E3D22E8D4770087A685 /* ObfuscatedConstants.swift */; };
E1248885220A18D2005B9A9E /* CodeSignatureComparitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1248884220A18D2005B9A9E /* CodeSignatureComparitor.swift */; };
E1248886220A18D2005B9A9E /* CodeSignatureComparitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1248884220A18D2005B9A9E /* CodeSignatureComparitor.swift */; };
E1248885220A18D2005B9A9E /* CodeSignatureComparator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1248884220A18D2005B9A9E /* CodeSignatureComparator.swift */; };
E1248886220A18D2005B9A9E /* CodeSignatureComparator.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1248884220A18D2005B9A9E /* CodeSignatureComparator.swift */; };
E125DCE0221ADA5300027272 /* CommandLineToolRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = E125DCDF221ADA5300027272 /* CommandLineToolRunner.swift */; };
E125DCE1221ADBE100027272 /* CommandLineToolRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = E125DCDF221ADA5300027272 /* CommandLineToolRunner.swift */; };
E125DCE2221ADBED00027272 /* NetworkHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E17DE10321FB5043008CCC13 /* NetworkHelper.swift */; };
Expand Down Expand Up @@ -409,7 +409,7 @@
E10FA80422C21AC100CD03B2 /* Srp.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Srp.framework; path = Frameworks/Srp.framework; sourceTree = "<group>"; };
E1144E3B22E8D4460087A685 /* ObfuscatedConstants.example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObfuscatedConstants.example.swift; sourceTree = "<group>"; };
E1144E3D22E8D4770087A685 /* ObfuscatedConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObfuscatedConstants.swift; sourceTree = "<group>"; };
E1248884220A18D2005B9A9E /* CodeSignatureComparitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeSignatureComparitor.swift; sourceTree = "<group>"; };
E1248884220A18D2005B9A9E /* CodeSignatureComparator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeSignatureComparator.swift; sourceTree = "<group>"; };
E125DCDF221ADA5300027272 /* CommandLineToolRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandLineToolRunner.swift; sourceTree = "<group>"; };
E1261FB8202CA45C005E9880 /* ColoredLoadButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColoredLoadButton.swift; sourceTree = "<group>"; };
E12657A120ED01E6004A21C4 /* GreenHighlightButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GreenHighlightButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -820,12 +820,12 @@
name = ReportBug;
sourceTree = "<group>";
};
D5D6A948230D294C00A432D1 /* Dependecy injection */ = {
D5D6A948230D294C00A432D1 /* Dependency injection */ = {
isa = PBXGroup;
children = (
D5D6A949230D296400A432D1 /* DependencyContainer.swift */,
);
name = "Dependecy injection";
name = "Dependency injection";
sourceTree = "<group>";
};
E13F4CFF20FCD6CF00D985C2 /* Tests */ = {
Expand Down Expand Up @@ -1591,7 +1591,7 @@
EED534831EEC112000013607 /* ProtonVPN */ = {
isa = PBXGroup;
children = (
D5D6A948230D294C00A432D1 /* Dependecy injection */,
D5D6A948230D294C00A432D1 /* Dependency injection */,
EE69C8CD1F5D7F9E00C3065C /* Windows */,
EECCBA751F070FA1007829E0 /* ProtonVPN.entitlements */,
EE36B0C91F4B62D6005DB349 /* Constants */,
Expand Down Expand Up @@ -1636,7 +1636,7 @@
children = (
E1661BA421B92A36005DB438 /* MapCoordinateTranslator.swift */,
E13464DB2035BA5C00C0DB7D /* NetworkStatistics.swift */,
E1248884220A18D2005B9A9E /* CodeSignatureComparitor.swift */,
E1248884220A18D2005B9A9E /* CodeSignatureComparator.swift */,
);
name = Utilities;
sourceTree = "<group>";
Expand Down Expand Up @@ -2291,7 +2291,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E1248886220A18D2005B9A9E /* CodeSignatureComparitor.swift in Sources */,
E1248886220A18D2005B9A9E /* CodeSignatureComparator.swift in Sources */,
E17DE11821FEF8F8008CCC13 /* NetworkHelperProtocol.swift in Sources */,
E17DE12521FF4426008CCC13 /* NetworkHelperAuthRight.swift in Sources */,
E125DCE0221ADA5300027272 /* CommandLineToolRunner.swift in Sources */,
Expand Down Expand Up @@ -2354,7 +2354,7 @@
EE68DD511F49F4BE00F218B8 /* TabBarView.swift in Sources */,
E187022620E3A567000521AC /* StatusMenuSurfaceButton.swift in Sources */,
E180D16C2126FCF700F4D1C7 /* TourNextButton.swift in Sources */,
E1248885220A18D2005B9A9E /* CodeSignatureComparitor.swift in Sources */,
E1248885220A18D2005B9A9E /* CodeSignatureComparator.swift in Sources */,
E187022020E268FE000521AC /* StatusMenuProfileItemViewModel.swift in Sources */,
EE5CF76E1F4DDB750002BBF3 /* ProfilesMenuController.swift in Sources */,
E17C1CE520EA2C6500DCC687 /* StatusMenuCountryItemViewModel.swift in Sources */,
Expand Down
10 changes: 5 additions & 5 deletions ProtonVPN/AppSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ class AppSessionManagerImplementation: AppSessionManager {
// MARK: - Refresh
func scheduleRefreshes(now: Bool) {
if loginTimer == nil || !loginTimer!.isValid {
loginTimer = Timer.scheduledTimer(timeInterval: refreshRate, target: self, selector: #selector(reistablishLogin), userInfo: nil, repeats: true)
loginTimer = Timer.scheduledTimer(timeInterval: refreshRate, target: self, selector: #selector(reestablishLogin), userInfo: nil, repeats: true)
}

if now, lastRefresh.addingTimeInterval(refreshRate) < Date() {
reistablishLogin()
reestablishLogin()
}
}

Expand All @@ -293,10 +293,10 @@ class AppSessionManagerImplementation: AppSessionManager {
}
}

@objc private func reistablishLogin() {
@objc private func reestablishLogin() {
lastRefresh = Date()
attemptRememberLogIn(success: {}, failure: { [unowned self] error in
PMLog.D("Failed to reistablish vpn credentials: \(error.localizedDescription)", level: .error)
PMLog.D("Failed to reestablish vpn credentials: \(error.localizedDescription)", level: .error)

let error = error as NSError
switch error.code {
Expand All @@ -308,7 +308,7 @@ class AppSessionManagerImplementation: AppSessionManager {
})
}

// MARK: - AppDelegate quit behaviour
// MARK: - AppDelegate quit behavior

func replyToApplicationShouldTerminate() {
guard sessionStatus == .established && !appStateManager.state.isSafeToEnd && !propertiesManager.rememberLoginAfterUpdate else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "doube-arrow-right.pdf"
"filename" : "double-arrow-right.pdf"
}
],
"info" : {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// CodeSignatureComparitor.swift
// CodeSignatureComparator.swift
// ProtonVPN - Created on 27.06.19.
//
// Copyright (c) 2019 Proton Technologies AG
Expand All @@ -26,7 +26,7 @@ enum CodeSignatureError: Error {
case message(String)
}

struct CodeSignatureComparitor {
struct CodeSignatureComparator {

public static func codeSignatureMatches(pid: pid_t) throws -> Bool {
return try codeSigningCertificatesForSelf() == codeSigningCertificates(for: pid)
Expand Down
2 changes: 1 addition & 1 deletion ProtonVPN/ConnectingOverlay.xib
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="retryConneting:" target="-2" id="tdk-M2-aqq"/>
<action selector="retryConnecting:" target="-2" id="tdk-M2-aqq"/>
</connections>
</button>
</subviews>
Expand Down
2 changes: 1 addition & 1 deletion ProtonVPN/ConnectingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ConnectingViewController: NSViewController, OverlayViewModelDelegate {
viewModel.cancelConnecting()
}

@IBAction private func retryConneting(_ sender: Any) {
@IBAction private func retryConnecting(_ sender: Any) {
viewModel.retryConnection()
}

Expand Down
2 changes: 1 addition & 1 deletion ProtonVPN/CountryAnnotationViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CountryAnnotationViewModel {
let connectWidth = attributedConnect.size().width + titlePadding * 2
let disconnectWidth = attributedDisconnect.size().width + titlePadding * 2
let widths = [minWidth, countryWidth, connectWidth, disconnectWidth]
return 2 * round((widths.max() ?? fallBackWidth) / 2) // prevents bluring on non-retina
return 2 * round((widths.max() ?? fallBackWidth) / 2) // prevents blurring on non-retina
} else {
return fallBackWidth
}
Expand Down
8 changes: 4 additions & 4 deletions ProtonVPN/FirewallManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class FirewallManager {
private var lastConnectedInterfaces: [String]?
private var lastVpnServerIp: String?

private var killSwitchBlockingShownSinceLatestSuccessfullConnection = false
private var killSwitchBlockingShownSinceLatestSuccessfulConnection = false

private var inactiveFirewallTimer: Timer?

Expand Down Expand Up @@ -187,12 +187,12 @@ class FirewallManager {
case .connecting(let serverDescriptor):
attemptEnablingFirewallWhileConnecting(ipAddress: serverDescriptor.address)
case .connected(let serverDescriptor):
killSwitchBlockingShownSinceLatestSuccessfullConnection = false
killSwitchBlockingShownSinceLatestSuccessfulConnection = false
enableFirewall(ipAddress: serverDescriptor.address)
case .disconnected:
if propertiesManager.intentionallyDisconnected {
disableFirewall()
} else if !killSwitchBlockingShownSinceLatestSuccessfullConnection {
} else if !killSwitchBlockingShownSinceLatestSuccessfulConnection {
notifyOfActiveFirewall()
}
case .aborted(userInitiated: _):
Expand Down Expand Up @@ -455,7 +455,7 @@ class FirewallManager {
guard let `self` = self else { return }

if enabled && self.appStateManager.state.isSafeToEnd { // prevents quick changes between disconnected and connecting from flashing the popup
self.killSwitchBlockingShownSinceLatestSuccessfullConnection = true
self.killSwitchBlockingShownSinceLatestSuccessfulConnection = true
self.alertService.push(alert: self.killSwitchBlockingAlert)
}
}
Expand Down
4 changes: 2 additions & 2 deletions ProtonVPN/General.xib
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<outlet property="rememberLoginSeparator" destination="Jpt-aV-Oth" id="VHw-2x-YS3"/>
<outlet property="startMinimizedButton" destination="028-IW-VNS" id="81m-Hl-U5n"/>
<outlet property="startMinimizedLabel" destination="NRQ-fP-BcB" id="hC7-zO-N1G"/>
<outlet property="startMinimizedSeperator" destination="Myq-Cy-E2t" id="lth-RT-0v0"/>
<outlet property="startMinimizedSeparator" destination="Myq-Cy-E2t" id="lth-RT-0v0"/>
<outlet property="startOnBootButton" destination="YCb-qR-3vO" id="x7s-xs-W5T"/>
<outlet property="startOnBootLabel" destination="eTP-6s-cjq" id="shE-6C-7tO"/>
<outlet property="startOnBootSeparator" destination="13D-5X-qC1" id="jEG-bG-0o8"/>
Expand Down Expand Up @@ -131,7 +131,7 @@
<constraint firstAttribute="width" constant="35" id="ODR-FE-iCv"/>
</constraints>
</customView>
<box boxType="custom" borderType="none" borderWidth="0.0" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Myq-Cy-E2t" userLabel="Start Minimized Seperator">
<box boxType="custom" borderType="none" borderWidth="0.0" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Myq-Cy-E2t" userLabel="Start Minimized Separator">
<rect key="frame" x="42" y="0.0" width="416" height="1"/>
<view key="contentView" id="5Pa-KH-ReK">
<rect key="frame" x="0.0" y="0.0" width="416" height="1"/>
Expand Down
4 changes: 2 additions & 2 deletions ProtonVPN/GeneralSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GeneralSettingsViewController: NSViewController {

@IBOutlet weak var startMinimizedLabel: PVPNTextField!
@IBOutlet weak var startMinimizedButton: SwitchButton!
@IBOutlet weak var startMinimizedSeperator: NSBox!
@IBOutlet weak var startMinimizedSeparator: NSBox!

@IBOutlet weak var systemNotificationsLabel: PVPNTextField!
@IBOutlet weak var systemNotificationsButton: SwitchButton!
Expand Down Expand Up @@ -108,7 +108,7 @@ class GeneralSettingsViewController: NSViewController {
startMinimizedButton.buttonView?.tag = SwitchButtonOption.startMinimized.rawValue
startMinimizedButton.delegate = self

startMinimizedSeperator.fillColor = .protonLightGrey()
startMinimizedSeparator.fillColor = .protonLightGrey()
}

private func setupSystemNotificationsItem() {
Expand Down
2 changes: 1 addition & 1 deletion ProtonVPN/HoverDetectionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Cocoa

class HoverDetectionButton: NSButton {

// Adds padding betweet text and button border
// Adds padding between text and button border
@IBInspectable var horizontalPadding: CGFloat = 0
@IBInspectable var verticalPadding: CGFloat = 0

Expand Down
2 changes: 1 addition & 1 deletion ProtonVPN/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class LoginViewController: NSViewController {
override func viewDidAppear() {
super.viewDidAppear()

viewModel.logInApperared()
viewModel.logInAppeared()
_ = usernameTextField.becomeFirstResponder()
}

Expand Down
16 changes: 8 additions & 8 deletions ProtonVPN/LoginViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,24 @@ class LoginViewModel {
}

logInInProgress?()
appSessionManager.attemptRememberLogIn(success: { [silantlyCheckForUpdates] in
appSessionManager.attemptRememberLogIn(success: { [silentlyCheckForUpdates] in
NSApp.setActivationPolicy(.accessory)
silantlyCheckForUpdates()
silentlyCheckForUpdates()
}, failure: { [weak self] error in
guard let `self` = self else { return }
self.specialErrorCaseNotification(error)
self.navService.handleSilentLoginFailure()
})
}

func logInApperared() {
func logInAppeared() {
guard propertiesManager.rememberLogin || propertiesManager.rememberLoginAfterUpdate else {
return
}

logInInProgress?()
appSessionManager.attemptRememberLogIn(success: { [silantlyCheckForUpdates] in
silantlyCheckForUpdates()
appSessionManager.attemptRememberLogIn(success: { [silentlyCheckForUpdates] in
silentlyCheckForUpdates()
}, failure: { [weak self] error in
guard let `self` = self else { return }
self.specialErrorCaseNotification(error)
Expand All @@ -92,8 +92,8 @@ class LoginViewModel {

func logIn(username: String, password: String) {
logInInProgress?()
appSessionManager.logIn(username: username, password: password, success: { [silantlyCheckForUpdates] in
silantlyCheckForUpdates()
appSessionManager.logIn(username: username, password: password, success: { [silentlyCheckForUpdates] in
silentlyCheckForUpdates()
}, failure: { [weak self] error in
guard let `self` = self else { return }
self.specialErrorCaseNotification(error)
Expand All @@ -110,7 +110,7 @@ class LoginViewModel {
}
}

private func silantlyCheckForUpdates() {
private func silentlyCheckForUpdates() {
UpdateManager.shared.checkForUpdates(appSessionManager, firewallManager: firewallManager, silently: true)
}

Expand Down
18 changes: 9 additions & 9 deletions ProtonVPN/MapHeaderBackground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MapHeaderBackground: NSView {
private let lowerBorderRadius: CGFloat = 75
private let headerHeight: CGFloat = 55

private let outterCircleRadius: CGFloat = 20
private let outerCircleRadius: CGFloat = 20
private let innerCircleRadius: CGFloat = 15

let width: CGFloat
Expand All @@ -42,7 +42,7 @@ class MapHeaderBackground: NSView {
}

var path = CGMutablePath()
var outter = CGMutablePath()
var outer = CGMutablePath()
var clicked: (() -> Void)?

required init?(coder decoder: NSCoder) {
Expand All @@ -51,7 +51,7 @@ class MapHeaderBackground: NSView {
}

override func hitTest(_ point: NSPoint) -> NSView? {
if path.contains(point) || outter.contains(point) {
if path.contains(point) || outer.contains(point) {
return super.hitTest(point)
} else {
return nil
Expand All @@ -60,7 +60,7 @@ class MapHeaderBackground: NSView {

override func mouseUp(with event: NSEvent) {
let pointInView = convert(event.locationInWindow, from: nil)
if path.contains(pointInView) || outter.contains(pointInView) {
if path.contains(pointInView) || outer.contains(pointInView) {
clicked?()
}
}
Expand Down Expand Up @@ -110,13 +110,13 @@ class MapHeaderBackground: NSView {
context.setFillColor(backgroundColor)
context.drawPath(using: .fill)

outter = CGMutablePath()
var circleOrigin = CGPoint(x: bounds.width / 2 - outterCircleRadius, y: bounds.maxY - headerHeight - outterCircleRadius)
var circleBounds = CGSize(width: 2 * outterCircleRadius, height: 2 * outterCircleRadius)
outer = CGMutablePath()
var circleOrigin = CGPoint(x: bounds.width / 2 - outerCircleRadius, y: bounds.maxY - headerHeight - outerCircleRadius)
var circleBounds = CGSize(width: 2 * outerCircleRadius, height: 2 * outerCircleRadius)
var circleRect = CGRect(origin: circleOrigin, size: circleBounds)
outter.addEllipse(in: circleRect)
outer.addEllipse(in: circleRect)

context.addPath(outter)
context.addPath(outer)
context.drawPath(using: .fill)

let inner = CGMutablePath()
Expand Down
2 changes: 1 addition & 1 deletion ProtonVPN/NSColor+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ extension NSColor {
alpha: 1.0)
}

class func protonGreySeperatorOnWhite() -> NSColor {
class func protonGreySeparatorOnWhite() -> NSColor {
return NSColor(red: 234/255,
green: 234/255,
blue: 234/255,
Expand Down
Loading