Revert "Profiles: make sure to close menu/quickmenu before executing action (…" (#12534)

This reverts commit 880b7c5ed1.
This commit is contained in:
Frans de Jonge
2024-09-19 18:29:25 +02:00
committed by GitHub
parent 6dcafb329a
commit 7ee598c667
2 changed files with 5 additions and 11 deletions

View File

@@ -1084,9 +1084,7 @@ function Dispatcher:_showAsMenu(settings, exec_props)
font_size = 22,
callback = function()
UIManager:close(quickmenu)
UIManager:nextTick(function()
Dispatcher:execute(settings, { qm_show = false })
end)
Dispatcher:execute(settings, { qm_show = false })
end,
}})
end
@@ -1100,9 +1098,7 @@ function Dispatcher:_showAsMenu(settings, exec_props)
font_bold = false,
callback = function()
UIManager:close(quickmenu)
UIManager:nextTick(function()
Dispatcher:execute({[v.key] = settings[v.key]})
end)
Dispatcher:execute({[v.key] = settings[v.key]})
if keep_open_on_apply and not util.stringStartsWith(v.key, "touch_input") then
quickmenu:setTitle(title)
UIManager:show(quickmenu)
@@ -1111,9 +1107,7 @@ function Dispatcher:_showAsMenu(settings, exec_props)
hold_callback = function()
if v.key:sub(1, 13) == "profile_exec_" then
UIManager:close(quickmenu)
UIManager:nextTick(function()
UIManager:sendEvent(Event:new(settingsList[v.key].event, settingsList[v.key].arg, { qm_show = true }))
end)
UIManager:sendEvent(Event:new(settingsList[v.key].event, settingsList[v.key].arg, { qm_show = true }))
end
end,
}})

View File

@@ -124,14 +124,14 @@ function Profiles:getSubMenuItems()
text = _("Execute"),
callback = function(touchmenu_instance)
touchmenu_instance:onClose()
UIManager:nextTick(self.onProfileExecute, self, k, { qm_show = false })
self:onProfileExecute(k, { qm_show = false })
end,
},
{
text = _("Show as QuickMenu"),
callback = function(touchmenu_instance)
touchmenu_instance:onClose()
UIManager:nextTick(self.onProfileExecute, self, k, { qm_show = true })
self:onProfileExecute(k, { qm_show = true })
end,
},
{