2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00

Merge pull request #2523 from Hzj-jie/master

swithItemTable -> switchItemTable
This commit is contained in:
Frans de Jonge 2017-02-02 09:06:38 +01:00 committed by GitHub
commit 187ef61821
18 changed files with 20 additions and 21 deletions

2
frontend/apps/cloudstorage/cloudstorage.lua Executable file → Normal file
View File

@ -107,7 +107,7 @@ function CloudStorage:openCloudServer(url)
tbl = Ftp:run(self.address, self.username, self.password, url)
end
if tbl and #tbl > 0 then
self:swithItemTable(url, tbl)
self:switchItemTable(url, tbl)
return true
elseif not tbl then
UIManager:show(InfoMessage:new{

0
frontend/apps/cloudstorage/dropbox.lua Executable file → Normal file
View File

0
frontend/apps/cloudstorage/dropboxapi.lua Executable file → Normal file
View File

0
frontend/apps/cloudstorage/ftp.lua Executable file → Normal file
View File

0
frontend/apps/cloudstorage/ftpapi.lua Executable file → Normal file
View File

0
frontend/apps/filemanager/filemanager.lua Executable file → Normal file
View File

View File

@ -152,7 +152,7 @@ function FileSearcher:showSearchResults()
UIManager:close(menu_container)
end
table.sort(self.results, function(v1,v2) return v1.text < v2.text end)
self.search_menu:swithItemTable(_("Search Results"), self.results)
self.search_menu:switchItemTable(_("Search Results"), self.results)
UIManager:show(menu_container)
end

View File

@ -30,7 +30,7 @@ function FileManagerHistory:addToMainMenu(tab_item_table)
end
function FileManagerHistory:updateItemTable()
self.hist_menu:swithItemTable(self.hist_menu_title,
self.hist_menu:switchItemTable(self.hist_menu_title,
require("readhistory").hist)
end

View File

@ -549,7 +549,7 @@ function Search:showresults()
end
end
table.sort(self.results, function(v1,v2) return v1.text < v2.text end)
self.search_menu:swithItemTable(_("Search Results"), self.results)
self.search_menu:switchItemTable(_("Search Results"), self.results)
UIManager:show(menu_container)
end
@ -665,7 +665,7 @@ function Search:browse(option, run, chosen)
table.sort(self.results, function(v1,v2) return v1.text < v2.text end)
self.search_menu:swithItemTable(menu_title, self.results)
self.search_menu:switchItemTable(menu_title, self.results)
UIManager:show(menu_container)
end

View File

@ -123,7 +123,7 @@ function SetDefaults:init()
self.changed[i] = true
self.results[i].text = self:build_setting(i)
self:close()
self.defaults_menu:swithItemTable("Defaults", self.results, i)
self.defaults_menu:switchItemTable("Defaults", self.results, i)
UIManager:show(menu_container)
end
},
@ -136,7 +136,7 @@ function SetDefaults:init()
self.settings_changed = true
self.changed[i] = true
self.results[i].text = self:build_setting(i)
self.defaults_menu:swithItemTable("Defaults", self.results, i)
self.defaults_menu:switchItemTable("Defaults", self.results, i)
self:close()
UIManager:show(menu_container)
end
@ -188,7 +188,7 @@ function SetDefaults:init()
self.results[i].text = self:build_setting(i)
self:close()
self.defaults_menu:swithItemTable("Defaults", self.results, i)
self.defaults_menu:switchItemTable("Defaults", self.results, i)
UIManager:show(menu_container)
end,
},
@ -227,7 +227,7 @@ function SetDefaults:init()
self.results[i].text = self:build_setting(i)
end
self:close()
self.defaults_menu:swithItemTable("Defaults", self.results, i)
self.defaults_menu:switchItemTable("Defaults", self.results, i)
UIManager:show(menu_container)
end,
},
@ -246,7 +246,7 @@ function SetDefaults:init()
})
end
end
self.defaults_menu:swithItemTable("Defaults", self.results)
self.defaults_menu:switchItemTable("Defaults", self.results)
UIManager:show(menu_container)
end

View File

@ -214,7 +214,7 @@ function ReaderBookmark:onShowBookmark()
text = _("Remove this bookmark"),
callback = function()
bookmark:removeBookmark(item)
bm_menu:swithItemTable(nil, bookmark.bookmarks, -1)
bm_menu:switchItemTable(nil, bookmark.bookmarks, -1)
UIManager:close(self.remove_bookmark_dialog)
end,
},

View File

@ -354,7 +354,7 @@ function ReaderToc:onShowToc()
-- auto expand the parent node of current page
self:expandParentNode(self:getTocIndexByPage(self.pageno))
-- auto goto page of the current toc entry
self.toc_menu:swithItemTable(nil, self.collapsed_toc, self.collapsed_toc.current or -1)
self.toc_menu:switchItemTable(nil, self.collapsed_toc, self.collapsed_toc.current or -1)
UIManager:show(menu_container)
@ -395,7 +395,7 @@ function ReaderToc:expandToc(index)
indent = self.toc_indent:rep(cur_depth-1),
}
self:updateCurrentNode()
self.toc_menu:swithItemTable(nil, self.collapsed_toc, -1)
self.toc_menu:switchItemTable(nil, self.collapsed_toc, -1)
end
-- collapse TOC node of index in raw toc table
@ -431,7 +431,7 @@ function ReaderToc:collapseToc(index)
indent = self.toc_indent:rep(cur_depth-1),
}
self:updateCurrentNode()
self.toc_menu:swithItemTable(nil, self.collapsed_toc, -1)
self.toc_menu:switchItemTable(nil, self.collapsed_toc, -1)
end
function ReaderToc:addToMainMenu(tab_item_table)

0
frontend/apps/reader/skimtowidget.lua Executable file → Normal file
View File

0
frontend/ui/widget/buttondialogtitle.lua Executable file → Normal file
View File

View File

@ -170,7 +170,7 @@ function FileChooser:updateItems(select_number)
end
function FileChooser:refreshPath()
self:swithItemTable(nil, self:genItemTableFromPath(self.path), self.path_items[self.path])
self:switchItemTable(nil, self:genItemTableFromPath(self.path), self.path_items[self.path])
end
function FileChooser:changeToPath(path)

View File

@ -699,7 +699,6 @@ function Menu:updateItems(select_number)
end
--[[
May be a typo of switchItemTable?
the itemnumber paramter determines menu page number after switching item table
1. itemnumber >= 0
the page number is calculated with items per page
@ -709,7 +708,7 @@ end
the page number is not changed, used when item_table is appended with
new entries
--]]
function Menu:swithItemTable(new_title, new_item_table, itemnumber)
function Menu:switchItemTable(new_title, new_item_table, itemnumber)
if self.menu_title and new_title then
self.menu_title.text = new_title
end
@ -774,7 +773,7 @@ function Menu:onMenuSelect(item)
-- save menu title for later resume
self.item_table.title = self.title
table.insert(self.item_table_stack, self.item_table)
self:swithItemTable(item.text, item.sub_item_table)
self:switchItemTable(item.text, item.sub_item_table)
end
return true
end
@ -862,7 +861,7 @@ function Menu:onClose()
else
-- back to parent menu
local parent_item_table = table.remove(self.item_table_stack, table_length)
self:swithItemTable(parent_item_table.title, parent_item_table)
self:switchItemTable(parent_item_table.title, parent_item_table)
end
return true
end

View File

@ -464,7 +464,7 @@ end
function OPDSBrowser:updateCatalog(item_table_url)
local menu_table = self:genItemTableFromURL(item_table_url)
if #menu_table > 0 then
self:swithItemTable(nil, menu_table)
self:switchItemTable(nil, menu_table)
if self.page_num <= 1 then
self:onNext()
end
@ -478,7 +478,7 @@ function OPDSBrowser:appendCatalog(item_table_url)
table.insert(self.item_table, item)
end
self.item_table.hrefs = new_table.hrefs
self:swithItemTable(nil, self.item_table, -1)
self:switchItemTable(nil, self.item_table, -1)
return true
end

0
frontend/util.lua Executable file → Normal file
View File