Class: Y2Network::Widgets::WirelessAuth

Inherits:
CWM::CustomWidget
  • Object
show all
Defined in:
src/lib/y2network/widgets/wireless_auth.rb

Overview

Top level widget for wireless authentication. It changes content dynamically depending on selected authentication method.

Defined Under Namespace

Classes: WirelessWepKeys

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ WirelessAuth

Returns a new instance of WirelessAuth.

Parameters:

  • settings (Y2network::InterfaceConfigBuilder)


36
37
38
39
40
41
# File 'src/lib/y2network/widgets/wireless_auth.rb', line 36

def initialize(settings)
  super()
  @settings = settings
  self.handle_all_events = true
  textdomain "network"
end

Instance Attribute Details

#settingsObject (readonly)

Returns the value of attribute settings.



33
34
35
# File 'src/lib/y2network/widgets/wireless_auth.rb', line 33

def settings
  @settings
end

Instance Method Details

#auth_mode=(mode) ⇒ Object

Sets the authentication mode

It sets the auth mode to the given value and refreshes the widgets accordingly.

Parameters:

  • mode (Symbol)

    Authentication mode



72
73
74
75
# File 'src/lib/y2network/widgets/wireless_auth.rb', line 72

def auth_mode=(mode)
  auth_mode_widget.value = mode.to_s
  refresh
end

#contentsObject



56
57
58
59
60
61
62
63
64
65
# File 'src/lib/y2network/widgets/wireless_auth.rb', line 56

def contents
  Frame(
    _("Authentication"),
    VBox(
      auth_mode_widget,
      VSpacing(0.2),
      replace_widget
    )
  )
end

#handle(event) ⇒ Object



49
50
51
52
53
54
# File 'src/lib/y2network/widgets/wireless_auth.rb', line 49

def handle(event)
  return if event["ID"] != auth_mode_widget.widget_id

  refresh
  nil
end

#initObject



43
44
45
46
47
# File 'src/lib/y2network/widgets/wireless_auth.rb', line 43

def init
  auth_mode_widget.init # force init of auth to ensure that refresh has correct value
  replace_widget.init
  refresh
end