mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Dispatcher: fix remove actions (#13227)
Some checks failed
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Has been cancelled
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Has been cancelled
Some checks failed
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Has been cancelled
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Has been cancelled
Closes #13226.
This commit is contained in:
@@ -942,17 +942,15 @@ function Dispatcher:_addItem(caller, menu, location, settings, section)
|
||||
end
|
||||
|
||||
function Dispatcher.removeActions(actions, do_remove)
|
||||
if actions then
|
||||
local count = Dispatcher:_itemsCount(actions)
|
||||
if count == 1 then
|
||||
do_remove()
|
||||
elseif count > 1 then
|
||||
local ConfirmBox = require("ui/widget/confirmbox")
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = T(NC_("Dispatcher", "1 action will be removed.", "%1 actions will be removed.", count), count),
|
||||
ok_callback = do_remove,
|
||||
})
|
||||
end
|
||||
local count = actions and Dispatcher:_itemsCount(actions) or 0
|
||||
if count > 1 then
|
||||
local ConfirmBox = require("ui/widget/confirmbox")
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = T(NC_("Dispatcher", "1 action will be removed.", "%1 actions will be removed.", count), count),
|
||||
ok_callback = do_remove,
|
||||
})
|
||||
else
|
||||
do_remove()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user