From d1d955f3a4e088b10c9c0d0cb43fdabbd03571e7 Mon Sep 17 00:00:00 2001 From: Tigran Aivazian Date: Wed, 3 Oct 2012 20:29:34 +0100 Subject: [PATCH] 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. --- filesearcher.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/filesearcher.lua b/filesearcher.lua index 0c114e95d..d731f61db 100644 --- a/filesearcher.lua +++ b/filesearcher.lua @@ -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"