mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Ask for connection when clicking on TimeSync while offline
This commit is contained in:
committed by
Frans de Jonge
parent
1ed0ce0c21
commit
21f6c7dcc6
@@ -16,6 +16,7 @@ local UIManager = require("ui/uimanager")
|
||||
local WidgetContainer = require("ui/widget/container/widgetcontainer")
|
||||
local T = require("ffi/util").template
|
||||
local _ = require("gettext")
|
||||
local NetworkMgr = require("ui/network/manager")
|
||||
|
||||
local TimeSync = WidgetContainer:new{
|
||||
name = "timesync",
|
||||
@@ -56,7 +57,13 @@ end
|
||||
|
||||
local menuItem = {
|
||||
text = _("Synchronize time"),
|
||||
callback = execute,
|
||||
callback = function()
|
||||
if NetworkMgr:isOnline() then
|
||||
execute()
|
||||
else
|
||||
NetworkMgr:promptWifiOn()
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
function TimeSync:init()
|
||||
|
||||
Reference in New Issue
Block a user