diff --git a/SWUpdateGUI.lua b/SWUpdateGUI.lua index 59b8083..52c841b 100755 --- a/SWUpdateGUI.lua +++ b/SWUpdateGUI.lua @@ -336,6 +336,7 @@ function NetWindow:setRecord(fields) end net:setip(dhcp,checkip(fields[3], "192.168.0.1"), checkip(fields[4], "255.255.255.0")) + net:enable(dhcp) if (fields[1] == INTF_GATEWAY) then net:setip(dhcp,checkip(fields[3], "192.168.0.1"), "0.0.0.0") net:justaddress() @@ -670,6 +671,8 @@ app = ui.Application:new g:setValue("SelectedLine", g:getItem(1), true) g:moveLine(1, true) end + g = app:getById("network-fields") + g:deactivate() end, }, diff --git a/SWUpdateGUI_ipaddress.lua b/SWUpdateGUI_ipaddress.lua index 8669331..4b932f1 100755 --- a/SWUpdateGUI_ipaddress.lua +++ b/SWUpdateGUI_ipaddress.lua @@ -101,7 +101,6 @@ function NetAddress.new(class, self, defaultip, defaultnetmask) self = self or { } self.Class = "netaddress" - print(defaultip, defaultnetmask) self.defaultip = defaultip self.defaultnetmask = defaultnetmask self.grp = ui.Group.new(class, self) @@ -142,6 +141,12 @@ function NetAddress:justaddress() self.netmask:enable(false) end +function NetAddress:deactivate() + self.dhcp:setValue("Disabled", true) + self.ip:enable(false) + self.netmask:enable(false) +end + function NetAddress:setip(endhcp, ip, netmask, gateway) self.dhcp:setValue("Disabled", false) self.dhcp:setValue("Selected", endhcp)