Skip to content

Commit

Permalink
Added widged for setting hostname via DHCP per interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Nov 22, 2016
1 parent 2043869 commit 7f4c7b6
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/include/network/services/dns.rb
Expand Up @@ -131,13 +131,27 @@ def initialize_network_services_dns(include_target)
"DHCP_HOSTNAME" => {
"widget" => :custom,
"custom_widget" => HBox(
CheckBox(Id("DHCP_HOSTNAME"), _("&Change Hostname via DHCP default"), true),
CheckBox(Id("DHCP_HOSTNAME"), _("Change Hostname via DHCP default"), true),
ReplacePoint(Id("dh_host_text"), Empty())
),
# help
"help" => Ops.get_string(@help, "dhcp_hostname", ""),
"init" => fun_ref(method(:InitDhcpHostname), "void (string)")
},
"DHCP_IFACES" => {
"widget" => :custom,
"custom_widget" => HBox(
Label(_("&DHCP interface used for hostname setup")),
HSpacing(2),
ComboBox(
Id("DHCP_IFACES"),
"",
[]
),
ReplacePoint(Id("dh_host_text"), Empty())
),
"init" => fun_ref(method(:InitDhcpIfaces), "void (string)")
},
"WRITE_HOSTNAME" => {
"widget" => :checkbox,
# checkbox label
Expand Down Expand Up @@ -244,9 +258,9 @@ def initialize_network_services_dns(include_target)
Frame(
_("Hostname via DHCP"),
VBox(
HBox(
# CheckBox label
VBox(
Left("DHCP_HOSTNAME"),
Left("DHCP_IFACES"),
Left("WRITE_HOSTNAME")
)
)
Expand Down Expand Up @@ -279,6 +293,7 @@ def initialize_network_services_dns(include_target)
"HOSTNAME_GLOBAL",
"DOMAIN",
"DHCP_HOSTNAME",
"DHCP_IFACES",
"WRITE_HOSTNAME",
"MODIFY_RESOLV",
"PLAIN_POLICY",
Expand Down Expand Up @@ -458,6 +473,11 @@ def InitDhcpHostname(_key)
nil
end

# Init handler for DHCP_IFACES
def InitDhcpIfaces(_key)
nil
end

# Event handler for resolver data (nameservers, searchlist)
# enable or disable: is DHCP available?
# @param [String] key the widget receiving the event
Expand Down

0 comments on commit 7f4c7b6

Please sign in to comment.