mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #838 from WS64/master
refactoring: remove global variable GLOBAL_INPUT_VALUE
This commit is contained in:
@@ -200,10 +200,10 @@ end
|
||||
|
||||
function Search:ShowSearch()
|
||||
if self.metafile_1 ~= nil then
|
||||
GLOBAL_INPUT_VALUE = self.search_value
|
||||
local dummy = GLOBAL_INPUT_VALUE
|
||||
local dummy = self.search_value
|
||||
self.search_dialog = InputDialog:new{
|
||||
title = _("Search Books"),
|
||||
input = self.search_value,
|
||||
buttons = {
|
||||
{
|
||||
{
|
||||
@@ -263,8 +263,6 @@ function Search:ShowSearch()
|
||||
width = Screen:getWidth() * 0.8,
|
||||
height = Screen:getHeight() * 0.2,
|
||||
}
|
||||
|
||||
GLOBAL_INPUT_VALUE = nil
|
||||
self.search_dialog:onShowKeyboard()
|
||||
UIManager:show(self.search_dialog)
|
||||
else
|
||||
@@ -543,8 +541,7 @@ function Search:onMenuHold(item)
|
||||
item.notchecked = false
|
||||
end
|
||||
local thumbwidth = math.min(240, Screen:getWidth()/3)
|
||||
local thumbheight = thumbwidth/2*3
|
||||
UIManager:show(InfoMessage:new{text = item.info,image = UIToolbox:getPicture(item.path), image_width = thumbwidth,image_height = thumbheight})
|
||||
UIManager:show(InfoMessage:new{text = item.info,image = UIToolbox:getPicture(item.path), image_width = thumbwidth,image_height = thumbwidth/2*3})
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -109,7 +109,7 @@ function SetDefaults:init()
|
||||
if not self.already_read then
|
||||
local i = 0
|
||||
for n,v in orderedPairs(_G) do
|
||||
if (not string.find(tostring(v), "<")) and (not string.find(tostring(v), ": ")) and string.sub(n,1,1) ~= "_" and string.upper(n) == n and n ~= "GLOBAL_INPUT_VALUE" and n ~= "LIBRARY_PATH" then
|
||||
if (not string.find(tostring(v), "<")) and (not string.find(tostring(v), ": ")) and string.sub(n,1,1) ~= "_" and string.upper(n) == n and n ~= "LIBRARY_PATH" then
|
||||
i = i + 1
|
||||
self.defaults_name[i] = n
|
||||
self.defaults_value[i] = v
|
||||
@@ -146,9 +146,9 @@ function SetDefaults:init()
|
||||
table.insert(self.results, {
|
||||
text = self:build_setting(i),
|
||||
callback = function()
|
||||
GLOBAL_INPUT_VALUE = tostring(self.defaults_value[i])
|
||||
self.set_dialog = InputDialog:new{
|
||||
title = self.defaults_name[i] .. ":",
|
||||
input = tostring(self.defaults_value[i]),
|
||||
buttons = {
|
||||
{
|
||||
{
|
||||
@@ -193,7 +193,6 @@ function SetDefaults:init()
|
||||
width = Screen:getWidth() * 0.95,
|
||||
height = Screen:getHeight() * 0.2,
|
||||
}
|
||||
GLOBAL_INPUT_VALUE = nil
|
||||
self.set_dialog:onShowKeyboard()
|
||||
UIManager:show(self.set_dialog)
|
||||
end
|
||||
@@ -202,9 +201,9 @@ function SetDefaults:init()
|
||||
table.insert(self.results, {
|
||||
text = self:build_setting(i),
|
||||
callback = function()
|
||||
GLOBAL_INPUT_VALUE = tostring(self.defaults_value[i])
|
||||
self.set_dialog = InputDialog:new{
|
||||
title = self.defaults_name[i] .. ":",
|
||||
input = tostring(self.defaults_value[i]),
|
||||
buttons = {
|
||||
{
|
||||
{
|
||||
@@ -239,7 +238,6 @@ function SetDefaults:init()
|
||||
width = Screen:getWidth() * 0.95,
|
||||
height = Screen:getHeight() * 0.2,
|
||||
}
|
||||
GLOBAL_INPUT_VALUE = nil
|
||||
self.set_dialog:onShowKeyboard()
|
||||
UIManager:show(self.set_dialog)
|
||||
end
|
||||
|
||||
@@ -203,11 +203,6 @@ function VirtualKeyboard:init()
|
||||
}
|
||||
}
|
||||
self:initLayout(self.layout)
|
||||
if GLOBAL_INPUT_VALUE then
|
||||
for i = 1, string.len(GLOBAL_INPUT_VALUE) do
|
||||
self:addChar(string.sub(GLOBAL_INPUT_VALUE,i,i))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function VirtualKeyboard:initLayout(layout)
|
||||
|
||||
Reference in New Issue
Block a user