Class: Bootloader::Grub2Widget::TimeoutWidget
- Inherits:
-
CWM::IntField
- Object
- CWM::IntField
- Bootloader::Grub2Widget::TimeoutWidget
- Includes:
- Grub2Helper
- Defined in:
- src/lib/bootloader/grub2_widgets.rb
Overview
Represents bootloader timeout value
Instance Attribute Summary collapse
-
#maximum ⇒ Object
readonly
Returns the value of attribute maximum.
-
#minimum ⇒ Object
readonly
Returns the value of attribute minimum.
Instance Method Summary collapse
- #help ⇒ Object
- #init ⇒ Object
-
#initialize(hidden_menu_widget) ⇒ TimeoutWidget
constructor
A new instance of TimeoutWidget.
- #label ⇒ Object
- #store ⇒ Object
Methods included from Grub2Helper
#grub2, #grub_default, #password, #stage1
Constructor Details
#initialize(hidden_menu_widget) ⇒ TimeoutWidget
Returns a new instance of TimeoutWidget.
47 48 49 50 51 52 53 54 55 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 47 def initialize() textdomain "bootloader" super() @minimum = -1 @maximum = 600 = end |
Instance Attribute Details
#maximum ⇒ Object (readonly)
Returns the value of attribute maximum.
57 58 59 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 57 def maximum @maximum end |
#minimum ⇒ Object (readonly)
Returns the value of attribute minimum.
57 58 59 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 57 def minimum @minimum end |
Instance Method Details
#help ⇒ Object
63 64 65 66 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 63 def help _("<p><b>Timeout in Seconds</b>\n" \ "specifies the time the boot loader will wait until the default kernel is loaded.</p>\n") end |
#init ⇒ Object
68 69 70 71 72 73 74 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 68 def init self.value = if grub_default.hidden_timeout && grub_default.hidden_timeout.to_i > 0 grub_default.hidden_timeout.to_i else grub_default.timeout.to_i end end |
#label ⇒ Object
59 60 61 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 59 def label _("&Timeout in Seconds") end |
#store ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 76 def store if .is_a?(CWM::Empty) grub_default.timeout = value.to_s elsif .checked? grub_default.hidden_timeout = value.to_s grub_default.timeout = "0" else grub_default.hidden_timeout = "0" grub_default.timeout = value.to_s end end |