Hello community, here is the log from the commit of package yast2-network checked in at Thu May 31 21:18:54 CEST 2007. -------- --- yast2-network/yast2-network.changes 2007-05-30 11:36:05.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2-network/yast2-network.changes 2007-05-31 17:47:26.000000000 +0200 @@ -1,0 +2,6 @@ +Thu May 31 17:44:21 CEST 2007 - mzugec@suse.cz + +- merge code for select interfaces in InternetTest and Dsl (#117426) +- 2.15.38 + +------------------------------------------------------------------- Old: ---- yast2-network-2.15.37.tar.bz2 New: ---- yast2-network-2.15.38.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.U15564/_old 2007-05-31 21:18:49.000000000 +0200 +++ /var/tmp/diff_new_pack.U15564/_new 2007-05-31 21:18:49.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-network (Version 2.15.37) +# spec file for package yast2-network (Version 2.15.38) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,12 +11,12 @@ # norootforbuild Name: yast2-network -Version: 2.15.37 +Version: 2.15.38 Release: 1 License: GNU General Public License (GPL) Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-network-2.15.37.tar.bz2 +Source0: yast2-network-2.15.38.tar.bz2 prefix: /usr # should be required by devtools BuildRequires: perl-XML-Writer pkgconfig rpm @@ -52,7 +52,7 @@ Michal Svec <msvec@suse.cz> %prep -%setup -n yast2-network-2.15.37 +%setup -n yast2-network-2.15.38 %build %{prefix}/bin/y2tool y2autoconf @@ -108,6 +108,9 @@ /usr/share/YaST2/schema/autoyast/rnc/proxy.rnc %changelog +* Thu May 31 2007 - mzugec@suse.cz +- merge code for select interfaces in InternetTest and Dsl (#117426) +- 2.15.38 * Wed May 30 2007 - mzugec@suse.cz - fixed spec requirements * Tue May 29 2007 - mzugec@suse.cz ++++++ yast2-network-2.15.37.tar.bz2 -> yast2-network-2.15.38.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.37/src/dsl/dialogs.ycp new/yast2-network-2.15.38/src/dsl/dialogs.ycp --- old/yast2-network-2.15.37/src/dsl/dialogs.ycp 2007-05-30 11:34:28.000000000 +0200 +++ new/yast2-network-2.15.38/src/dsl/dialogs.ycp 2007-05-31 17:46:35.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Configuration dialogs for DSL * Authors: Michal Svec <msvec@suse.cz> * - * $Id: dialogs.ycp 38187 2007-05-30 09:34:28Z mzugec $ + * $Id: dialogs.ycp 38227 2007-05-31 15:46:34Z mzugec $ */ { @@ -106,33 +106,21 @@ /** */ - define void UpdateInterfaces() { - ifaces = NetworkDevices::List("eth"); - y2debug("ifaces=%1", ifaces); - ifaces = union(ifaces, NetworkDevices::List("eth-pcmcia")); - y2debug("ifaces=%1", ifaces); - ifaces = union(ifaces, NetworkDevices::List("eth-usb")); - ifaces = union(ifaces, NetworkDevices::List("wlan")); // #186102 - y2debug("ifaces=%1", ifaces); - + // define void UpdateInterfaces() { +list<string> items = getNetDeviceItems(); +if(size(items)>0 && interface=="") interface=items[0]:""; +y2internal("items %1", items); /* FIXME Why is not the current interface added? */ - if(false && /*interface != "" && */!contains(ifaces, interface)) - ifaces = add(ifaces, interface); +if(false && /*interface != "" && */!contains(ifaces, interface)) ifaces = add(ifaces, interface); - y2debug("ifaces=%1", ifaces); - y2internal("ifaces=%1", ifaces); - ifaces = maplist(string e, (list<string>) ifaces, { - return `item(`id(sformat("%1", e)), sformat("%1", e), e == interface); - }); - y2debug("ifaces=%1", ifaces); - } +//} - /* FIXME: #27137 */ - UpdateInterfaces(); - if(size(ifaces) < 1) { + /* FIXME: #suse27137 */ +// UpdateInterfaces(); + if(size(items) < 1) { NetworkDevices::Push(); if(Lan::Propose()) { - UpdateInterfaces(); +// UpdateInterfaces(); // list<term (term (string), string, boolean)> string i = ifaces[0, 0, 0]:""; y2milestone("i=%1", i); @@ -148,11 +136,18 @@ ["USERCONTROL", "STARTMODE",], widget_descr); + +// list<string> items = NetworkDevices::List(""); +// y2internal("network devices list %1", items); + +/* NetworkDevices::Read(); - map <string, string> device_descr = GetDeviceDescription(Internet::device); + map <string, string> device_descr = GetDeviceDescription(items[0]:""); y2internal("device_descr %1", device_descr); string connection_text = _("%1 - %2 (%3)"); +*/ +y2internal("interface %1", interface); /* DSL dialog contents */ term contents = `HBox( `HSpacing(6), @@ -167,23 +162,14 @@ /* TextEntry label */ `TextEntry(`id(`vpivci), _("&VPI/VCI"), vpivci), `VSpacing(0.2), + `Frame(_("&Ethernet Card"), `HBox( - /* ComboBox label */ -// `Left(`ReplacePoint(`id(`rp), `ComboBox(`id(`interface), _("&Ethernet Card"), ifaces))), /* RadioButton label */ - `Left(`ReplacePoint(`id(`rp), `Label(`id(`yes), sformat(connection_text, device_descr["name"]:"", device_descr["type"]:"", device_descr["ipaddr"]:_("No IP address assigned"))))), +// `Left(`ReplacePoint(`id(`rp), `Label(`id(`yes), sformat(connection_text, device_descr["name"]:"", device_descr["type"]:"", device_descr["ipaddr"]:_("No IP address assigned"))))), // push button label - `Right(`PushButton(`id(`net_expert), _("&Change Device"))) - /* TextEntry label */ - // `TextEntry(`id(`interface), _("&Ethernet Card"), interface), -// `HSpacing(1), -/* - `VBox( - `Label(""), - `PushButton(`id(`lan), _("&Configure Network Cards")) - ) -*/ - ), +getDeviceContens(interface) + )), + `PushButton(`id(`lan), _("&Configure Network Cards")), `VSpacing(0.2), /* TextEntry label */ `TextEntry(`id(`modemip), _("Modem &IP Address"), modemip) @@ -207,7 +193,7 @@ UI::ChangeWidget (`id ("STARTMODE"), `Value, startmode); UI::ChangeWidget(`id(`vpivci), `Enabled, pppmode == "pppoatm"); - UI::ChangeWidget(`id(`interface), `Enabled, pppmode == "pppoe"); + enableDevices(pppmode == "pppoe" || pppmode == "pptp"); UI::ChangeWidget(`id(`lan), `Enabled, pppmode == "pppoe" || pppmode == "pptp"); UI::ChangeWidget(`id(`modemip), `Enabled, pppmode == "pptp"); @@ -225,7 +211,7 @@ else if(ret == `next) { /* check_* */ pppmode = (string) UI::QueryWidget(`id(`pppmode), `Value); - interface = (string) UI::QueryWidget(`id(`interface), `Value); +// interface = (string) UI::QueryWidget(`id(`interface), `Value); vpivci = (string) UI::QueryWidget(`id(`vpivci), `Value); modemip = (string) UI::QueryWidget(`id(`modemip), `Value); if(pppmode == "pppoatm" && vpivci == "") { @@ -251,7 +237,8 @@ else if(ret == `pppmode) { pppmode = (string) UI::QueryWidget(`id(`pppmode), `Value); UI::ChangeWidget(`id(`vpivci), `Enabled, pppmode == "pppoatm"); - UI::ChangeWidget(`id(`interface), `Enabled, pppmode == "pppoe" || pppmode == "pptp"); + enableDevices(pppmode == "pppoe"|| pppmode == "pptp"); +// UI::ChangeWidget(`id(`interface), `Enabled, pppmode == "pppoe" || pppmode == "pptp"); UI::ChangeWidget(`id(`lan), `Enabled, pppmode == "pppoe" || pppmode == "pptp"); UI::ChangeWidget(`id(`modemip), `Enabled, pppmode == "pptp"); continue; @@ -261,11 +248,14 @@ NetworkDevices::Push(); Call::Function("lan_proposal", ["AskUser"]); NetworkDevices::Pop(); - interface = (string) UI::QueryWidget(`id(`interface), `Value); - UpdateInterfaces(); - UI::ReplaceWidget(`id(`rp), `ComboBox(`id(`interface), _("&Ethernet Card"), ifaces)); + items = getNetDeviceItems(); + refreshDevice(interface); +// interface = (string) UI::QueryWidget(`id(`interface), `Value); +// UpdateInterfaces(); +// UI::ReplaceWidget(`id(`rp), `ComboBox(`id(`interface), _("&Ethernet Card"), ifaces)); continue; } + else if (ret == `net_expert) interface = handleDevice (items, interface); else { y2error("Unexpected return code: %1", ret); continue; @@ -277,7 +267,7 @@ DSL::pppmode = pppmode; if(pppmode == "pppoe" || pppmode == "pptp") { - DSL::interface = (string) UI::QueryWidget(`id(`interface), `Value); + DSL::interface = interface;//(string) UI::QueryWidget(`id(`interface), `Value); // If firewall is active and interface in no zone, nothing // gets through (#47309) so add it to the external zone if (SuSEFirewall4Network::IsOn ()) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.37/src/installation/dialogs.ycp new/yast2-network-2.15.38/src/installation/dialogs.ycp --- old/yast2-network-2.15.37/src/installation/dialogs.ycp 2007-05-30 10:36:14.000000000 +0200 +++ new/yast2-network-2.15.38/src/installation/dialogs.ycp 2007-05-31 17:46:35.000000000 +0200 @@ -5,7 +5,7 @@ * Authors: Michal Svec <msvec@suse.cz> * Arvin Schnell <arvin@suse.de> * - * $Id: dialogs.ycp 35386 2007-01-16 12:37:52Z kmachalkova $ + * $Id: dialogs.ycp 38227 2007-05-31 15:46:34Z mzugec $ */ { @@ -21,6 +21,7 @@ import "String"; import "Wizard"; include "network/routines.ycp"; +include "network/widgets.ycp"; /** * Ask for password if required @@ -57,37 +58,6 @@ return ret == `ok; } -define map <string, string> GetDeviceDescription(string device_id) { - - string device_name = NetworkDevices::GetValue(device_id,"NAME"); - - if ( (device_name == nil) || (device_name == "") ) { - //TRANSLATORS: Informs that device name is not known - device_name = _("Unknown device"); - } - //avoid too long device names - if (size(device_name) > 30) { - device_name = substring (device_name, 0, 27) + "..."; - } - - string ip_addr = (NetworkDevices::GetValue(device_id, "BOOTPROTO") == "dhcp" ? - // TRANSLATORS: Informs that the IP address is assigned via DHCP - _("DHCP address") : - NetworkDevices::GetValue(device_id, "IPADDR")); - if ( (ip_addr == nil) || (ip_addr == "")) { - //TRANSLATORS: Informs that no IP has been assigned to the device - ip_addr = _("No IP address assigned"); - } - - map <string, string> ret = $[ - - "type" : NetworkDevices::GetDeviceType(device_id), - "name" : device_name, - "ipaddr" : ip_addr, - ]; - - return ret; -} /** * Connection steps dialog @@ -126,24 +96,21 @@ activate the test procedure."), ]; - if(haskey(labels, Internet::type)) - label = labels[Internet::type]:""; + if(haskey(labels, Internet::type)) label = labels[Internet::type]:""; + +list<string> items = getEthernetItems(); boolean already_up = false; if(!Mode::test ()) already_up = Internet::Status(); - /* Label text - selected network device to network test */ - string connection_text = _("&Yes, Test Connection to the Internet\nvia %1 - %2 (%3)"); - map <string, string> device_descr = GetDeviceDescription(Internet::device); - +string current = Internet::device; /* Radiobuttons */ term buttons = `VBox( `VSpacing(1), /* RadioButton label */ - `Left(`ReplacePoint(`id(`rp), `RadioButton(`id(`yes), sformat(connection_text, device_descr["name"]:"", device_descr["type"]:"", device_descr["ipaddr"]:_("No IP address assigned")), Internet::do_test))), - // push button label - `Right(`PushButton(`id(`net_expert), _("&Change Device"))), + `Left(`RadioButton(`id(`yes), `opt(`notify), _("&Yes, Test Connection to the Internet via"), Internet::do_test)), + getDeviceContens(current), /* RadioButton label */ - `Left(`RadioButton(`id(`no), _("N&o, Skip This Test"), !Internet::do_test)), + `Left(`RadioButton(`id(`no), `opt(`notify), _("N&o, Skip This Test"), !Internet::do_test)), `VSpacing(1) ); @@ -190,55 +157,41 @@ Wizard::SetContents(caption, contents, help, true, true); Wizard::SetTitleIcon ("yast-network"); +initDevice(items); - list<string> items = NetworkDevices::List(""); - items = filter (string i, items, ``( i != "lo" )); - y2milestone("network devices list %1", items); - if (items == [] || items == ["lo"]) // #146167 - { - // no interesting ifcfgs, ask ip - items = Internet::GetDevices (); - } - //If only one device is present, disable "Change device" button - if (size(items) <= 1){ - UI::ChangeWidget(`id(`net_expert),`Enabled,false); - } - - any ret = nil; - - while(true) + symbol ret = nil; + boolean exit=false; + do { - ret = UI::UserInput(); - - if (ret == `net_expert) + ret = (symbol)UI::UserInput(); + switch( ret ) { - import "NetworkPopup"; - // popup dialog title - string via_device = NetworkPopup::ChooseItem(_("Network Device Select"), items, Internet::device); - if (via_device != nil) - { - map <string, string> device_descr = GetDeviceDescription(via_device); - Internet::SetDevice( via_device ); - UI::ReplaceWidget(`id(`rp), `RadioButton(`id(`yes), sformat(connection_text, device_descr["name"]:"", device_descr["type"]:"", device_descr["ipaddr"]:""), Internet::do_test)); - y2milestone("selected network device :%1", via_device); - } - } - else if (ret == `abort || ret == `cancel) - { - if (Popup::ConfirmAbort (`incomplete)) + case `net_expert : + current = handleDevice(items, current); break; - } - else if (ret == `next || ret == `back) - { + case `abort: + case `cancel: + if (Popup::ConfirmAbort (`incomplete)){ + exit=true; + break; + } + case `next: + case `back: + exit=true; break; + case `yes: + enableDevices(true); + break; + case `no: + enableDevices(false); + break; + default: + y2error("Unexpected return code:%1", ret); + } - else - { - y2error("Unexpected return code: %1", ret); - } - } + }while(!exit); Internet::do_test = UI::QueryWidget(`id(`rb), `CurrentButton) == `yes; y2debug("Internet::do_test=%1", Internet::do_test); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.37/src/modules/Lan.ycp new/yast2-network-2.15.38/src/modules/Lan.ycp --- old/yast2-network-2.15.37/src/modules/Lan.ycp 2007-05-29 12:58:20.000000000 +0200 +++ new/yast2-network-2.15.38/src/modules/Lan.ycp 2007-05-31 17:46:35.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Network card data * Authors: Michal Svec <msvec@suse.cz> * - * $Id: Lan.ycp 38170 2007-05-29 10:58:19Z mzugec $ + * $Id: Lan.ycp 38227 2007-05-31 15:46:34Z mzugec $ * * Representation of the configuration of network cards. * Input and output routines. @@ -1712,10 +1712,11 @@ /* Some HW found -> use it for proposal */ if(size(Hardware) > 0) { - if (Arch::s390()){ +// if (Arch::s390()){ // tosel = FindMatchingDevice( $["device":sformat("%1-id-%2",InstallInf["module"]:"", InstallInf["hwaddr"]:"")] ); - } - else tosel = FindMatchingDevice($[]); +// } +// else + tosel = FindMatchingDevice($[]); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.37/src/routines/widgets.ycp new/yast2-network-2.15.38/src/routines/widgets.ycp --- old/yast2-network-2.15.37/src/routines/widgets.ycp 2007-04-12 15:59:08.000000000 +0200 +++ new/yast2-network-2.15.38/src/routines/widgets.ycp 2007-05-31 17:46:35.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Widgets for CWM * Authors: Martin Vidner <mvidner@suse.cz> * - * $Id: widgets.ycp 37406 2007-04-11 17:17:50Z kmachalkova $ + * $Id: widgets.ycp 38227 2007-05-31 15:46:34Z mzugec $ */ { @@ -16,6 +16,8 @@ // This is just a start. import "IP"; +import "NetworkPopup"; +import "NetworkDevices"; /** * Validator for IP adresses, no_popup @@ -78,26 +80,6 @@ "opt": [], "help": _("<p>H</p>"), ], -/* - "": $[ - "widget": `, - "label": _(""), - "opt": [], - "help": _("<p>H</p>"), - ], - "": $[ - "widget": `, - "label": _(""), - "opt": [], - "help": _("<p>H</p>"), - ], - "": $[ - "widget": `, - "label": _(""), - "opt": [], - "help": _("<p>H</p>"), - ], -*/ ]; /** @@ -200,5 +182,87 @@ return ret; } + +define string GetDeviceDescription(string device_id) { + string device_name = NetworkDevices::GetValue(device_id,"NAME"); + if ( (device_name == nil) || (device_name == "") ) { + //TRANSLATORS: Informs that device name is not known + device_name = _("Unknown device"); + } + //avoid too long device names + if (size(device_name) > 30) { + device_name = substring (device_name, 0, 27) + "..."; + } + string ip_addr = (NetworkDevices::GetValue(device_id, "BOOTPROTO") == "dhcp" ? + // TRANSLATORS: Informs that the IP address is assigned via DHCP + _("DHCP address") : + NetworkDevices::GetValue(device_id, "IPADDR")); + if ( (ip_addr == nil) || (ip_addr == "")) { + //TRANSLATORS: Informs that no IP has been assigned to the device + ip_addr = _("No IP address assigned"); + } + string output = sformat(_("%1 - %2 (%3)"), + device_name, NetworkDevices::GetDeviceType(device_id), ip_addr); + return output; +} + + + +list<string> getEthernetItems(){ + NetworkDevices::Read(); + list<string> items = NetworkDevices::List("eth"); + items = filter (string i, items, ``( i != "lo" )); + y2internal("network devices list %1", items); + return items; +} + +list<string> getNetDeviceItems(){ + NetworkDevices::Read(); + list<string> ifaces = NetworkDevices::List("eth"); + y2debug("ifaces=%1", ifaces); + ifaces = (list<string>)union((list)ifaces, (NetworkDevices::List("eth-pcmcia"))); + y2debug("ifaces=%1", ifaces); + ifaces = (list<string>)union((list)ifaces, NetworkDevices::List("eth-usb")); + ifaces = (list<string>)union((list)ifaces, NetworkDevices::List("wlan")); // #186102 + y2debug("ifaces=%1", ifaces); + return ifaces; +} + +term getDeviceContens(string selected){ +return `VBox( + `VSpacing(1), + `Left(`Label(`id(`net_device), GetDeviceDescription(selected))), + `Right(`PushButton(`id(`net_expert), _("&Change Device"))), + `VSpacing(1) + ); +} + + +void initDevice(list<string> items){ + //If only one device is present, disable "Change device" button + if (size(items) <= 1) UI::ChangeWidget(`id(`net_expert),`Enabled,false); +} + +void enableDevices(boolean enable){ + UI::ChangeWidget(`net_device, `Enabled, enable); + UI::ChangeWidget(`net_expert, `Enabled, enable); +} + +void refreshDevice(string via_device){ + UI::ChangeWidget(`net_device, `Value, GetDeviceDescription(via_device)); +} + +string handleDevice(list<string>items, string selected){ + // popup dialog title + string via_device = NetworkPopup::ChooseItem(_("Network Device Select"), items, selected); + if (via_device != nil) + { + UI::ChangeWidget(`net_device, `Value, GetDeviceDescription(via_device)); + y2milestone("selected network device :%1", via_device); + selected = via_device; + } + return selected; +} + /* EOF */ } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.37/VERSION new/yast2-network-2.15.38/VERSION --- old/yast2-network-2.15.37/VERSION 2007-05-29 12:56:36.000000000 +0200 +++ new/yast2-network-2.15.38/VERSION 2007-05-31 17:44:18.000000000 +0200 @@ -1 +1 @@ -2.15.37 +2.15.38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org