Class: Y2Network::Widgets::WirelessAuthMode

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

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ WirelessAuthMode

Returns a new instance of WirelessAuthMode.


26
27
28
29
30
# File 'src/lib/y2network/widgets/wireless_auth_mode.rb', line 26

def initialize(settings)
  textdomain "network"

  @settings = settings
end

Instance Method Details

#helpObject


53
54
55
56
57
58
# File 'src/lib/y2network/widgets/wireless_auth_mode.rb', line 53

def help
  # TODO: improve help text, mention all options and security problems with WEP
  "<p>WPA-EAP uses a RADIUS server to authenticate users. There\n" \
  "are different methods in EAP to connect to the server and\n" \
  "perform the authentication, namely TLS, TTLS, and PEAP.</p>\n"
end

#initObject


32
33
34
# File 'src/lib/y2network/widgets/wireless_auth_mode.rb', line 32

def init
  self.value = @settings.auth_mode.to_s if @settings.auth_mode
end

#itemsObject


44
45
46
47
48
49
50
51
# File 'src/lib/y2network/widgets/wireless_auth_mode.rb', line 44

def items
  return @items if @items

  modes = Y2Network::WirelessAuthMode.all - [Y2Network::WirelessAuthMode::NONE]
  modes.sort_by!(&:to_human_string)
  modes.unshift(Y2Network::WirelessAuthMode::NONE)
  @items = modes.map { |m| [m.short_name, m.to_human_string] }
end

#labelObject


36
37
38
# File 'src/lib/y2network/widgets/wireless_auth_mode.rb', line 36

def label
  _("Mode")
end

#optObject


40
41
42
# File 'src/lib/y2network/widgets/wireless_auth_mode.rb', line 40

def opt
  [:hstretch, :notify]
end

#storeObject


60
61
62
# File 'src/lib/y2network/widgets/wireless_auth_mode.rb', line 60

def store
  @settings.auth_mode = value.to_sym
end