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

Merge pull request #548 from tigran123/batopt

Allow anyone to set event notifications.
This commit is contained in:
{Qingping,Dave} Hou 2012-11-05 14:09:41 -08:00
commit befad6bb1e
2 changed files with 10 additions and 31 deletions

View File

@ -473,41 +473,25 @@ function FileChooser:addAllCommands()
self:changeFileChooserMode()
end
)
-- NuPogodi, 25.09.12: new functions to tune the way how to inform user about the reader events
local popup_text = "Unstable... For experts only! "
local voice_text = "This function is still under development and available only for experts and beta testers."
self.commands:add(KEY_I, nil, "I",
"change the way to inform about events",
self.commands:add(KEY_E, nil, "E",
"configure event notifications",
function(self)
if self.filemanager_expert_mode == self.ROOT_MODE then
InfoMessage:chooseNotificatonMethods()
self.pagedirty = true
else
InfoMessage:inform(popup_text, -1, 1, MSG_WARN, voice_text)
end
InfoMessage:chooseNotificatonMethods()
self.pagedirty = true
end
)
self.commands:addGroup("Vol-/+", {Keydef:new(KEY_VPLUS,nil), Keydef:new(KEY_VMINUS,nil)},
"decrease/increase sound volume",
function(self)
if self.filemanager_expert_mode == self.ROOT_MODE then
InfoMessage:incrSoundVolume(keydef.keycode == KEY_VPLUS and 1 or -1)
else
InfoMessage:inform(popup_text, -1, 1, MSG_WARN, voice_text)
end
InfoMessage:incrSoundVolume(keydef.keycode == KEY_VPLUS and 1 or -1)
end
)
self.commands:addGroup(MOD_SHIFT.."Vol-/+", {Keydef:new(KEY_VPLUS,MOD_SHIFT), Keydef:new(KEY_VMINUS,MOD_SHIFT)},
"decrease/increase TTS-engine speed",
function(self)
if self.filemanager_expert_mode == self.ROOT_MODE then
InfoMessage:incrTTSspeed(keydef.keycode == KEY_VPLUS and 1 or -1)
else
InfoMessage:inform(popup_text, -1, 1, MSG_WARN, voice_text)
end
InfoMessage:incrTTSspeed(keydef.keycode == KEY_VPLUS and 1 or -1)
end
)
------------ end of changes (NuPogodi, 25.09.12) ------------
self.commands:add({KEY_F, KEY_AA}, nil, "F, Aa",
"change font faces",
function(self)

View File

@ -3421,16 +3421,11 @@ function UniReader:addAllCommands()
self:redrawCurrentPage()
end
)
self.commands:add(KEY_I, nil, "I",
"change the way to inform about events",
self.commands:add(KEY_E, nil, "E",
"configure event notifications",
function(unireader)
if FileChooser.filemanager_expert_mode == FileChooser.ROOT_MODE then
InfoMessage:chooseNotificatonMethods()
self:redrawCurrentPage()
else
InfoMessage:inform("Unstable... For experts only ", -1, 1, MSG_WARN,
"This function is still under development and available only for experts and beta testers.")
end
InfoMessage:chooseNotificatonMethods()
self:redrawCurrentPage()
end
)
self.commands:add(KEY_BACK,MOD_ALT,"Back",