Class: Yast::NetworkProposal

Inherits:
Installation::ProposalClient
  • Object
show all
Includes:
I18n, Logger
Defined in:
src/lib/network/clients/network_proposal.rb

Overview

Proposal client for Network configuration

Constant Summary collapse

[
  SWITCH_TO_WICKED = "network--switch-to-wicked".freeze,
  SWITCH_TO_NETWORK_MANAGER = "network--switch-to-nm".freeze,
  DISABLE_SERVICES = "network--disable".freeze
].freeze
[
  PROPOSE_BRIDGE = "network--propose-bridge".freeze,
  PROPOSE_NON_BRIDGE = "network--dont-propose-bridge".freeze
].freeze

Instance Method Summary collapse

Constructor Details

#initializeNetworkProposal

Returns a new instance of NetworkProposal.



42
43
44
45
46
47
48
49
50
51
# File 'src/lib/network/clients/network_proposal.rb', line 42

def initialize
  super
  Yast.import "UI"
  Yast.import "Lan"

  textdomain "installation"

  settings.refresh_packages
  settings.apply_defaults
end

Instance Method Details

#ask_user(args) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'src/lib/network/clients/network_proposal.rb', line 69

def ask_user(args)
  result =
    case args["chosen_id"]
    when "network--switch-to-wicked"
      switch_to_wicked
    when "network--switch-to-nm"
      switch_to_network_manager
    when "network--disable"
      disable_services
    when "network--propose-bridge"
      propose_bridge(true)
    when "network--dont-propose-bridge"
      propose_bridge(false)
    else
      launch_network_configuration(args)
    end

  { "workflow_sequence" => result }
end

#descriptionObject



53
54
55
56
57
58
59
# File 'src/lib/network/clients/network_proposal.rb', line 53

def description
  {
    "rich_text_title" => _("Network Configuration"),
    "menu_title"      => _("Network Configuration"),
    "id"              => "network"
  }
end

#make_proposal(_) ⇒ Object



61
62
63
64
65
66
67
# File 'src/lib/network/clients/network_proposal.rb', line 61

def make_proposal(_)
  {
    "preformatted_proposal" => preformatted_proposal,
    "label_proposal"        => [proposal_summary.one_line_text],
    "links"                 => BACKEND_LINKS + VIRT_PROPOSAL_LINKS
  }
end