Class: Bootloader::ProposalClient

Inherits:
Installation::ProposalClient
  • Object
show all
Includes:
Yast::I18n, Yast::Logger
Defined in:
src/lib/bootloader/proposal_client.rb

Overview

Proposal client for bootloader configuration rubocop:disable Metrics/ClassLength

Defined Under Namespace

Classes: MismatchBootloader

Constant Summary collapse

[
  "enable_boot_mbr",
  "disable_boot_mbr",
  "enable_boot_boot",
  "disable_boot_boot",
  "enable_boot_extended",
  "disable_boot_extended",
  "enable_secure_boot",
  "disable_secure_boot",
  "enable_update_nvram",
  "disable_update_nvram",
  "enable_trusted_boot",
  "disable_trusted_boot"
].freeze

Instance Method Summary collapse

Constructor Details

#initializeProposalClient

Returns a new instance of ProposalClient.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'src/lib/bootloader/proposal_client.rb', line 61

def initialize
  textdomain "bootloader"

  super

  Yast.import "UI"
  Yast.import "Arch"
  Yast.import "BootStorage"
  Yast.import "Bootloader"
  Yast.import "Installation"
  Yast.import "Mode"
  Yast.import "BootSupportCheck"
  Yast.import "Product"
  Yast.import "PackagesProposal"
end

Instance Method Details

#ask_user(param) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'src/lib/bootloader/proposal_client.rb', line 102

def ask_user(param)
  chosen_id = param["chosen_id"]
  result = :next
  log.info "ask user called with #{chosen_id}"

  # enable boot from MBR
  case chosen_id
  when *PROPOSAL_LINKS
    value = (chosen_id =~ /enable/) ? true : false
    option = chosen_id[/(enable|disable)_(.*)/, 2]
    single_click_action(option, value)
  else
    settings = export_settings
    result = ::Bootloader::MainDialog.new.run_auto
    if result == :next
      Yast::Bootloader.proposed_cfg_changed = true
    elsif settings
      Yast::Bootloader.Import(settings)
    end
  end
  # Fill return map
  { "workflow_sequence" => result }
end

#descriptionObject



126
127
128
129
130
131
132
133
134
# File 'src/lib/bootloader/proposal_client.rb', line 126

def description
  {
    # proposal part - bootloader label
    "rich_text_title" => _("Booting"),
    # menubutton entry
    "menu_title"      => _("&Booting"),
    "id"              => "bootloader_stuff"
  }
end

#make_proposal(attrs) ⇒ Object



92
93
94
95
96
97
98
99
100
# File 'src/lib/bootloader/proposal_client.rb', line 92

def make_proposal(attrs)
  make_proposal_raising(attrs)
rescue ::Bootloader::NoRoot
  no_root_proposal
rescue MismatchBootloader => e
  mismatch_bootloader_proposal(e)
rescue ::Bootloader::BrokenConfiguration => e
  broken_configuration_proposal(e)
end