mirror of
https://github.com/koreader/koreader.git
synced 2025-12-24 12:14:05 +01:00
SSH: add top menu checkbox (#14631)
This commit is contained in:
@@ -225,6 +225,12 @@ end
|
|||||||
function SSH:addToMainMenu(menu_items)
|
function SSH:addToMainMenu(menu_items)
|
||||||
menu_items.ssh = {
|
menu_items.ssh = {
|
||||||
text = _("SSH server"),
|
text = _("SSH server"),
|
||||||
|
checked_func = function() return self:isRunning() end,
|
||||||
|
hold_callback = function(touchmenu_instance)
|
||||||
|
self:onToggleSSHServer()
|
||||||
|
ffiutil.sleep(1)
|
||||||
|
touchmenu_instance:updateItems()
|
||||||
|
end,
|
||||||
sub_item_table = {
|
sub_item_table = {
|
||||||
{
|
{
|
||||||
text = _("SSH server"),
|
text = _("SSH server"),
|
||||||
@@ -240,7 +246,7 @@ function SSH:addToMainMenu(menu_items)
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text_func = function()
|
text_func = function()
|
||||||
return T(_("SSH port (%1)"), self.SSH_port)
|
return T(_("SSH port: %1"), self.SSH_port)
|
||||||
end,
|
end,
|
||||||
keep_menu_open = true,
|
keep_menu_open = true,
|
||||||
enabled_func = function() return not self:isRunning() end,
|
enabled_func = function() return not self:isRunning() end,
|
||||||
|
|||||||
Reference in New Issue
Block a user