mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add reminder to save unsaved settings
This commit is contained in:
@@ -34,8 +34,18 @@ function FileManagerMenu:init()
|
||||
home = {
|
||||
icon = "resources/icons/appbar.home.png",
|
||||
callback = function()
|
||||
UIManager:close(self.menu_container)
|
||||
self.ui:onClose()
|
||||
if settings_changed then
|
||||
settings_changed = false
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = _("You have unsaved default settings. Save them now?"),
|
||||
ok_callback = function()
|
||||
SetDefaults:SaveSettings()
|
||||
end,
|
||||
})
|
||||
else
|
||||
UIManager:close(self.menu_container)
|
||||
self.ui:onClose()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -143,6 +153,14 @@ function FileManagerMenu:setUpdateItemTable()
|
||||
Search:init()
|
||||
end
|
||||
})
|
||||
-- home tab
|
||||
table.insert(self.tab_item_table.home, {
|
||||
text = _("Exit"),
|
||||
callback = function()
|
||||
UIManager:close(self.menu_container)
|
||||
self.ui:onClose()
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
function FileManagerMenu:onShowMenu()
|
||||
|
||||
Reference in New Issue
Block a user