Skip to content

Commit

Permalink
Add help text to disk selection dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Nov 27, 2017
1 parent b24ad5b commit 1fad392
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/lib/autoinstall/dialogs/disk_selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ class DiskSelector < UI::Dialog
attr_reader :devicegraph
# @return [Array<String>] Device names that should be omitted
attr_reader :blacklist
# @return [Integer] Drive section index
attr_reader :drive_index

# Constructor
#
# @param devicegraph [Y2Storage::Devicegraph] Devicegraph used to find disks.
# By default, the probed devicegraph is used.
# @param blacklist [Array<String>] Device names that should be omitted.
# These disks will be filtered out.
def initialize(devicegraph = nil, blacklist: [])
def initialize(devicegraph = nil, drive_index = 1, blacklist: [])
@devicegraph = devicegraph || Y2Storage::StorageManager.instance.probed
@drive_index = drive_index
@blacklist = blacklist
end

Expand All @@ -63,7 +66,7 @@ def dialog_content
# @return [Yast::Term] Dialog content
def disks_content
VBox(
Label(_("Choose a hard disk")),
Label(help_text),
RadioButtonGroup(
Id(:options),
VBox(*options)
Expand Down Expand Up @@ -146,6 +149,14 @@ def abort_button
def label(disk)
"#{disk.basename}, #{disk.hwinfo.model}, #{disk.hwinfo.vendor}"
end

# Help text
def help_text
# TRANSLATORS: %s will be replaced by a number
_("All hard disks automatically detected on your system\n" \
"are shown here. Select a hard disk to be used in the\n" \
"#%s drive section of your AutoYaST profile.") % drive_index
end
end
end
end
Expand Down

0 comments on commit 1fad392

Please sign in to comment.