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
# File 'src/lib/y2network/widgets/wireless_auth.rb', line 36

def initialize(settings)
  @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


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

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

#contentsObject


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

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

#handle(event) ⇒ Object


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

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

  refresh
  nil
end

#initObject


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

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