mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Show the program version in the Help header.
1. On startup read the file git-rev if exists and initialize a new global G_program_version. 2. In filechooser's help page's header show the version. This helps to easily identify what version the user is running without asking him to cat git-rev file manually.
This commit is contained in:
@@ -498,7 +498,8 @@ function FileChooser:addAllCommands()
|
||||
self.commands:add(KEY_H,nil,"H",
|
||||
"show help page",
|
||||
function(self)
|
||||
HelpPage:show(0, G_height, self.commands)
|
||||
local title="Hotkeys "..G_program_version
|
||||
HelpPage:show(0, G_height, self.commands, title)
|
||||
self.pagedirty = true
|
||||
end
|
||||
)
|
||||
|
||||
@@ -99,6 +99,15 @@ if optarg["G"] ~= nil then
|
||||
globalgamma = optarg["G"]
|
||||
end
|
||||
|
||||
local vfile = io.open("git-rev", "r")
|
||||
if vfile then
|
||||
G_program_version = vfile:read("*a") or "?"
|
||||
G_program_version = G_program_version:gsub("[\n\r]+", "")
|
||||
vfile.close()
|
||||
else
|
||||
G_program_version = "(unknown version)"
|
||||
end
|
||||
|
||||
if util.isEmulated()==1 then
|
||||
input.open("")
|
||||
-- SDL key codes
|
||||
|
||||
Reference in New Issue
Block a user