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
reviewable/pr6684/r2
yparitcher 4 years ago committed by Frans de Jonge
parent c6ce316d4e
commit 34b3d5541d

@ -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,

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

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

Loading…
Cancel
Save