Class: Y2Network::Widgets::WirelessEssidName

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

Overview

Widget for network name combobox

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ WirelessEssidName


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

def initialize(settings)
  @settings = settings
  textdomain "network"
end

Instance Method Details

#initObject


69
70
71
72
# File 'src/lib/y2network/widgets/wireless_essid.rb', line 69

def init
  Yast::UI.ChangeWidget(Id(widget_id), :ValidChars, valid_chars)
  self.value = @settings.essid.to_s
end

#labelObject


65
66
67
# File 'src/lib/y2network/widgets/wireless_essid.rb', line 65

def label
  _("Ne&twork Name (ESSID)")
end

#optObject

allow to use not found name e.g. when scan failed or when network is hidden


75
76
77
# File 'src/lib/y2network/widgets/wireless_essid.rb', line 75

def opt
  [:editable]
end

#storeObject


87
88
89
# File 'src/lib/y2network/widgets/wireless_essid.rb', line 87

def store
  @settings.essid = value
end

#update_essid_list(networks) ⇒ Object

updates essid list with given array and ensure that previously selected value is preserved


81
82
83
84
85
# File 'src/lib/y2network/widgets/wireless_essid.rb', line 81

def update_essid_list(networks)
  old_value = value
  change_items(networks.map { |n| [n, n] })
  self.value = old_value
end