Dismiss Wi-Fi scan popup after connection (#4055)

* Add a config switch to automatically dismiss the WiFi scan popup on connect
This commit is contained in:
NiLuJe
2018-07-07 17:06:58 +02:00
committed by GitHub
parent 8b3432ae76
commit 75df3fcea3
6 changed files with 20 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ ifneq ($(or $(EMULATE_READER),$(WIN32)),)
cd $(INSTALL_DIR)/koreader/spec/front/unit && test -e data || \
ln -sf ../../test ./data
else
$(RCP) -fL $(KOR_BASE)/$(OUTPUT_DIR)/* $(INSTALL_DIR)/koreader/
$(RCP) -fL $(KOR_BASE)/$(OUTPUT_DIR)/. $(INSTALL_DIR)/koreader/.
endif
for f in $(INSTALL_FILES); do \
ln -sf ../../$$f $(INSTALL_DIR)/koreader/; \
@@ -82,12 +82,12 @@ ifdef WIN32
endif
@echo "[*] Install plugins"
@# TODO: link istead of cp?
$(RCP) plugins/* $(INSTALL_DIR)/koreader/plugins/
$(RCP) plugins/. $(INSTALL_DIR)/koreader/plugins/.
@# purge deleted plugins
for d in $$(ls $(INSTALL_DIR)/koreader/plugins); do \
test -d plugins/$$d || rm -rf $(INSTALL_DIR)/koreader/plugins/$$d ; done
@echo "[*] Installresources"
$(RCP) -pL resources/fonts/* $(INSTALL_DIR)/koreader/fonts/
$(RCP) -pL resources/fonts/. $(INSTALL_DIR)/koreader/fonts/.
install -d $(INSTALL_DIR)/koreader/{screenshots,data/{dict,tessdata},fonts/host,ota}
ifeq ($(or $(EMULATE_READER),$(WIN32)),)
@echo "[*] Clean up, remove unused files for releases"

2
base

Submodule base updated: cc70114629...cbbebcc43d

View File

@@ -39,6 +39,7 @@ local order = {
"network_restore",
"network_info",
"network_before_wifi_action",
"network_dismiss_scan",
"----------------------------",
"ssh",
},

View File

@@ -59,6 +59,7 @@ local order = {
"network_restore",
"network_info",
"network_before_wifi_action",
"network_dismiss_scan",
"----------------------------",
"ssh",
},

View File

@@ -244,12 +244,22 @@ function NetworkMgr:getBeforeWifiActionMenuTable()
}
end
function NetworkMgr:getDismissScanMenuTable()
return {
text = _("Dismiss Wi-Fi scan popup after connection"),
checked_func = function() return G_reader_settings:nilOrTrue("auto_dismiss_wifi_scan") end,
--enabled_func = function() return Device:isKobo() end,
callback = function(menu) G_reader_settings:flipNilOrTrue("auto_dismiss_wifi_scan") end,
}
end
function NetworkMgr:getMenuTable(common_settings)
common_settings.network_wifi = self:getWifiMenuTable()
common_settings.network_proxy = self:getProxyMenuTable()
common_settings.network_restore = self:getRestoreMenuTable()
common_settings.network_info = self:getInfoMenuTable()
common_settings.network_before_wifi_action = self:getBeforeWifiActionMenuTable()
common_settings.network_dismiss_scan = self:getDismissScanMenuTable()
end
function NetworkMgr:showNetworkMenu(complete_callback)

View File

@@ -384,7 +384,7 @@ function NetworkSetting:init()
local items = {}
table.sort(self.network_list,
function(l, r) return l.signal_quality > r.signal_quality end)
for idx,network in ipairs(self.network_list) do
for idx, network in ipairs(self.network_list) do
local bg
if idx % 2 == 0 then
bg = gray_bg
@@ -462,6 +462,9 @@ function NetworkSetting:init()
local connected_item = self:getConnectedItem()
if connected_item ~= nil then
obtainIP()
if G_reader_settings:nilOrTrue("auto_dismiss_wifi_scan") then
UIManager:close(self, 'ui', self.dimen)
end
UIManager:show(InfoMessage:new{
text = T(_("Connected to network %1"), connected_item.info.ssid)
})