Class: Bootloader::ProposalClient
- Inherits:
-
Installation::ProposalClient
- Object
- Installation::ProposalClient
- Bootloader::ProposalClient
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
- PROPOSAL_LINKS =
[
"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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'src/lib/bootloader/proposal_client.rb', line 66
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
# File 'src/lib/bootloader/proposal_client.rb', line 107
def ask_user(param)
chosen_id = param["chosen_id"]
result = :next
log.info "ask user called with #{chosen_id}"
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
{ "workflow_sequence" => result }
end
|
#description ⇒ Object
131
132
133
134
135
136
137
138
139
|
# File 'src/lib/bootloader/proposal_client.rb', line 131
def description
{
"rich_text_title" => _("Booting"),
"menu_title" => _("&Booting"),
"id" => "bootloader_stuff"
}
end
|
#make_proposal(attrs) ⇒ Object
97
98
99
100
101
102
103
104
105
|
# File 'src/lib/bootloader/proposal_client.rb', line 97
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
|