mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Implement workarounds for/from #4387 to better handle WiFi menu
corner-cases on some Kobo devices Fix #4387
This commit is contained in:
@@ -124,7 +124,7 @@ function NetworkMgr:getWifiMenuTable()
|
||||
enabled_func = function() return Device:isAndroid() or Device:isCervantes() or Device:isKindle() or Device:isKobo() or Device:isSonyPRSTUX() end,
|
||||
checked_func = function() return NetworkMgr:isWifiOn() end,
|
||||
callback = function(touchmenu_instance)
|
||||
local wifi_status = NetworkMgr:isWifiOn()
|
||||
local wifi_status = NetworkMgr:isWifiOn() and NetworkMgr:isConnected()
|
||||
local complete_callback = function()
|
||||
-- notify touch menu to update item check state
|
||||
touchmenu_instance:updateItems()
|
||||
@@ -273,6 +273,16 @@ function NetworkMgr:showNetworkMenu(complete_callback)
|
||||
UIManager:show(InfoMessage:new{text = err})
|
||||
return
|
||||
end
|
||||
-- NOTE: Fairly hackish workaround for #4387,
|
||||
-- rescan if the first scan appeared to yield an empty list.
|
||||
-- FIXME: This *might* be an issue better handled in lj-wpaclient...
|
||||
if (table.getn(network_list) == 0) then
|
||||
network_list, err = self:getNetworkList()
|
||||
if network_list == nil then
|
||||
UIManager:show(InfoMessage:new{text = err})
|
||||
return
|
||||
end
|
||||
end
|
||||
UIManager:show(require("ui/widget/networksetting"):new{
|
||||
network_list = network_list,
|
||||
connect_callback = complete_callback,
|
||||
|
||||
Reference in New Issue
Block a user