|
|
|
@ -265,7 +265,8 @@ end
|
|
|
|
|
|
|
|
|
|
function NetworkItem:saveAndConnectToNetwork(password_input)
|
|
|
|
|
local new_passwd = password_input:getInputText()
|
|
|
|
|
if new_passwd == nil or string.len(new_passwd) == 0 then
|
|
|
|
|
-- Dont set a empty password if WPA encryption, go through if it’s an open AP
|
|
|
|
|
if (new_passwd == nil or string.len(new_passwd) == 0) and string.find(self.info.flags, "WPA") then
|
|
|
|
|
UIManager:show(InfoMessage:new{
|
|
|
|
|
text = _("Password cannot be empty."),
|
|
|
|
|
})
|
|
|
|
@ -286,7 +287,7 @@ function NetworkItem:onEditNetwork()
|
|
|
|
|
password_input = InputDialog:new{
|
|
|
|
|
title = self.info.ssid,
|
|
|
|
|
input = self.info.password,
|
|
|
|
|
input_hint = "password",
|
|
|
|
|
input_hint = _("password (leave empty if open network)"),
|
|
|
|
|
input_type = "text",
|
|
|
|
|
text_type = "password",
|
|
|
|
|
buttons = {
|
|
|
|
@ -328,7 +329,7 @@ function NetworkItem:onAddNetwork()
|
|
|
|
|
password_input = InputDialog:new{
|
|
|
|
|
title = self.info.ssid,
|
|
|
|
|
input = "",
|
|
|
|
|
input_hint = "password",
|
|
|
|
|
input_hint = _("password (leave empty if open network)"),
|
|
|
|
|
input_type = "text",
|
|
|
|
|
text_type = "password",
|
|
|
|
|
buttons = {
|
|
|
|
@ -355,9 +356,11 @@ function NetworkItem:onAddNetwork()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function NetworkItem:onTapSelect(arg, ges_ev)
|
|
|
|
|
if not string.find(self.info.flags, "WPA") then
|
|
|
|
|
-- Open AP dont have specific flag so we can’t include them alongside WPA
|
|
|
|
|
-- so we exclude WEP instead (more encryption to exclude? not really future proof)
|
|
|
|
|
if string.find(self.info.flags, "WEP") then
|
|
|
|
|
UIManager:show(InfoMessage:new{
|
|
|
|
|
text = _("Networks without WPA/WPA2 encryption are not supported.")
|
|
|
|
|
text = _("Networks with WEP encryption are not supported.")
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|