2014-11-21 14:41:14 +00:00
|
|
|
local Device = require("device")
|
|
|
|
local Language = require("ui/language")
|
2016-06-26 00:53:08 +00:00
|
|
|
local NetworkMgr = require("ui/network/manager")
|
2014-11-21 14:41:14 +00:00
|
|
|
local UIManager = require("ui/uimanager")
|
|
|
|
local Screen = require("device").screen
|
|
|
|
local _ = require("gettext")
|
|
|
|
|
|
|
|
local common_settings = {}
|
|
|
|
|
|
|
|
if Device:hasFrontlight() then
|
|
|
|
local ReaderFrontLight = require("apps/reader/modules/readerfrontlight")
|
2017-03-03 06:41:10 +00:00
|
|
|
common_settings.frontlight = {
|
2014-11-21 14:41:14 +00:00
|
|
|
text = _("Frontlight"),
|
|
|
|
callback = function()
|
|
|
|
ReaderFrontLight:onShowFlDialog()
|
|
|
|
end,
|
2017-02-28 21:46:32 +00:00
|
|
|
}
|
2014-11-21 14:41:14 +00:00
|
|
|
end
|
2014-11-28 18:53:48 +00:00
|
|
|
|
2017-03-03 06:41:10 +00:00
|
|
|
common_settings.night_mode = {
|
2014-11-21 14:41:14 +00:00
|
|
|
text = _("Night mode"),
|
|
|
|
checked_func = function() return G_reader_settings:readSetting("night_mode") end,
|
|
|
|
callback = function()
|
|
|
|
local night_mode = G_reader_settings:readSetting("night_mode") or false
|
|
|
|
Screen:toggleNightMode()
|
2015-02-01 15:21:34 +00:00
|
|
|
UIManager:setDirty(nil, "full")
|
2014-11-21 14:41:14 +00:00
|
|
|
G_reader_settings:saveSetting("night_mode", not night_mode)
|
|
|
|
end
|
2017-02-28 21:46:32 +00:00
|
|
|
}
|
2017-03-03 06:41:10 +00:00
|
|
|
common_settings.network = {
|
2014-11-21 14:41:14 +00:00
|
|
|
text = _("Network"),
|
2016-09-01 07:05:40 +00:00
|
|
|
sub_item_table = NetworkMgr:getMenuTable()
|
2017-02-28 21:46:32 +00:00
|
|
|
}
|
2017-03-03 06:41:10 +00:00
|
|
|
common_settings.screen = {
|
2014-11-21 14:41:14 +00:00
|
|
|
text = _("Screen"),
|
|
|
|
sub_item_table = {
|
|
|
|
require("ui/elements/screen_dpi_menu_table"),
|
|
|
|
require("ui/elements/screen_eink_opt_menu_table"),
|
2016-06-27 15:00:49 +00:00
|
|
|
require("ui/elements/screen_disable_double_tap_table"),
|
2014-11-28 18:53:48 +00:00
|
|
|
require("ui/elements/refresh_menu_table"),
|
2017-08-04 12:01:06 +00:00
|
|
|
require("ui/elements/flash_keyboard"),
|
2017-08-08 16:20:46 +00:00
|
|
|
require("ui/elements/menu_activate"),
|
2014-11-21 14:41:14 +00:00
|
|
|
},
|
2017-02-28 21:46:32 +00:00
|
|
|
}
|
2017-03-03 06:41:10 +00:00
|
|
|
common_settings.save_document = {
|
2017-01-16 22:05:59 +00:00
|
|
|
text = _("Save document"),
|
2016-07-14 17:38:00 +00:00
|
|
|
sub_item_table = {
|
|
|
|
{
|
|
|
|
text = _("Prompt"),
|
|
|
|
checked_func = function()
|
|
|
|
local setting = G_reader_settings:readSetting("save_document")
|
|
|
|
return setting == "prompt" or setting == nil
|
|
|
|
end,
|
|
|
|
callback = function()
|
|
|
|
G_reader_settings:delSetting("save_document")
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text = _("Always"),
|
|
|
|
checked_func = function()
|
|
|
|
return G_reader_settings:readSetting("save_document")
|
|
|
|
== "always"
|
|
|
|
end,
|
|
|
|
callback = function()
|
|
|
|
G_reader_settings:saveSetting("save_document", "always")
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text = _("Disable"),
|
|
|
|
checked_func = function()
|
|
|
|
return G_reader_settings:readSetting("save_document")
|
|
|
|
== "disable"
|
|
|
|
end,
|
|
|
|
callback = function()
|
|
|
|
G_reader_settings:saveSetting("save_document", "disable")
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
2017-02-28 21:46:32 +00:00
|
|
|
}
|
2017-03-03 06:41:10 +00:00
|
|
|
common_settings.language = Language:getLangMenuTable()
|
2014-11-21 14:41:14 +00:00
|
|
|
|
|
|
|
return common_settings
|