mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user