mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Make only Back (not Home) return from Search Results.
It is best to restrict Home to only exit from the application (or perhaps also for closing the document, though even this is doubtful) and not use it in any other context, because otherwise pressing Home too many times may inadvertently exit the application and annoy the user. It is a bad practice to let user try various keys in different contexts and hope that one of them may work.
This commit is contained in:
@@ -76,11 +76,7 @@ function FileSearcher:setSearchResult(keywords)
|
||||
end
|
||||
|
||||
function FileSearcher:init(search_path)
|
||||
if search_path then
|
||||
self:setPath(search_path)
|
||||
else
|
||||
self:setPath("/mnt/us/documents")
|
||||
end
|
||||
self:setPath(search_path or "/mnt/us/documents")
|
||||
self:addAllCommands()
|
||||
end
|
||||
|
||||
@@ -245,7 +241,7 @@ function FileSearcher:addAllCommands()
|
||||
self.pagedirty = true
|
||||
end
|
||||
)
|
||||
self.commands:add({KEY_BACK, KEY_HOME}, nil, "Back",
|
||||
self.commands:add(KEY_BACK, nil, "Back",
|
||||
"back",
|
||||
function(self)
|
||||
return "break"
|
||||
|
||||
Reference in New Issue
Block a user