mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
chore: rename SetDefaults:SaveSettings
This commit is contained in:
@@ -40,7 +40,7 @@ function FileManagerMenu:init()
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = _("You have unsaved default settings. Save them now?"),
|
||||
ok_callback = function()
|
||||
SetDefaults:SaveSettings()
|
||||
SetDefaults:saveSettings()
|
||||
end,
|
||||
})
|
||||
else
|
||||
|
||||
@@ -64,9 +64,9 @@ function SetDefaults:init()
|
||||
dimen = Screen:getSize(),
|
||||
}
|
||||
-- FIXME:
|
||||
-- in this use case (an input dialog is closed and the menu container is opened
|
||||
-- immediately) we need to set the full screen dirty because otherwise only
|
||||
-- the input dialog part of the screen is refreshed.
|
||||
-- in this use case (an input dialog is closed and the menu container is
|
||||
-- opened immediately) we need to set the full screen dirty because
|
||||
-- otherwise only the input dialog part of the screen is refreshed.
|
||||
menu_container.onShow = function()
|
||||
UIManager:setDirty(nil, "partial")
|
||||
end
|
||||
@@ -256,7 +256,7 @@ function SetDefaults:ConfirmSave()
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = _('Are you sure you want to save the settings to "defaults.persistent.lua"?'),
|
||||
ok_callback = function()
|
||||
self:SaveSettings()
|
||||
self:saveSettings()
|
||||
end,
|
||||
})
|
||||
end
|
||||
@@ -275,7 +275,7 @@ function SetDefaults:build_setting(j)
|
||||
end
|
||||
end
|
||||
|
||||
function SetDefaults:SaveSettings()
|
||||
function SetDefaults:saveSettings()
|
||||
self.results = {}
|
||||
local persisted_defaults = {}
|
||||
local file = io.open(persistent_filename, "r")
|
||||
|
||||
@@ -22,7 +22,7 @@ describe("defaults module", function()
|
||||
Defaults.changed[28] = true
|
||||
Defaults.changed[63] = true
|
||||
Defaults.changed[77] = true
|
||||
Defaults:SaveSettings()
|
||||
Defaults:saveSettings()
|
||||
assert.is_same(#Defaults.defaults_name, 77)
|
||||
assert.is_same(Defaults.defaults_name[28], 'DHINTCOUNT')
|
||||
assert.is_same(Defaults.defaults_name[77], 'SEARCH_TITLE')
|
||||
@@ -63,7 +63,7 @@ DTAP_ZONE_MENU = {
|
||||
h = 20.25,
|
||||
w = 20.75
|
||||
}
|
||||
Defaults:SaveSettings()
|
||||
Defaults:saveSettings()
|
||||
fd = io.open(persistent_filename)
|
||||
assert.Equals(
|
||||
[[-- For configuration changes that persists between updates
|
||||
@@ -109,7 +109,7 @@ DHINTCOUNT = 2
|
||||
Defaults:init()
|
||||
Defaults.changed[28] = true
|
||||
Defaults.defaults_value[28] = 1
|
||||
Defaults:SaveSettings()
|
||||
Defaults:saveSettings()
|
||||
fd = io.open(persistent_filename)
|
||||
assert.Equals(
|
||||
[[-- For configuration changes that persists between updates
|
||||
|
||||
Reference in New Issue
Block a user