Skip to content

Commit

Permalink
Enhance WiFiConfigWindow
Browse files Browse the repository at this point in the history
- Show encryption type when unsupported
- Select SSID field when manually joining other networks
  • Loading branch information
williambj1 committed Jul 31, 2024
1 parent 388bd47 commit cb25dc7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions HeliPort/Appearance/WiFiConfigWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ class WiFiConfigWindow: NSWindow {

func show() {
guard !securityPop.title.isEmpty else {
Log.error("WiFiConfigWindow not shown due to unknown security type")
Log.error("WiFiConfigWindow not shown due to unsupported security type: " +
(networkInfo?.auth.security.description ?? "unknown"))
return
}
makeKeyAndOrderFront(self)
Expand Down Expand Up @@ -467,7 +468,11 @@ extension WiFiConfigWindow {
gridView.row(at: .usernameRow).isHidden = true
gridView.row(at: .passwordRow).isHidden = false
gridView.row(at: .showPassRow).isHidden = false
passwdSecureBox.becomeFirstResponder()
if networkBox.isHidden || !networkBox.stringValue.isEmpty {
passwdSecureBox.becomeFirstResponder()
} else {
networkBox.becomeFirstResponder()
}
case .wpa_1_2_Enterprise,
.wpa_2_3_Enterprise,
.wpa2Enterprise,
Expand All @@ -479,6 +484,7 @@ extension WiFiConfigWindow {
default:
let alert = NSAlert()
alert.messageText = .encryptionUnsupported
alert.informativeText = networkInfo?.auth.security.description ?? ""
alert.alertStyle = .critical
alert.runModal()
return
Expand Down

0 comments on commit cb25dc7

Please sign in to comment.