Merge remote-tracking branch 'upstream/master' into screen-saver

pull/1969/head
Zijie He 8 years ago
commit 0b59d501a6

@ -1 +1 @@
Subproject commit 8e39d61493257c05fe039f34fa1a6e3ae5f0eab6
Subproject commit 3ca13f3f2cb1f3267ce5c7fa309c29a345387f12

@ -363,7 +363,7 @@ function SetDefaults:SaveSettings()
end
file:close()
UIManager:show(InfoMessage:new{
text = _("Default settings were saved successfully!"),
text = _("Default settings saved."),
})
end
settings_changed = false

@ -27,8 +27,10 @@ end
function KindlePowerD:toggleFrontlight()
local sysint = self:read_int_file(self.fl_intensity_file)
if sysint == 0 then
self:setIntensity(self.fl_intensity)
-- NOTE: We want to bypass setIntensity's shenanigans and simply restore the light as-is
self:setIntensityHW()
else
-- NOTE: We want to really kill the light, so do it manually (asking lipc to set it to 0 would in fact set it to 1)...
os.execute("echo -n 0 > " .. self.fl_intensity_file)
end
end

@ -142,7 +142,7 @@ function OTAManager:fetchAndProcessUpdate()
),
ok_callback = function()
UIManager:show(InfoMessage:new{
text = _("Downloading may take several minutes..."),
text = _("Downloading may take several minutes"),
timeout = 3,
})
UIManager:scheduleIn(1, function()

@ -37,6 +37,30 @@ function FileChooser:init()
end
return true
end
self.list = function(path, dirs, files)
-- lfs.dir directory without permission will give error
local ok, iter, dir_obj = pcall(lfs.dir, path)
if ok then
for f in iter, dir_obj do
if self.show_hidden or not string.match(f, "^%.[^.]") then
local filename = path.."/"..f
local attributes = lfs.attributes(filename)
if attributes ~= nil then
if attributes.mode == "directory" and f ~= "." and f~=".." then
if self.dir_filter(filename) then
table.insert(dirs, {name = f, attr = attributes})
end
elseif attributes.mode == "file" then
if self.file_filter == nil or self.file_filter(filename) then
table.insert(files, {name = f, attr = attributes})
end
end
end
end
end
end
end
-- circumvent string collating in Kobo devices. See issue koreader/koreader#686
if Device:isKobo() then
self.strcoll = function(a, b) return a < b end
@ -49,27 +73,7 @@ function FileChooser:genItemTableFromPath(path)
local dirs = {}
local files = {}
-- lfs.dir directory without permission will give error
local ok, iter, dir_obj = pcall(lfs.dir, self.path)
if ok then
for f in iter, dir_obj do
if self.show_hidden or not string.match(f, "^%.[^.]") then
local filename = self.path.."/"..f
local attributes = lfs.attributes(filename)
if attributes ~= nil then
if attributes.mode == "directory" and f ~= "." and f~=".." then
if self.dir_filter(filename) then
table.insert(dirs, {name = f, attr = attributes})
end
elseif attributes.mode == "file" then
if self.file_filter(filename) then
table.insert(files, {name = f, attr = attributes})
end
end
end
end
end
end
self.list(path, dirs, files)
local sorting = nil
local reverse = self.reverse_collate
@ -99,19 +103,13 @@ function FileChooser:genItemTableFromPath(path)
local item_table = {}
for i, dir in ipairs(dirs) do
local dirs = {}
local files = {}
local subdir_path = self.path.."/"..dir.name
local items = 0
ok, iter, dir_obj = pcall(lfs.dir, subdir_path)
if ok then
for f in iter, dir_obj do
items = items + 1
end
-- exclude "." and ".."
items = items - 2
end
self.list(subdir_path, dirs, files)
local items = #dirs + #files
local istr = util.template(
items == 0 and _("0 items")
or items == 1 and _("1 item")
items == 1 and _("1 item")
or _("%1 items"), items)
table.insert(item_table, {
text = dir.name.."/",

@ -133,11 +133,11 @@ function OPDSBrowser:editCalibreServer()
{
-- TODO: get IP address of current device
text = calibre.host or "192.168.1.1",
hint = _("Calibre host"),
hint = _("calibre host"),
},
{
text = calibre.port and tostring(calibre.port) or "8080",
hint = _("Calibre port"),
hint = _("calibre port"),
},
},
buttons = {

@ -81,7 +81,7 @@ end
function CalibreCompanion:addToMainMenu(tab_item_table)
table.insert(tab_item_table.plugins, {
text = _("Calibre wireless connection"),
text = _("calibre wireless connection"),
sub_item_table = {
{
text_func = function()

@ -16,7 +16,7 @@ local MyClipping = require("clip")
local EvernoteExporter = InputContainer:new{
name = "evernote",
login_title = _("Login to Evernote"),
notebook_name = _("Koreader Notes"),
notebook_name = _("KOReader Notes"),
evernote_domain = nil,
notemarks = _("Note: "),
clipping_dir = DataStorage:getDataDir() .. "/clipboard",
@ -94,7 +94,7 @@ function EvernoteExporter:addToMainMenu(tab_item_table)
end)
UIManager:show(InfoMessage:new{
text = _("Exporting may take several seconds..."),
text = _("Exporting may take several seconds"),
timeout = 1,
})
end
@ -110,7 +110,7 @@ function EvernoteExporter:addToMainMenu(tab_item_table)
end)
UIManager:show(InfoMessage:new{
text = _("Exporting may take several minutes..."),
text = _("Exporting may take several minutes"),
timeout = 1,
})
end
@ -153,7 +153,7 @@ function EvernoteExporter:login()
end)
UIManager:show(InfoMessage:new{
text = _("Logging in. Please wait..."),
text = _("Logging in. Please wait"),
timeout = 1,
})
end,

@ -119,7 +119,7 @@ function KOSync:login()
end)
UIManager:show(InfoMessage:new{
text = _("Logging in. Please wait..."),
text = _("Logging in. Please wait"),
timeout = 1,
})
end,
@ -135,7 +135,7 @@ function KOSync:login()
end)
UIManager:show(InfoMessage:new{
text = _("Registering. Please wait..."),
text = _("Registering. Please wait"),
timeout = 1,
})
end,
@ -299,7 +299,7 @@ function KOSync:getProgress(manual)
})
elseif manual and body.progress == progress then
UIManager:show(InfoMessage:new{
text = _("We are already synchronized."),
text = _("Already synchronized."),
timeout = 3,
})
end

@ -117,7 +117,7 @@ end
-- restore kobo frontlight settings and probe kobo touch coordinates
if Device:isKobo() then
if Device.hasFrontlight then
if Device:hasFrontlight() then
local powerd = Device:getPowerDevice()
if powerd and powerd.restore_settings then
-- UIManager:init() should have sanely set up the frontlight_stuff by this point

Loading…
Cancel
Save