Skip to content

Commit

Permalink
Merge branch 'OpenIntelWireless:master' into patch-5
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyvoxi committed Jul 6, 2024
2 parents 7e813c5 + d3d801b commit 508a2b8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 33 deletions.
4 changes: 2 additions & 2 deletions HeliPort/Appearance/Preferences/PrefsSavedNetworksView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PrefsSavedNetworksView: NSView {
return label
}()

private let modifyItemSegment: NSSegmentedControl = {
private lazy var modifyItemSegment: NSSegmentedControl = {
var removeImage: NSImage
var viewImage: NSImage
if #available(OSX 11.0, *) {
Expand All @@ -91,7 +91,7 @@ class PrefsSavedNetworksView: NSView {
}
let button = NSSegmentedControl(images: [removeImage, viewImage],
trackingMode: .momentary,
target: NSSegmentedControl.self,
target: self,
action: #selector(modifyItemClicked(_:)))
button.setEnabled(false, forSegment: .remove)
button.setEnabled(false, forSegment: .view)
Expand Down
7 changes: 3 additions & 4 deletions HeliPort/Appearance/StatusMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class StatusMenu: NSMenu, NSMenuDelegate {
private var statusUpdateTimer: Timer?

// One instance at a time
private var preferenceWindow: PrefsWindow?
private lazy var preferenceWindow = PrefsWindow()

private var status: itl_80211_state = ITL80211_S_INIT {
didSet {
Expand Down Expand Up @@ -448,9 +448,8 @@ final class StatusMenu: NSMenu, NSMenuDelegate {
let alert = Alert(text: .notImplemented)
alert.show()
case .openNetworkPrefs:
preferenceWindow?.close()
preferenceWindow = PrefsWindow()
preferenceWindow?.show()
preferenceWindow.close()
preferenceWindow.show()
case .checkUpdates:
heliPortUpdater.checkForUpdates(self)
case .launchLogin:
Expand Down
46 changes: 23 additions & 23 deletions HeliPort/Appearance/pt-BR.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
" Noise: " = " Ruído: ";
" PHY Mode: " = " Modo PHY: ";
" RSSI: " = " RSSI: ";
" Router: " = " Roteador IP: ";
" Router: " = " Roteador: ";
" Security: " = " Segurança: ";
" Tx Rate: " = " Taxa Tx: ";
"%@'s Credentials" = "%@'s Credenciais";
"%@'s Info" = "%@'s Info";
"%@'s Credentials" = "Credenciais de %@";
"%@'s Info" = "Informações de %@";
"About HeliPort" = "Sobre o HeliPort";
"Address: " = "Endereço: ";
"Auto Join" = "Adesão automática";
"Auto Join" = "Conexão Automática";
"Automatically check for updates." = "Verificar automaticamente por atualizações.";
"Automatically download new updates." = "Download automático de atualizações.";
"Automatically download new updates." = "Baixar automaticamente novas atualizações.";
"Cancel" = "Cancelar";
"Check for Updates..." = "Buscando Atualizações...";
"Check for Updates..." = "Verificar por Atualizações...";
"Close" = "Fechar";
"Create Diagnostics Report..." = "Criar Relatório de Diagnóstico...";
"Create Network..." = "Adicionar Rede...";
"Disconnect from " = "Desconectar de ";
"Disconnect from " = "Desconectar-se de ";
"Dismiss" = "Esquecer";
"Drag networks into the order you prefer." = "Arraste as redes para a ordem que você prefere.";
"Drag networks into the order you prefer." = "Arraste as redes para a ordem que você preferir.";
"Dynamic WEP" = "WEP Dinâmico";
"Enable Wi-Fi Logging" = "Ativar Registro de Wi-Fi";
"Encryption type unsupported" = "Tipo de encriptação sem suporte";
"Enter the name and security type of the network you want to join." = "Digite o nome e o tipo de segurança da rede à qual você deseja acessar. ";
"Encryption type unsupported" = "Tipo de criptografia não suportada";
"Enter the name and security type of the network you want to join." = "Digite o nome e o tipo de segurança da rede à qual você deseja se conectar.";
"FUNCTION NOT IMPLEMENTED" = "FUNÇÃO NÃO IMPLEMENTADA";
"Find and join a Wi-Fi network." = "Encontre e entre em uma rede Wi-Fi. ";
"Find and join a Wi-Fi network." = "Encontre e entre em uma rede Wi-Fi.";
"General" = "Geral";
"HeliPort API Version: " = "Versão da API HeliPort: ";
"HeliPort API Version: " = "Versão da API do HeliPort: ";
"HeliPort running at an unexpected path" = "HeliPort rodando em um caminho inesperado";
"Interface Name: " = "Nome da Interface: ";
"Join Other Network..." = "Entrar em Outra Rede...";
Expand All @@ -42,12 +42,12 @@
"Network Name" = "Nome da Rede";
"Network Name:" = "Nome da Rede:";
"Networks" = "Redes";
"No Network Avaliable" = "Nenhuma rede disponível";
"No Network Avaliable" = "Nenhuma Rede Disponível";
"No Status Information Avaliable" = "Nenhuma Informação de Status Disponível";
"None" = "Nenhum";
"Open Network Preferences..." = "Abrir Preferências de Rede...";
"Open Network Preferences..." = "Abrir Preferências de Rede...";
"Open Wireless Diagnostics..." = "Abrir Diagnóstico de Rede Sem Fio...";
"Open Wireless Diagnostics..." = "Abrir Diagnóstico de Rede sem fio...";
"Password" = "Senha";
"Password:" = "Senha:";
"Quit HeliPort" = "Sair do HeliPort";
Expand All @@ -65,10 +65,10 @@
"Unknown" = "Desconhecido";
"Unreachable" = "Inacessível";
"Updates:" = "Atualizações:";
"Username:" = "Nome de Usuário:";
"Username:" = "Nome de usuário:";
"Version: " = "Versão: ";
"View saved credentials from keychain for the selected network." = "Ver as credenciais salvas do chaveiro para a rede selecionada.";
"View saved credentials from keychain for this network." = "Veja as credenciais salvas do chaveiro para esta rede.";
"View saved credentials from keychain for the selected network." = "Visualizando as credenciais salvas no chaveiro para a rede selecionada.";
"View saved credentials from keychain for this network." = "Visualizar as credenciais salvas no chaveiro para esta rede.";
"Visit OpenIntelWireless on GitHub" = "Visite OpenIntelWireless no GitHub";
"WEP" = "WEP";
"WPA/WPA2 Enterprise" = "WPA/WPA2 Empresarial";
Expand All @@ -86,10 +86,10 @@
"Wi-Fi: Off" = "Wi-Fi: Desativado";
"Wi-Fi: On" = "Wi-Fi: Ativado";
"Wi-Fi: Status unavailable" = "Wi-Fi: Status indisponível";
"Your Mac will no longer join this Wi-Fi network." = "Seu Mac não se juntará a esta rede Wi-Fi.";
"Your Mac will no longer join this Wi-Fi network." = "Seu Mac não se conectará mais a esta rede Wi-Fi.";
"\" Requires Password" = "\" Requer senha";
"itlwm API Version: " = " Versão da API itlwm: ";
"itlwm Version Mismatch" = "Versão Incompatível do itlwm";
"itlwm is not running" = "itlwm não está rodando";
"none" = "nada";
"verify your credentials to show the stored password" = "verificar suas credenciais para mostrar a senha armazenada";
"itlwm API Version: " = "Versão da API do itlwm: ";
"itlwm Version Mismatch" = "Versão do itlwm Incompatível";
"itlwm is not running" = "itlwm não está em execução";
"none" = "nenhum";
"verify your credentials to show the stored password" = "verifique suas credenciais para mostrar a senha armazenada";
20 changes: 16 additions & 4 deletions HeliPort/LoginItemManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class LoginItemManager {
public class func isEnabled() -> Bool {

guard let jobs =
(SMCopyAllJobDictionaries(kSMDomainUserLaunchd).takeRetainedValue() as? [[String: AnyObject]])
else {
return false
}
(LoginItemManager.self as DeprecationWarningWorkaround.Type).jobsDict
else {
return false
}

let job = jobs.first { $0["Label"] as? String? == launcherId }

Expand All @@ -37,3 +37,15 @@ class LoginItemManager {
SMLoginItemSetEnabled(launcherId as CFString, enabled)
}
}

private protocol DeprecationWarningWorkaround {
static var jobsDict: [[String: AnyObject]]? { get }
}

extension LoginItemManager: DeprecationWarningWorkaround {
// Workaround to silence "'SMCopyAllJobDictionaries' was deprecated in OS X 10.10" warning
@available(*, deprecated)
static var jobsDict: [[String: AnyObject]]? {
SMCopyAllJobDictionaries(kSMDomainUserLaunchd)?.takeRetainedValue() as? [[String: AnyObject]]
}
}

0 comments on commit 508a2b8

Please sign in to comment.