[UX] Gesture manager: add a little notification to the wifi on action (#4786)

Fixes #4783.

Perhaps this should be in NetworkManager instead.
This commit is contained in:
Frans de Jonge
2019-03-14 10:37:25 +01:00
committed by GitHub
parent fdf92e13ea
commit 930731d67c

View File

@@ -723,6 +723,11 @@ function ReaderGesture:gestureAction(action, ges)
local NetworkMgr = require("ui/network/manager")
if not NetworkMgr:isOnline() then
UIManager:show(InfoMessage:new{
text = _("Enabling wifi…"),
timeout = 1,
})
-- NB Normal widgets should use NetworkMgr:promptWifiOn()
-- This is specifically the toggle wifi action, so consent is implied.
NetworkMgr:turnOnWifi()
@@ -747,6 +752,11 @@ function ReaderGesture:gestureAction(action, ges)
local NetworkMgr = require("ui/network/manager")
if not NetworkMgr:isOnline() then
UIManager:show(InfoMessage:new{
text = _("Enabling wifi…"),
timeout = 1,
})
-- NB Normal widgets should use NetworkMgr:promptWifiOn()
-- This is specifically the toggle wifi action, so consent is implied.
NetworkMgr:turnOnWifi()