|
|
@ -1010,7 +1010,7 @@ function TouchMenu:search(search_for)
|
|
|
|
local next_text = text and (text .. "\n" .. indent .. entry_text) or (indent .. entry_text)
|
|
|
|
local next_text = text and (text .. "\n" .. indent .. entry_text) or (indent .. entry_text)
|
|
|
|
local next_path = path .. "." .. i
|
|
|
|
local next_path = path .. "." .. i
|
|
|
|
recurse(val[i], next_path, next_text, icon, depth)
|
|
|
|
recurse(val[i], next_path, next_text, icon, depth)
|
|
|
|
if Utf8Proc.lowercase(entry_text):find(search_for) then
|
|
|
|
if Utf8Proc.lowercase(entry_text):find(search_for, 1, true) then
|
|
|
|
table.insert(found_menu_items, {entry_text, icon, next_path, next_text})
|
|
|
|
table.insert(found_menu_items, {entry_text, icon, next_path, next_text})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -1319,18 +1319,10 @@ function TouchMenu:onShowMenuSearch()
|
|
|
|
text = _("Search"),
|
|
|
|
text = _("Search"),
|
|
|
|
callback = function()
|
|
|
|
callback = function()
|
|
|
|
local search_for = search_dialog:getInputText()
|
|
|
|
local search_for = search_dialog:getInputText()
|
|
|
|
local status, err = pcall( function() ("test_string"):find(search_for) end)
|
|
|
|
search_for = Utf8Proc.lowercase(search_for)
|
|
|
|
if status then
|
|
|
|
G_reader_settings:saveSetting("menu_search_string", search_for)
|
|
|
|
search_for = Utf8Proc.lowercase(search_for)
|
|
|
|
UIManager:close(search_dialog)
|
|
|
|
G_reader_settings:saveSetting("menu_search_string", search_for)
|
|
|
|
show_search_results(search_for)
|
|
|
|
UIManager:close(search_dialog)
|
|
|
|
|
|
|
|
show_search_results(search_for)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
err = err:sub(err:find("lua") + 10) -- 10 = strlen("lua:1165: ")
|
|
|
|
|
|
|
|
UIManager:show(InfoMessage:new{
|
|
|
|
|
|
|
|
text = T(_("Malformed message:\n%1"), err)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|