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


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

def initialize(settings)
  textdomain "network"

  @settings = settings
end

Instance Method Details

#helpObject


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

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


46
47
48
# File 'src/lib/y2network/widgets/remote_ip.rb', line 46

def init
  self.value = @settings.remote_ip
end

#labelObject


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

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

#storeObject


50
51
52
# File 'src/lib/y2network/widgets/remote_ip.rb', line 50

def store
  @settings.remote_ip = value
end

#validateObject


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

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

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