menu.lua (702b460d41da7d050ede4f75439dcea6d3a2ab8e) menu.lua (bcf48a159eaaa607446753c48aeb2cf922d740ce)
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

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

199 entry_type = core.MENU_CAROUSEL_ENTRY,
200 carousel_id = "kernel",
201 items = core.kernelList,
202 name = function(idx, choice, all_choices)
203 if #all_choices == 0 then
204 return "Kernel: ";
205 end
206
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

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

199 entry_type = core.MENU_CAROUSEL_ENTRY,
200 carousel_id = "kernel",
201 items = core.kernelList,
202 name = function(idx, choice, all_choices)
203 if #all_choices == 0 then
204 return "Kernel: ";
205 end
206
207 local kernel_name = color.escapef(color.GREEN) ..
208 choice .. color.default();
209 if (idx == 1) then
210 kernel_name = "default/" .. kernel_name;
207 local is_default = (idx == 1);
208 local kernel_name = "";
209 local name_color;
210 if is_default then
211 name_color = color.escapef(color.GREEN);
212 kernel_name = "default/";
213 else
214 name_color = color.escapef(color.BLUE);
211 end
215 end
216 kernel_name = kernel_name .. name_color .. choice ..
217 color.default();
212 return color.highlight("K").."ernel: " .. kernel_name ..
213 " (" .. idx ..
214 " of " .. #all_choices .. ")";
215 end,
216 func = function(idx, choice, all_choices)
217 if (#all_choices > 1) then
218 config.reload(choice);
219 end

--- 184 unchanged lines hidden ---
218 return color.highlight("K").."ernel: " .. kernel_name ..
219 " (" .. idx ..
220 " of " .. #all_choices .. ")";
221 end,
222 func = function(idx, choice, all_choices)
223 if (#all_choices > 1) then
224 config.reload(choice);
225 end

--- 184 unchanged lines hidden ---