Merge pull request #1869 from koreader/houqp-master

fix double crash in readerui...
pull/1875/head
Huang Xin 8 years ago
commit 2fda2d0a2b

@ -341,7 +341,7 @@ function ReaderUI:showReader(file)
text = T( _("Opening file '%1'."), file), text = T( _("Opening file '%1'."), file),
timeout = 0.1, timeout = 0.1,
}) })
UIManager:scheduleIn(0.1, function() UIManager:nextTick(function()
DEBUG("creating coroutine for showing reader") DEBUG("creating coroutine for showing reader")
local co = coroutine.create(function() local co = coroutine.create(function()
self:doShowReader(file) self:doShowReader(file)
@ -350,7 +350,7 @@ function ReaderUI:showReader(file)
if err ~= nil or ok == false then if err ~= nil or ok == false then
print '[!] doShowReader coroutine crashed:' print '[!] doShowReader coroutine crashed:'
print(debug.traceback(co, err, 1)) print(debug.traceback(co, err, 1))
UIManager.quit() UIManager:quit()
end end
end) end)
end end

@ -130,9 +130,6 @@ end
function NickelConf.frontLightLevel.set(new_intensity) function NickelConf.frontLightLevel.set(new_intensity)
assert(new_intensity >= 0 and new_intensity <= 100, assert(new_intensity >= 0 and new_intensity <= 100,
"Wrong brightness value given!") "Wrong brightness value given!")
-- Make sure we're in sync with KOReader on the config level, too
G_reader_settings:saveSetting("frontlight_intensity",
new_intensity)
return NickelConf._write_kobo_conf(re_FrontLightLevel, return NickelConf._write_kobo_conf(re_FrontLightLevel,
front_light_level_str, front_light_level_str,
new_intensity) new_intensity)

@ -55,6 +55,8 @@ end
function KoboPowerD:setIntensityHW() function KoboPowerD:setIntensityHW()
if self.fl ~= nil then if self.fl ~= nil then
self.fl:setBrightness(self.fl_intensity) self.fl:setBrightness(self.fl_intensity)
-- Make sure we persist intensity config in reader setting
G_reader_settings:saveSetting("frontlight_intensity", self.fl_intensity)
if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL then if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL then
NickelConf.frontLightLevel.set(self.fl_intensity) NickelConf.frontLightLevel.set(self.fl_intensity)
end end

@ -107,12 +107,14 @@ function ReaderStatistics:updateSettings()
{ {
text = "", text = "",
input_type = "number", input_type = "number",
hint = _("Min seconds, default is 5"), hint = _(T("Min seconds, default is 5, current value: %1",
self.page_min_read_sec)),
}, },
{ {
text = "", text = "",
input_type = "number", input_type = "number",
hint = _("Max seconds, default is 90"), hint = _(T("Max seconds, default is 90, current value: %1",
self.page_max_read_sec)),
}, },
}, },
buttons = { buttons = {

Loading…
Cancel
Save