From 7ee598c6671e13c5a0283e49e89352d0cdedd33e Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Thu, 19 Sep 2024 18:29:25 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"Profiles:=20make=20sure=20to=20close?= =?UTF-8?q?=20menu/quickmenu=20before=20executing=20action=20(=E2=80=A6"?= =?UTF-8?q?=20(#12534)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 880b7c5ed1c59b5d0ab8770a88e4b92e2c453819. --- frontend/dispatcher.lua | 12 +++--------- plugins/profiles.koplugin/main.lua | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/dispatcher.lua b/frontend/dispatcher.lua index 39c88cd99..6729c2502 100644 --- a/frontend/dispatcher.lua +++ b/frontend/dispatcher.lua @@ -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, }}) diff --git a/plugins/profiles.koplugin/main.lua b/plugins/profiles.koplugin/main.lua index ca356f742..768518f97 100644 --- a/plugins/profiles.koplugin/main.lua +++ b/plugins/profiles.koplugin/main.lua @@ -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, }, {