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, #sections, #stage1
Constructor Details
#initialize(hidden_menu_widget) ⇒ TimeoutWidget
Returns a new instance of TimeoutWidget.
51 52 53 54 55 56 57 58 59 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 51 def initialize() textdomain "bootloader" super() @minimum = -1 @maximum = 600 @hidden_menu_widget = end |
Instance Attribute Details
#maximum ⇒ Object (readonly)
Returns the value of attribute maximum.
61 62 63 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 61 def maximum @maximum end |
#minimum ⇒ Object (readonly)
Returns the value of attribute minimum.
61 62 63 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 61 def minimum @minimum end |
Instance Method Details
#help ⇒ Object
67 68 69 70 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 67 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
72 73 74 75 76 77 78 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 72 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
63 64 65 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 63 def label _("&Timeout in Seconds") end |
#store ⇒ Object
80 81 82 83 84 85 86 87 88 |
# File 'src/lib/bootloader/grub2_widgets.rb', line 80 def store if @hidden_menu_widget.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 |