Allow following links to local files (#4064)

Also use the new ReaderUI:switchDocument(new_file) when
already in ReaderUI in the other cases we switch document.
This commit is contained in:
poire-z
2018-07-11 18:05:30 +02:00
committed by GitHub
parent 665cb37308
commit 8c9fe9b589
4 changed files with 55 additions and 23 deletions

View File

@@ -395,14 +395,8 @@ function ReaderFont:buildFontsTestDocument()
UIManager:show(ConfirmBox:new{
text = T(_("Document created as:\n%1\n\nWould you like to read it now?"), fonts_test_path),
ok_callback = function()
-- close current ReaderUI in 1 sec, and create a new one
UIManager:scheduleIn(1.0, function()
local ReaderUI = require("apps/reader/readerui")
local reader = ReaderUI:_getRunningInstance()
if reader then
reader:onClose()
end
ReaderUI:showReader(fonts_test_path)
self.ui:switchDocument(fonts_test_path)
end)
end,
})