add document language option in config dialog

Document language setting is used for better text extraction and OCR.
This commit is contained in:
chrox
2013-07-20 02:46:51 +08:00
parent 167e6ca0aa
commit 1808c7e5c3
7 changed files with 51 additions and 9 deletions

View File

@@ -6,7 +6,8 @@ function Configurable:hash(sep)
local hash = ""
local excluded = {multi_threads = true,}
for key,value in pairs(self) do
if type(value) == "number" and not excluded[key] then
if type(value) == "number" or type(value) == "string"
and not excluded[key] then
hash = hash..sep..value
end
end
@@ -28,8 +29,9 @@ end
function Configurable:loadSettings(settings, prefix)
for key,value in pairs(self) do
if type(value) == "number" or type(value) == "table" then
saved_value = settings:readSetting(prefix..key)
if type(value) == "number" or type(value) == "string"
or type(value) == "table" then
local saved_value = settings:readSetting(prefix..key)
self[key] = (saved_value == nil) and self[key] or saved_value
--Debug("Configurable:loadSettings", "key", key, "saved value", saved_value,"Configurable.key", self[key])
end
@@ -39,7 +41,8 @@ end
function Configurable:saveSettings(settings, prefix)
for key,value in pairs(self) do
if type(value) == "number" or type(value) == "table" then
if type(value) == "number" or type(value) == "string"
or type(value) == "table" then
settings:saveSetting(prefix..key, value)
end
end