Class: Y2Network::Widgets::RemoteIP

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

Instance Method Summary collapse

Constructor Details

#initialize(settings) ⇒ RemoteIP

Returns a new instance of RemoteIP.



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

def initialize(settings)
  super()
  textdomain "network"

  @settings = settings
end

Instance Method Details

#helpObject



39
40
41
42
43
44
45
46
# File 'src/lib/y2network/widgets/remote_ip.rb', line 39

def help
  _(
    "<p>Enter the <b>IP Address</b> (for example: <tt>192.168.100.99</tt>) " \
    "for your computer, and the \n" \
    " <b>Remote IP Address</b> (for example: <tt>192.168.100.254</tt>)\n" \
    "for your peer.</p>\n"
  )
end

#initObject



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

def init
  self.value = @settings.remote_ip
end

#labelObject



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

def label
  _("R&emote IP Address")
end

#storeObject



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

def store
  @settings.remote_ip = value
end

#validateObject



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

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

  Yast::Popup.Error(_("The remote IP address is invalid.") + "\n" + Yast::IP.Valid4)
end