travis-ci
551 of 551 new or added lines in 20 files covered. (100.0%)
5066 of 9233 relevant lines covered (54.87%)
5.17 hits per line
|
require "yast"
|
1✔ |
|
require "cwm/common_widgets"
|
1✔ |
3 |
|
|
|
Yast.import "IP" |
1✔ |
|
Yast.import "Popup" |
1✔ |
6 |
|
|
|
module Y2Network |
1✔ |
|
module Widgets |
1✔ |
|
class IPAddress < CWM::InputField |
1✔ |
|
def initialize(settings) |
1✔ |
|
textdomain "network"
|
5✔ |
12 |
|
|
|
@settings = settings
|
5✔ |
14 |
end
|
|
15 |
|
|
|
def label |
1✔ |
|
_("&IP Address")
|
1✔ |
18 |
end
|
|
19 |
|
|
|
def help |
1✔ |
21 |
# TODO: write it
|
|
|
""
|
1✔ |
23 |
end
|
|
24 |
|
|
|
def opt |
1✔ |
|
[:hstretch]
|
2✔ |
27 |
end
|
|
28 |
|
|
|
def init |
1✔ |
|
self.value = @settings["IPADDR"] |
× |
31 |
end
|
|
32 |
|
|
|
def store |
1✔ |
|
@settings["IPADDR"] = value |
× |
35 |
end
|
|
36 |
|
|
|
def validate |
1✔ |
|
return true if Yast::IP.Check(value) |
1✔ |
39 |
|
|
|
Yast::Popup.Error(_("No valid IP address.")) |
1✔ |
|
focus |
1✔ |
|
false
|
1✔ |
43 |
end
|
|
44 |
end
|
|
45 |
end
|
|
46 |
end
|