menu.lua (1504bce32d51612b355295155b69fc372309fbb9) | menu.lua (ef625845801f19c0884a695aafb56bbfd7d6245f) |
---|---|
1-- 2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 3-- All rights reserved. 4-- 5-- Redistribution and use in source and binary forms, with or without 6-- modification, are permitted provided that the following conditions 7-- are met: 8-- 1. Redistributions of source code must retain the above copyright --- 147 unchanged lines hidden (view full) --- 156 }, 157 158 -- escape to interpreter 159 { 160 entry_type = core.MENU_RETURN, 161 name = function() 162 return color.highlight("Esc").."ape to loader prompt"; 163 end, | 1-- 2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 3-- All rights reserved. 4-- 5-- Redistribution and use in source and binary forms, with or without 6-- modification, are permitted provided that the following conditions 7-- are met: 8-- 1. Redistributions of source code must retain the above copyright --- 147 unchanged lines hidden (view full) --- 156 }, 157 158 -- escape to interpreter 159 { 160 entry_type = core.MENU_RETURN, 161 name = function() 162 return color.highlight("Esc").."ape to loader prompt"; 163 end, |
164 func = function() 165 loader.setenv("autoboot_delay", "NO") 166 end, |
|
164 alias = {core.KEYSTR_ESCAPE} 165 }, 166 167 -- reboot 168 { 169 entry_type = core.MENU_ENTRY, 170 name = function() 171 return color.highlight("R").."eboot"; --- 124 unchanged lines hidden (view full) --- 296 297 caridx = (caridx % #choices) + 1; 298 menu.setCarouselIndex(carid, caridx); 299 sel_entry.func(choices[caridx]); 300 elseif (sel_entry.entry_type == core.MENU_SUBMENU) then 301 -- recurse 302 cont = menu.run(sel_entry.submenu()); 303 elseif (sel_entry.entry_type == core.MENU_RETURN) then | 167 alias = {core.KEYSTR_ESCAPE} 168 }, 169 170 -- reboot 171 { 172 entry_type = core.MENU_ENTRY, 173 name = function() 174 return color.highlight("R").."eboot"; --- 124 unchanged lines hidden (view full) --- 299 300 caridx = (caridx % #choices) + 1; 301 menu.setCarouselIndex(carid, caridx); 302 sel_entry.func(choices[caridx]); 303 elseif (sel_entry.entry_type == core.MENU_SUBMENU) then 304 -- recurse 305 cont = menu.run(sel_entry.submenu()); 306 elseif (sel_entry.entry_type == core.MENU_RETURN) then |
307 -- allow entry to have a function/side effect 308 if (sel_entry.func ~= nil) then 309 sel_entry.func(); 310 end |
|
304 -- break recurse 305 cont = false; 306 end 307 -- if we got an alias key the screen is out of date: 308 screen.clear(); 309 screen.defcursor(); 310 alias_table = drawer.drawscreen(m); 311 end --- 80 unchanged lines hidden --- | 311 -- break recurse 312 cont = false; 313 end 314 -- if we got an alias key the screen is out of date: 315 screen.clear(); 316 screen.defcursor(); 317 alias_table = drawer.drawscreen(m); 318 end --- 80 unchanged lines hidden --- |