Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix network overview for NetworkManager users #1317

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/lib/y2network/presenters/interface_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def text
end

if hardware.nil? || !hardware.exists?
rich << "<b>(" << _("No hardware information") << ")</b><br>"
if @config.backend?(:network_manager)
rich << "<b>" << _("Network interfaces are managed by Network Manager.") << "</b><br>"
else
rich << "<b>(" << _("No hardware information") << ")</b><br>"
end
else
rich << "<b>(" << _("Not connected") << ")</b><br>" if !hardware.link
rich << "<b>MAC : </b>" << hardware.mac << "<br>" if hardware.mac
Expand All @@ -104,9 +108,11 @@ def text
rich << Yast::HTML.Bold(dev_name) << "<br>"
end

rich << "<p>"
rich << _("The device is not configured. Press <b>Edit</b>\nto configure.\n")
rich << "</p>"
if !@config.backend?(:network_manager)
rich << "<p>"
rich << _("The device is not configured. Press <b>Edit</b>\nto configure.\n")
rich << "</p>"
end
end
rich
end
Expand Down
4 changes: 4 additions & 0 deletions src/lib/y2network/widgets/add_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def initialize
textdomain "network"
end

def init
disable if Yast::Lan.yast_config&.backend?(:network_manager)
end

def label
Yast::Label.AddButton
end
Expand Down
1 change: 1 addition & 0 deletions src/lib/y2network/widgets/delete_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def label
# @see CWM::AbstractWidget#init
def init
disable unless @table.value
disable if Yast::Lan.yast_config&.backend?(:network_manager)
end

def handle
Expand Down
1 change: 1 addition & 0 deletions src/lib/y2network/widgets/edit_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def initialize(table)
# @see CWM::AbstractWidget#init
def init
disable unless @table.value
disable if Yast::Lan.yast_config&.backend?(:network_manager)
end

def label
Expand Down
19 changes: 6 additions & 13 deletions src/lib/y2network/widgets/interfaces_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def handle

def items
items_list = []
return items_list if config.backend?(:network_manager)
config.interfaces.each { |i| items_list << interface_item(i) }
config.s390_devices.select(&:offline?).each do |device|
items_list << device_item(device)
Expand All @@ -66,26 +67,18 @@ def items

# Workaround for usage in old CWM which also cache content of cwm items
def init
if config.backend?(:network_manager)
Yast::Popup.Warning(
_(
"Network is currently handled by NetworkManager\n" \
"or completely disabled. YaST is unable to configure some options."
)
)
# switch to global tab
Yast::UI.FakeUserInput("ID" => "global")
return
end

change_items(items)
handle
disable if config.backend?(:network_manager)
end

def help
_(
"<p><b><big>Overview</big></b><br>\n" \
"Obtain an overview of the network interfaces configuration.</p>\n"
"Obtain an overview of the network interfaces configuration.<br><br>\n" \
"YaST cannot be used to configure network interfaces if <b>Network Manager</b><br>\n" \
"is selected as network setup method. Choose <b>Wicked</b> if you prefer to<br>\n" \
"configure them with YaST.</p>\n"
)
end

Expand Down