Refactored menu

While looking into #1219 I accidentally ended up refactoring some stuff.

Tested in emulator and on H2O, but be wary because I might have overlooked something.
This commit is contained in:
Frans de Jonge
2014-11-21 15:41:14 +01:00
parent d649ce269b
commit da00b4b8a9
5 changed files with 107 additions and 119 deletions

View File

@@ -34,7 +34,6 @@ function ReaderFrontLight:init()
}
},
}
self.ui.menu:registerToMainMenu(self)
end
end
@@ -79,20 +78,10 @@ function ReaderFrontLight:onPanRelease(arg, ges)
return self:onShowIntensity()
end
function ReaderFrontLight:addToMainMenu(tab_item_table)
-- insert fldial command to setting tab of reader menu
table.insert(tab_item_table.setting, {
text = _("Frontlight settings"),
callback = function()
self:onShowFlDialog()
end,
})
end
function ReaderFrontLight:onShowFlDialog()
local powerd = Device:getPowerDevice()
self.fl_dialog = InputDialog:new{
title = _("Frontlight Level"),
title = _("Frontlight level"),
input_hint = ("(%d - %d)"):format(powerd.fl_min, powerd.fl_max),
buttons = {
{