Skip to content

Commit

Permalink
Renamed some helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Jan 26, 2022
1 parent aaa7622 commit 5ab25b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/y2network/widgets/bond_port.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def contents

def handle(event)
if event["EventReason"] == "SelectionChanged"
enable_slave_buttons
enable_position_buttons
elsif event["EventReason"] == "Activated" && event["WidgetClass"] == :PushButton
items = ui_items || []
current = value.to_s
Expand All @@ -69,7 +69,7 @@ def handle(event)
end
Yast::UI.ChangeWidget(:bond_ports_items, :Items, items)
Yast::UI.ChangeWidget(:bond_ports_items, :CurrentItem, current)
enable_slave_buttons
enable_position_buttons
else
log.debug("event:#{event}")
end
Expand Down Expand Up @@ -109,7 +109,7 @@ def init
ports
)

enable_slave_buttons
enable_position_buttons

nil
end
Expand Down Expand Up @@ -159,7 +159,7 @@ def value_index
ui_items.index { |i| i[0] == Id(value) }
end

def enable_slave_buttons
def enable_position_buttons
if value_index
Yast::UI.ChangeWidget(:bond_ports_up, :Enabled, value_index > 0)
Yast::UI.ChangeWidget(:bond_ports_down, :Enabled, value_index < ui_items.size - 1)
Expand Down

0 comments on commit 5ab25b2

Please sign in to comment.