push
travis-ci
2170 of 2170 new or added lines in 86 files covered. (100.0%)
5851 of 9434 relevant lines covered (62.02%)
6.61 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"
|
7✔ |
12 |
|
|
|
@settings = settings
|
7✔ |
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
|