From cf70e8655234d3ddd820fcf39ba5a2d30dc1ddac Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Wed, 2 Mar 2016 23:25:39 -0800 Subject: [PATCH 1/4] kobo: move reader setting outside of nicke_conf module --- frontend/device/kobo/nickel_conf.lua | 3 --- frontend/device/kobo/powerd.lua | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/device/kobo/nickel_conf.lua b/frontend/device/kobo/nickel_conf.lua index bfdb23334..2cfcceb05 100644 --- a/frontend/device/kobo/nickel_conf.lua +++ b/frontend/device/kobo/nickel_conf.lua @@ -130,9 +130,6 @@ end function NickelConf.frontLightLevel.set(new_intensity) assert(new_intensity >= 0 and new_intensity <= 100, "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, front_light_level_str, new_intensity) diff --git a/frontend/device/kobo/powerd.lua b/frontend/device/kobo/powerd.lua index 1a2f311b2..60e4a7ed8 100644 --- a/frontend/device/kobo/powerd.lua +++ b/frontend/device/kobo/powerd.lua @@ -55,6 +55,8 @@ end function KoboPowerD:setIntensityHW() if self.fl ~= nil then self.fl:setBrightness(self.fl_intensity) + -- Make sure we persist intensity config in reader setting + G_reader_settings:saveSetting("frontlight_intensity", new_intensity) if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL then NickelConf.frontLightLevel.set(self.fl_intensity) end From 5e8c5243c433a73a7ee4cdc93409db54fd2d1ae5 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sat, 5 Mar 2016 12:37:45 -0800 Subject: [PATCH 2/4] uimanager: fix crash on crash.... --- frontend/apps/reader/readerui.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/apps/reader/readerui.lua b/frontend/apps/reader/readerui.lua index aab1408b5..dc3f82dcb 100644 --- a/frontend/apps/reader/readerui.lua +++ b/frontend/apps/reader/readerui.lua @@ -341,7 +341,7 @@ function ReaderUI:showReader(file) text = T( _("Opening file '%1'."), file), timeout = 0.1, }) - UIManager:scheduleIn(0.1, function() + UIManager:nextTick(function() DEBUG("creating coroutine for showing reader") local co = coroutine.create(function() self:doShowReader(file) @@ -350,7 +350,7 @@ function ReaderUI:showReader(file) if err ~= nil or ok == false then print '[!] doShowReader coroutine crashed:' print(debug.traceback(co, err, 1)) - UIManager.quit() + UIManager:quit() end end) end From 7a22282dbe63337fedad4d8d15adf0dc1e095bad Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sat, 5 Mar 2016 12:59:32 -0800 Subject: [PATCH 3/4] statistics: show current value in setting --- plugins/statistics.koplugin/main.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index 962782a16..c65ed0320 100755 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -107,12 +107,14 @@ function ReaderStatistics:updateSettings() { text = "", 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 = "", 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 = { From e812f7d0d653db438af38d8e994685f04909fafe Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sat, 5 Mar 2016 13:02:19 -0800 Subject: [PATCH 4/4] kobo: fix typo during refactoring, luacheck is the best check --- frontend/device/kobo/powerd.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/device/kobo/powerd.lua b/frontend/device/kobo/powerd.lua index 60e4a7ed8..d52a7874a 100644 --- a/frontend/device/kobo/powerd.lua +++ b/frontend/device/kobo/powerd.lua @@ -56,7 +56,7 @@ function KoboPowerD:setIntensityHW() if self.fl ~= nil then self.fl:setBrightness(self.fl_intensity) -- Make sure we persist intensity config in reader setting - G_reader_settings:saveSetting("frontlight_intensity", new_intensity) + G_reader_settings:saveSetting("frontlight_intensity", self.fl_intensity) if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL then NickelConf.frontLightLevel.set(self.fl_intensity) end