|
Lines 89-94
void StoreAddrWidget (string key, map ev
Link Here
|
| 89 |
} |
89 |
} |
| 90 |
|
90 |
|
| 91 |
/** |
91 |
/** |
|
|
92 |
* Default function to init the value of slave devices box. |
| 93 |
* @param key id of the widget |
| 94 |
*/ |
| 95 |
void InitSlave(string key) |
| 96 |
{ |
| 97 |
UI::ChangeWidget(`id(key), `SelectedItems, settings["SLAVES"]:[]); |
| 98 |
} |
| 99 |
|
| 100 |
/** |
| 101 |
* Default function to store the value of slave devices box. |
| 102 |
* @param key id of the widget |
| 103 |
* @param key id of the widget |
| 104 |
*/ |
| 105 |
void StoreSlave(string key, map event) |
| 106 |
{ |
| 107 |
settings["SLAVES"] = (list<string>)UI::QueryWidget (`id(key), `SelectedItems); |
| 108 |
} |
| 109 |
|
| 110 |
/** |
| 92 |
* Initialize a RadioButtonGroup |
111 |
* Initialize a RadioButtonGroup |
| 93 |
* Group called FOO has buttons FOO_bar FOO_qux and values bar qux |
112 |
* Group called FOO has buttons FOO_bar FOO_qux and values bar qux |
| 94 |
* @param key id of the widget |
113 |
* @param key id of the widget |
|
Lines 417-422
the firewall will be disabled.</p>"),
Link Here
|
| 417 |
"handle": HandleIfcfg, |
436 |
"handle": HandleIfcfg, |
| 418 |
], |
437 |
], |
| 419 |
|
438 |
|
|
|
439 |
"BONDSLAVE": $[ |
| 440 |
"widget": `multi_selection_box, |
| 441 |
"label": _("Bond Slaves"), |
| 442 |
"opt": [`shrinkable], |
| 443 |
"items" : [ ], |
| 444 |
"init": InitSlave, |
| 445 |
"store": StoreSlave, |
| 446 |
"help": _("<p>Select the salve devices for the bond device. Only the deveices which's Device Activation is Never and set as None Address Setup are available.</p>"), |
| 447 |
], |
| 448 |
|
| 449 |
"BONDOPTION": $[ |
| 450 |
"widget": `combobox, |
| 451 |
/* ComboBox label */ |
| 452 |
"label": _("Bond Driver Options"), |
| 453 |
"opt": [`hstretch, `editable], |
| 454 |
"help": _("<p>Select the bond driver options, and edit it if you need. </p>"), |
| 455 |
"items": [["mode=balance-rr"], ["mode=active-backup"], ["mode=balance-xor"], |
| 456 |
["mode=broadcast"], ["mode=802.3ad"], ["mode=balance-tlb"], ["mode=balance-alb"]], |
| 457 |
], |
| 458 |
|
| 420 |
"BOOTPROTO": $[ |
459 |
"BOOTPROTO": $[ |
| 421 |
"widget": `empty, |
460 |
"widget": `empty, |
| 422 |
"help": "", |
461 |
"help": "", |
|
Lines 425-430
the firewall will be disabled.</p>"),
Link Here
|
| 425 |
"store": StoreWidgetRbg, |
464 |
"store": StoreWidgetRbg, |
| 426 |
], |
465 |
], |
| 427 |
|
466 |
|
|
|
467 |
"BOOTPROTO_none": $[ |
| 468 |
"widget": `radio_button, |
| 469 |
// radio button label |
| 470 |
"label": _("None Address Setup"), |
| 471 |
"opt": [`notify], |
| 472 |
"init": CWM::InitNull, |
| 473 |
"store": CWM::StoreNull |
| 474 |
], |
| 475 |
|
| 428 |
"BOOTPROTO_dhcp": $[ |
476 |
"BOOTPROTO_dhcp": $[ |
| 429 |
"widget": `radio_button, |
477 |
"widget": `radio_button, |
| 430 |
// radio button label |
478 |
// radio button label |
|
Lines 435-440
the firewall will be disabled.</p>"),
Link Here
|
| 435 |
"help": |
483 |
"help": |
| 436 |
/* Address dialog help 2-6/8: dynamic address preferred */ |
484 |
/* Address dialog help 2-6/8: dynamic address preferred */ |
| 437 |
/* Address dialog help 2/8 */ |
485 |
/* Address dialog help 2/8 */ |
|
|
486 |
_("<p>You can select none address setup if you don't want any IP address.</p>") + |
| 487 |
|
| 438 |
_("<p>You can select dynamic address assignment |
488 |
_("<p>You can select dynamic address assignment |
| 439 |
if you have a <b>DHCP server</b> running on your local network.</p> |
489 |
if you have a <b>DHCP server</b> running on your local network.</p> |
| 440 |
") + |
490 |
") + |
|
Lines 743-749
define any AddressDialog() {
Link Here
|
| 743 |
} |
793 |
} |
| 744 |
|
794 |
|
| 745 |
// FIXME duplicated in hardware.ycp |
795 |
// FIXME duplicated in hardware.ycp |
| 746 |
list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan" ]; |
796 |
list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond" ]; |
| 747 |
|
797 |
|
| 748 |
if(Arch::s390 ()) |
798 |
if(Arch::s390 ()) |
| 749 |
device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth", "lcs" ]; |
799 |
device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth", "lcs" ]; |
|
Lines 849-854
Components of this product might not wor
Link Here
|
| 849 |
`id ("BOOTPROTO"), // CWM must not expand `id |
899 |
`id ("BOOTPROTO"), // CWM must not expand `id |
| 850 |
`MarginBox (1, 0, |
900 |
`MarginBox (1, 0, |
| 851 |
`VBox ( |
901 |
`VBox ( |
|
|
902 |
`Left ("BOOTPROTO_none"), |
| 852 |
`Left ("BOOTPROTO_dhcp"), // TODO: widget attribute align: left |
903 |
`Left ("BOOTPROTO_dhcp"), // TODO: widget attribute align: left |
| 853 |
`Left ("BOOTPROTO_static"), |
904 |
`Left ("BOOTPROTO_static"), |
| 854 |
address_static_contents) |
905 |
address_static_contents) |
|
Lines 861-872
Components of this product might not wor
Link Here
|
| 861 |
is_ptp? address_p2p_contents: |
912 |
is_ptp? address_p2p_contents: |
| 862 |
(no_dhcp? address_static_contents: address_dhcp_contents); |
913 |
(no_dhcp? address_static_contents: address_dhcp_contents); |
| 863 |
|
914 |
|
| 864 |
term address_contents = `HSquash(`VBox( |
915 |
term bond = `MarginBox(1, 0, `Frame( "", `VBox("BONDSLAVE", "BONDOPTION"))); |
| 865 |
`Left(label), |
916 |
|
| 866 |
just_address_contents, |
917 |
if (Lan::type == "bond") |
| 867 |
frame2, |
918 |
{ |
| 868 |
"_DIALOG" |
919 |
settings["SLAVES"] = Lan::bond_slaves; |
| 869 |
)); |
920 |
|
|
|
921 |
//get all eth devices |
| 922 |
map<string, map<string, map<string, any> > > devices = (map<string, map<string, map<string, any> > >)NetworkDevices::FilterDevices(""); |
| 923 |
map<string, map<string, any> > avails= devices["eth"]:$[]; |
| 924 |
|
| 925 |
//filter the eth devices (BOOT_PROTO=none && START_MODE=off) |
| 926 |
foreach (string num, map<string, any> value, avails, |
| 927 |
{ |
| 928 |
if (((string)value["BOOTPROTO"]:"" == "none") && ((string)value["STARTMODE"]:"" == "off")) |
| 929 |
wd["BONDSLAVE", "items"] = add (wd["BONDSLAVE", "items"]:[], [NetworkDevices::device_name("eth", num)] ); |
| 930 |
}); |
| 931 |
|
| 932 |
settings["BONDOPTION"] = Lan::bond_option; |
| 933 |
|
| 934 |
//fill up the drop list and make the default value first |
| 935 |
wd["BONDOPTION", "items"] = filter(list<string> v, wd["BONDOPTION", "items"]:[], |
| 936 |
{ |
| 937 |
return v[0]:"" != Lan::bond_option; |
| 938 |
}); |
| 939 |
wd["BONDOPTION", "items"] = prepend(wd["BONDOPTION", "items"]:[], [Lan::bond_option]); |
| 940 |
} |
| 941 |
|
| 942 |
|
| 943 |
term address_contents = nil; |
| 944 |
if (Lan::type == "bond") |
| 945 |
{ |
| 946 |
address_contents = `HSquash(`VBox( |
| 947 |
`Left(label), |
| 948 |
just_address_contents, |
| 949 |
bond, |
| 950 |
frame2, |
| 951 |
"_DIALOG" |
| 952 |
)); |
| 953 |
} |
| 954 |
else |
| 955 |
{ |
| 956 |
address_contents = `HSquash(`VBox( |
| 957 |
`Left(label), |
| 958 |
just_address_contents, |
| 959 |
frame2, |
| 960 |
"_DIALOG" |
| 961 |
)); |
| 962 |
} |
| 870 |
|
963 |
|
| 871 |
map functions = $[ |
964 |
map functions = $[ |
| 872 |
"init" : InitAddrWidget, |
965 |
"init" : InitAddrWidget, |
|
Lines 965-970
Components of this product might not wor
Link Here
|
| 965 |
} |
1058 |
} |
| 966 |
} |
1059 |
} |
| 967 |
|
1060 |
|
|
|
1061 |
if (Lan::type == "bond") |
| 1062 |
{ |
| 1063 |
Lan::bond_option = settings["BONDOPTION"]:""; |
| 1064 |
Lan::bond_slaves = (list<string>)settings["SLAVES"]:[]; |
| 1065 |
} |
| 1066 |
|
| 968 |
// proceed with WLAN settings if appropriate, #42420 |
1067 |
// proceed with WLAN settings if appropriate, #42420 |
| 969 |
if (ret == `next && Lan::type == "wlan" && Lan::alias == "") |
1068 |
if (ret == `next && Lan::type == "wlan" && Lan::alias == "") |
| 970 |
{ |
1069 |
{ |