-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No token ring anymore #52
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1610,16 +1610,6 @@ def Common_HostManagementDialog | |
Left( | ||
TextEntry(Id("hosthwaddress"), _("&Hardware Address")) | ||
), | ||
# Radiobutton label - network type of the host | ||
RadioButtonGroup( | ||
Id("network_type"), | ||
HBox( | ||
Left( | ||
RadioButton(Id("ethernet"), _("&Ethernet"), true) | ||
), | ||
Left(RadioButton(Id("token-ring"), _("&Token Ring"))) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
|
@@ -1670,11 +1660,6 @@ def SelectItem(id) | |
:Value, | ||
Ops.get(opts, "hardware", "") | ||
) | ||
UI.ChangeWidget( | ||
Id("network_type"), | ||
:CurrentButton, | ||
Ops.get(opts, "type", "ethernet") | ||
) | ||
|
||
nil | ||
end | ||
|
@@ -1733,11 +1718,9 @@ def HostManagementInit(key) | |
Item( | ||
Id(id2), | ||
id2, | ||
Ops.get(opts, "ip", ""), | ||
Ops.get(opts, "hardware", ""), | ||
Ops.get(opts, "type", "ethernet") == "ethernet" ? | ||
_("Ethernet") : | ||
_("Token Ring") | ||
opts.fetch("ip", ""), | ||
opts.fetch("hardware", ""), | ||
_("Ethernet") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can remove this column in table? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another place where I was not sure. I'll remove it. |
||
) | ||
end | ||
|
||
|
@@ -1783,18 +1766,7 @@ def PrepareDirectives | |
end | ||
|
||
value = Convert.to_string(UI.QueryWidget(Id("hosthwaddress"), :Value)) | ||
if Ops.greater_than(Builtins.size(value), 0) | ||
# FIXME: validation | ||
type = Convert.to_string( | ||
UI.QueryWidget(Id("network_type"), :CurrentButton) | ||
) | ||
directives = Builtins.add( | ||
directives, | ||
{ "key" => "hardware", "value" => Ops.add(Ops.add(type, " "), value) } | ||
) | ||
end | ||
|
||
deep_copy(directives) | ||
directives << { "key" => "hardware", "value" => "ethernet #{value}" } | ||
end | ||
|
||
def CheckMacAddrFormat | ||
|
@@ -1805,19 +1777,18 @@ def CheckMacAddrFormat | |
addr_type = Convert.to_string( | ||
UI.QueryWidget(Id("network_type"), :CurrentButton) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this widget still exists? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm, it escaped ... will fix |
||
) | ||
if addr_type == "ethernet" || addr_type == "token-ring" | ||
if !Address.CheckMAC(hosthwaddress) | ||
UI.SetFocus(Id("hosthwaddress")) | ||
Report.Error( | ||
Ops.add( | ||
# error popup | ||
_("The hardware address is invalid.\n"), | ||
Address.ValidMAC | ||
) | ||
if !Address.CheckMAC(hosthwaddress) | ||
UI.SetFocus(Id("hosthwaddress")) | ||
Report.Error( | ||
Ops.add( | ||
# error popup | ||
_("The hardware address is invalid.\n"), | ||
Address.ValidMAC | ||
) | ||
return false | ||
end | ||
) | ||
return false | ||
end | ||
|
||
true | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this make sense at all? maybe for backward compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure. I've kept it for compatibility reasons only. AFAIK it is not mandatory anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so at least please add comment that it is just for backward compatibility and maybe after string freeze we can add to help text that it is now noop.