Skip to content

Commit

Permalink
fix warnings libyui reported and listing available sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Mar 9, 2016
1 parent 19ee0f7 commit 7df7966
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/lib/bootloader/grub2_widgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def help

def init
if grub_default.hidden_timeout && grub_default.hidden_timeout.to_i > 0
self.value = grub_default.hidden_timeout
self.value = grub_default.hidden_timeout.to_i
else
self.value = grub_default.timeout
self.value = grub_default.timeout.to_i
end
end

Expand Down Expand Up @@ -169,7 +169,7 @@ def initialize
end

def label
_("Probe Foreign OS")
_("Pro&be Foreign OS")
end

def help
Expand Down Expand Up @@ -225,7 +225,7 @@ def initialize
end

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

def help
Expand Down Expand Up @@ -421,7 +421,7 @@ def init
# there's mode specified, use it
Yast::UI.ChangeWidget(Id(:gfxmode), :Value, mode) if mode && mode != ""

Yast::UI.ChangeWidget(Id(:theme), :Value, grub_default.theme)
Yast::UI.ChangeWidget(Id(:theme), :Value, grub_default.theme || "")
end

def store
Expand Down Expand Up @@ -568,7 +568,7 @@ def init
self.value = sections.default
end

def list
def items
sections.all.map do |section|
[section, section]
end
Expand Down Expand Up @@ -683,7 +683,7 @@ class DeviceMapWidget < ::CWM::PushButton
def label
textdomain "bootloader"

_("Edit Disk Boot Order")
_("&Edit Disk Boot Order")
end

def help
Expand Down
1 change: 1 addition & 0 deletions src/lib/bootloader/grub2base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def read(reread: false)
grub_cfg = CFA::Grub2::GrubCfg.new
grub_cfg.load
@sections = ::Bootloader::Sections.new(grub_cfg)
log.info "grub sections: #{@sections.all}"
end

def write
Expand Down
4 changes: 2 additions & 2 deletions test/grub2_widgets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,8 @@ def stub_widget_value(id, value)
expect(bootloader.sections.default).to eq "openSUSE"
end

it "lists all available sections" do
expect(subject.list).to eq([
it "enlists all available sections" do
expect(subject.items).to eq([
["openSUSE", "openSUSE"],
["windows", "windows"]
])
Expand Down

0 comments on commit 7df7966

Please sign in to comment.