mirror of
https://github.com/koreader/koreader
synced 2024-11-16 06:12:56 +00:00
Go back to series/tags list after enter a series/tag
Todo: Go back to the actual page
This commit is contained in:
parent
05abbbdff9
commit
5201f59451
@ -227,6 +227,9 @@ function Search:ShowSearch()
|
|||||||
callback = function()
|
callback = function()
|
||||||
self.search_dialog:onClose()
|
self.search_dialog:onClose()
|
||||||
UIManager:close(self.search_dialog)
|
UIManager:close(self.search_dialog)
|
||||||
|
--self.use_previous_search_results = true
|
||||||
|
--self.lastsearch = "tags"
|
||||||
|
self:close()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -257,6 +260,7 @@ function Search:ShowSearch()
|
|||||||
UIManager:show(InfoMessage:new{text = self.error .. _( " A search for a " .. calibre .. " file was not successful!"),})
|
UIManager:show(InfoMessage:new{text = self.error .. _( " A search for a " .. calibre .. " file was not successful!"),})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Search:init()
|
function Search:init()
|
||||||
@ -266,11 +270,13 @@ function Search:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Search:close()
|
function Search:close()
|
||||||
|
if self.search_value then
|
||||||
self.search_dialog:onClose()
|
self.search_dialog:onClose()
|
||||||
UIManager:close(self.search_dialog)
|
UIManager:close(self.search_dialog)
|
||||||
if string.len(self.search_value) > 0 or self.lastsearch ~= "find" then
|
if string.len(self.search_value) > 0 or self.lastsearch ~= "find" then
|
||||||
self:find(self.lastsearch)
|
self:find(self.lastsearch)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Search:find(option)
|
function Search:find(option)
|
||||||
@ -494,10 +500,8 @@ function Search:showresults()
|
|||||||
path = libpath .. self.data[i][self.path],
|
path = libpath .. self.data[i][self.path],
|
||||||
text = self.data[i][self.authors] .. ": " .. self.data[i][self.title],
|
text = self.data[i][self.authors] .. ": " .. self.data[i][self.title],
|
||||||
callback = function()
|
callback = function()
|
||||||
if book then
|
|
||||||
showReaderUI(book)
|
showReaderUI(book)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
})
|
})
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
@ -508,6 +512,7 @@ function Search:showresults()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Search:browse(option,run,chosen)
|
function Search:browse(option,run,chosen)
|
||||||
|
local restart_me = false
|
||||||
local menu_container = CenterContainer:new{
|
local menu_container = CenterContainer:new{
|
||||||
dimen = Screen:getSize(),
|
dimen = Screen:getSize(),
|
||||||
}
|
}
|
||||||
@ -520,8 +525,17 @@ function Search:browse(option,run,chosen)
|
|||||||
_manager = self,
|
_manager = self,
|
||||||
}
|
}
|
||||||
table.insert(menu_container, self.search_menu)
|
table.insert(menu_container, self.search_menu)
|
||||||
|
|
||||||
self.search_menu.close_callback = function()
|
self.search_menu.close_callback = function()
|
||||||
UIManager:close(menu_container)
|
UIManager:close(menu_container)
|
||||||
|
if restart_me then
|
||||||
|
if string.len(self.search_value) > 0 or self.lastsearch ~= "find" then
|
||||||
|
self.use_previous_search_results = true
|
||||||
|
self:getCalibre(1)
|
||||||
|
self:find(self.lastsearch)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
local upsearch
|
local upsearch
|
||||||
local dummy
|
local dummy
|
||||||
@ -561,6 +575,7 @@ function Search:browse(option,run,chosen)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
restart_me = true
|
||||||
self.results = {}
|
self.results = {}
|
||||||
local i = 1
|
local i = 1
|
||||||
while i <= self.count do
|
while i <= self.count do
|
||||||
@ -592,10 +607,8 @@ function Search:browse(option,run,chosen)
|
|||||||
notchecked = true,
|
notchecked = true,
|
||||||
path = libpath .. self.data[i][self.path],
|
path = libpath .. self.data[i][self.path],
|
||||||
callback = function()
|
callback = function()
|
||||||
if book then
|
|
||||||
showReaderUI(book)
|
showReaderUI(book)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user