Class: Bootloader::PMBRWidget

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

Overview

Represents Protective MBR action

Instance Method Summary collapse

Constructor Details

#initializePMBRWidget

Returns a new instance of PMBRWidget.



294
295
296
297
298
# File 'src/lib/bootloader/generic_widgets.rb', line 294

def initialize
  textdomain "bootloader"

  super
end

Instance Method Details

#helpObject



304
305
306
307
308
309
310
# File 'src/lib/bootloader/generic_widgets.rb', line 304

def help
  _(
    "<p><b>Protective MBR flag</b> is expert only settings, that is needed " \
    "only on exotic hardware. For details see Protective MBR in GPT disks. " \
    "Do not touch if you are not sure.</p>"
  )
end

#initObject



312
313
314
315
316
317
318
319
320
# File 'src/lib/bootloader/generic_widgets.rb', line 312

def init
  current_bl = ::Bootloader::BootloaderFactory.current
  if current_bl.respond_to?(:pmbr_action)
    self.value = current_bl.pmbr_action
  else
    log.error("Bootloader #{current_bl} does not support PMBR.")
    disable
  end
end

#itemsObject



322
323
324
325
326
327
328
329
330
331
# File 'src/lib/bootloader/generic_widgets.rb', line 322

def items
  [
    # TRANSLATORS: set flag on disk
    [:add, _("set")],
    # TRANSLATORS: remove flag from disk
    [:remove, _("remove")],
    # TRANSLATORS: do not change flag on disk
    [:nothing, _("do not change")]
  ]
end

#labelObject



300
301
302
# File 'src/lib/bootloader/generic_widgets.rb', line 300

def label
  _("&Protective MBR flag")
end

#storeObject



333
334
335
336
337
338
339
340
# File 'src/lib/bootloader/generic_widgets.rb', line 333

def store
  current_bl = ::Bootloader::BootloaderFactory.current
  if current_bl.respond_to?(:pmbr_action)
    current_bl.pmbr_action = value
  else
    log.error("Bootloader #{current_bl} does not support PMBR.")
  end
end