Class: Bootloader::Grub2Widget::DefaultSectionWidget

Inherits:
CWM::ComboBox
  • Object
show all
Includes:
Grub2Helper
Defined in:
src/lib/bootloader/grub2_widgets.rb

Overview

represent choosing default section to boot

Instance Method Summary collapse

Methods included from Grub2Helper

#grub2, #grub_default, #password, #sections, #stage1

Constructor Details

#initializeDefaultSectionWidget

Returns a new instance of DefaultSectionWidget.



734
735
736
737
738
# File 'src/lib/bootloader/grub2_widgets.rb', line 734

def initialize
  textdomain "bootloader"

  super
end

Instance Method Details

#helpObject



744
745
746
747
748
749
750
# File 'src/lib/bootloader/grub2_widgets.rb', line 744

def help
  _(
    "<p><b>Default Boot Section</b> selects the default section for booting.\n" \
    " If sections are not generated yet ( e.g. during installation) \n" \
    "then the box is empty and the default is picked by grub2 itself.</p>\n"
  )
end

#initObject



752
753
754
# File 'src/lib/bootloader/grub2_widgets.rb', line 752

def init
  self.value = sections.default
end

#itemsObject



756
757
758
759
760
# File 'src/lib/bootloader/grub2_widgets.rb', line 756

def items
  sections.all.map do |section|
    [section, section]
  end
end

#labelObject



740
741
742
# File 'src/lib/bootloader/grub2_widgets.rb', line 740

def label
  _("&Default Boot Section")
end

#storeObject



762
763
764
# File 'src/lib/bootloader/grub2_widgets.rb', line 762

def store
  sections.default = value
end