Class: Y2Network::Widgets::IPAddress

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

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ IPAddress


29
30
31
32
33
# File 'src/lib/y2network/widgets/ip_address.rb', line 29

def initialize(settings)
  textdomain "network"

  @settings = settings
end

Instance Method Details

#helpObject


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

def help
  # TODO: write it
  ""
end

#initObject


48
49
50
# File 'src/lib/y2network/widgets/ip_address.rb', line 48

def init
  self.value = @settings.ip_address
end

#labelObject


35
36
37
# File 'src/lib/y2network/widgets/ip_address.rb', line 35

def label
  _("&IP Address")
end

#optObject


44
45
46
# File 'src/lib/y2network/widgets/ip_address.rb', line 44

def opt
  [:hstretch]
end

#storeObject


52
53
54
# File 'src/lib/y2network/widgets/ip_address.rb', line 52

def store
  @settings.ip_address = value
end

#validateObject


56
57
58
59
60
61
62
# File 'src/lib/y2network/widgets/ip_address.rb', line 56

def validate
  return true if Yast::IP.Check(value)

  Yast::Popup.Error(_("No valid IP address."))
  focus
  false
end