Gestures/Profiles: make sure dispatcher is initalized

even when the menu is not opened. this was causing a crash when the event name was parsed from creoptions
This commit is contained in:
yparitcher
2020-09-21 20:05:02 -04:00
committed by Frans de Jonge
parent c6ce316d4e
commit 34b3d5541d
3 changed files with 4 additions and 1 deletions

View File

@@ -287,6 +287,7 @@ local dispatcher_menu_order = {
add settings from CreOptions / KoptOptions
--]]--
function Dispatcher:init()
if Dispatcher.initialized then return end
local parseoptions = function(base, i)
for y=1,#base[i].options do
local option = base[i].options[y]
@@ -512,7 +513,7 @@ example usage:
Dispatcher.addSubMenu(self, sub_items, self.data, "profile1")
--]]--
function Dispatcher:addSubMenu(caller, menu, location, settings)
if not Dispatcher.initialized then Dispatcher:init() end
Dispatcher:init()
table.insert(menu, {
text = _("Nothing"),
separator = true,

View File

@@ -175,6 +175,7 @@ function Gestures:init()
end
self.ui.menu:registerToMainMenu(self)
Dispatcher:init()
self:initGesture()
end

View File

@@ -19,6 +19,7 @@ local Profiles = WidgetContainer:new{
}
function Profiles:init()
Dispatcher:init()
self.ui.menu:registerToMainMenu(self)
end