Class: Y2Network::Widgets::S390Layer2

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

Overview

This custom widget contents a checkbox for enabling the layer2 support and an input field for setting the mac address to be used in case of enablement.

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ S390Layer2

Constructor


218
219
220
221
222
# File 'src/lib/y2network/widgets/s390_common.rb', line 218

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

Instance Method Details

#contentsObject

See Also:

  • CWM::AbstractWidget

225
226
227
228
229
230
# File 'src/lib/y2network/widgets/s390_common.rb', line 225

def contents
  VBox(
    Left(support_widget),
    Left(mac_address_widget)
  )
end

#handle(event) ⇒ Object

See Also:

  • CWM::AbstractWidget

238
239
240
241
242
243
244
245
# File 'src/lib/y2network/widgets/s390_common.rb', line 238

def handle(event)
  case event["ID"]
  when support_widget.widget_id
    refresh
  end

  nil
end

#initObject

See Also:

  • CWM::AbstractWidget

233
234
235
# File 'src/lib/y2network/widgets/s390_common.rb', line 233

def init
  refresh
end

#validateObject


247
248
249
250
251
252
# File 'src/lib/y2network/widgets/s390_common.rb', line 247

def validate
  return true if !layer2? || valid_mac?(mac_address_widget.value)

  report_mac_error
  false
end