menu.lua (5c1b51658125f5a9bf94179f89a9f24bc7761311) menu.lua (1f5696c7fd92009f7687b8c8eaf89c09eab72daa)
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

--- 238 unchanged lines hidden (view full) ---

247 if (is_default) then
248 name_color = color.escapef(color.GREEN);
249 kernel_name = "default/";
250 else
251 name_color = color.escapef(color.BLUE);
252 end
253 kernel_name = kernel_name .. name_color ..
254 choice .. color.default();
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

--- 238 unchanged lines hidden (view full) ---

247 if (is_default) then
248 name_color = color.escapef(color.GREEN);
249 kernel_name = "default/";
250 else
251 name_color = color.escapef(color.BLUE);
252 end
253 kernel_name = kernel_name .. name_color ..
254 choice .. color.default();
255 return color.highlight("K").."ernel: " ..
255 return color.highlight("K") .. "ernel: " ..
256 kernel_name .. " (" .. idx .. " of " ..
257 #all_choices .. ")";
258 end,
259 func = function(idx, choice, all_choices)
260 config.selectkernel(choice);
261 end,
262 alias = {"k", "K"}
263 },

--- 46 unchanged lines hidden (view full) ---

310
311 cont = true;
312 while (cont) do
313 local key = io.getchar();
314
315 -- Special key behaviors
316 if ((key == core.KEY_BACKSPACE) or (key == core.KEY_DELETE)) and
317 (m ~= menu.welcome) then
256 kernel_name .. " (" .. idx .. " of " ..
257 #all_choices .. ")";
258 end,
259 func = function(idx, choice, all_choices)
260 config.selectkernel(choice);
261 end,
262 alias = {"k", "K"}
263 },

--- 46 unchanged lines hidden (view full) ---

310
311 cont = true;
312 while (cont) do
313 local key = io.getchar();
314
315 -- Special key behaviors
316 if ((key == core.KEY_BACKSPACE) or (key == core.KEY_DELETE)) and
317 (m ~= menu.welcome) then
318 break
318 break;
319 elseif (key == core.KEY_ENTER) then
320 core.boot();
321 -- Should not return
322 end
323
324 key = string.char(key)
325 -- check to see if key is an alias
326 local sel_entry = nil;

--- 99 unchanged lines hidden (view full) ---

426 print(" "
427 .. " ");
428 screen.defcursor();
429 return;
430 end
431 end
432
433 loader.delay(50000);
319 elseif (key == core.KEY_ENTER) then
320 core.boot();
321 -- Should not return
322 end
323
324 key = string.char(key)
325 -- check to see if key is an alias
326 local sel_entry = nil;

--- 99 unchanged lines hidden (view full) ---

426 print(" "
427 .. " ");
428 screen.defcursor();
429 return;
430 end
431 end
432
433 loader.delay(50000);
434 until time <= 0
434 until time <= 0;
435 core.boot();
436
437end
438
439function OnOff(str, b)
440 if (b) then
441 return str .. color.escapef(color.GREEN) .. "On" ..
442 color.escapef(color.WHITE);
443 else
444 return str .. color.escapef(color.RED) .. "off" ..
445 color.escapef(color.WHITE);
446 end
447end
448
449return menu;
435 core.boot();
436
437end
438
439function OnOff(str, b)
440 if (b) then
441 return str .. color.escapef(color.GREEN) .. "On" ..
442 color.escapef(color.WHITE);
443 else
444 return str .. color.escapef(color.RED) .. "off" ..
445 color.escapef(color.WHITE);
446 end
447end
448
449return menu;