NewsDownloader: wifi off prompt after download (#3395)

pull/3443/head
mwoz123 7 years ago committed by Frans de Jonge
parent a01271b8a6
commit c2bed639e3

@ -19,6 +19,7 @@ local T = FFIUtil.template
local NewsDownloader = WidgetContainer:new{}
local initialized = false
local wifi_enabled_before_action = true
local feed_config_file = "feed_config.lua"
local news_downloader_config_file = "news_downloader_settings.lua"
local config_key_custom_dl_dir = "custom_dl_dir";
@ -54,6 +55,13 @@ local function getFeedLink(possible_link)
end
end
-- TODO: implement as NetworkMgr:afterWifiAction with configuration options
function NewsDownloader:afterWifiAction()
if not wifi_enabled_before_action then
NetworkMgr:promptWifiOff()
end
end
function NewsDownloader:init()
self.ui.menu:registerToMainMenu(self)
end
@ -136,6 +144,7 @@ end
function NewsDownloader:loadConfigAndProcessFeeds()
if not NetworkMgr:isOnline() then
wifi_enabled_before_action = false
NetworkMgr:promptWifiOn()
return
end
@ -191,6 +200,7 @@ function NewsDownloader:loadConfigAndProcessFeeds()
text = T(_("Downloading news finished. Could not process some feeds. Unsupported format in: %1"), unsupported_urls)
})
end
NewsDownloader:afterWifiAction()
end
function NewsDownloader:processFeedSource(url, limit, unsupported_feeds_urls, download_full_article)

Loading…
Cancel
Save