Hello community,

here is the log from the commit of package yast2-network for openSUSE:Factory 
checked in at 2012-08-23 15:32:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-network.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-network", Maintainer is "mfi...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes      
2012-08-04 13:42:55.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 
2012-08-23 15:32:59.000000000 +0200
@@ -1,0 +2,7 @@
+Mon Aug 20 10:53:33 UTC 2012 - mfi...@suse.com
+
+- bnc#754940 - missing help in hw dialog when adding new device.
+- code cleanup
+- 2.24.3 
+
+-------------------------------------------------------------------

Old:
----
  yast2-network-2.24.2.tar.bz2

New:
----
  yast2-network-2.24.3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.XfJ3SF/_old  2012-08-23 15:33:01.000000000 +0200
+++ /var/tmp/diff_new_pack.XfJ3SF/_new  2012-08-23 15:33:01.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        2.24.2
+Version:        2.24.3
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-network-2.24.2.tar.bz2 -> yast2-network-2.24.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-2.24.2/MAINTAINER 
new/yast2-network-2.24.3/MAINTAINER
--- old/yast2-network-2.24.2/MAINTAINER 2012-07-23 10:38:05.000000000 +0200
+++ new/yast2-network-2.24.3/MAINTAINER 2012-08-20 15:43:48.000000000 +0200
@@ -1 +1 @@
-Martin Vidner <mvid...@suse.cz>
+Michal Filka <mfi...@suse.com>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-2.24.2/VERSION 
new/yast2-network-2.24.3/VERSION
--- old/yast2-network-2.24.2/VERSION    2012-07-30 14:44:20.000000000 +0200
+++ new/yast2-network-2.24.3/VERSION    2012-08-20 14:59:34.000000000 +0200
@@ -1 +1 @@
-2.24.2
+2.24.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-2.24.2/src/lan/address.ycp 
new/yast2-network-2.24.3/src/lan/address.ycp
--- old/yast2-network-2.24.2/src/lan/address.ycp        2012-07-23 
12:07:14.000000000 +0200
+++ new/yast2-network-2.24.3/src/lan/address.ycp        2012-08-20 
14:59:34.000000000 +0200
@@ -1219,7 +1219,6 @@
     if (LanItems::type=="br") wd_content["tab_order"]= ["t_general", "t_addr", 
"bridge_ports"];
     if (LanItems::type == "bond") 
wd_content["tab_order"]=add(wd_content["tab_order"]:[], "bond_slaves");
 
-    hw_standalone=false;
     wd = (map<string, map<string,any> >) union (wd, $[
        "tab" : CWMTab::CreateWidget (wd_content)
         ]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-2.24.2/src/lan/hardware.ycp 
new/yast2-network-2.24.3/src/lan/hardware.ycp
--- old/yast2-network-2.24.2/src/lan/hardware.ycp       2012-07-23 
12:07:14.000000000 +0200
+++ new/yast2-network-2.24.3/src/lan/hardware.ycp       2012-08-20 
15:43:48.000000000 +0200
@@ -12,6 +12,7 @@
 textdomain "network";
 
 import "Arch";
+import "CWM";
 import "Label";
 import "Lan";
 import "NetworkInterfaces";
@@ -22,27 +23,52 @@
 include "network/routines.ycp";
 
 /**
- * Manual network card configuration dialog
- * @return dialog result
+ * Determines if the dialog is used for adding new device or for editing 
existing one.
+ *
+ * Some widgets are disabled when creating new device. Also, when editing 
existing device, it is not possible
+ * to e.g. change device type.
+ *
+ * @return false if hardware widgets are embedded into another dialog, 
otherwise true.
+ */
+boolean isNewDevice()
+{
+    return LanItems::operation == `add;
+}
+
+/**
+ * Dynamic initialization of help text.
+ *
+ * @return content of the help
  */
+string initHelp()
+{
     /* Manual network card setup help 1/4 */
     string hw_help = _("<p>Set up hardware-specific options for 
 your network device here.</p>
-") +
+");
 
-    /* Manual network card setup help 2/4 */
-    /* translators: do not translated udev, MAC, BusID*/
-_("<p><b>Udev Rules</b> are rules for the kernel device manager that allow
+    if( isNewDevice())
+    {
+        /* Manual network card setup help 2/4 */
+        /* translators: do not translated udev, MAC, BusID*/
+        hw_help = hw_help + _("<p><b>Device Type</b>. Various device types are 
available, select 
+one according your needs.</p>");
+    }
+    else
+    {
+        hw_help = hw_help + _("<p><b>Udev Rules</b> are rules for the kernel 
device manager that allow
 associating the MAC address or BusID of the network device with its name (for
 example, eth1, wlan0 ) and assures a persistent device name upon reboot.
-") + 
+") 
 
-_("<p><b>Show visible port identification</b> allows you to physically 
identify now configured NIC. 
+    + _("<p><b>Show visible port identification</b> allows you to physically 
identify now configured NIC. 
 Set appropriate time, click <b>Blink</b> and LED diodes on you NIC will start 
blinking for selected time.
-</p>")+
+</p>");
+
+    }
 
     /* Manual network card setup help 2/4 */
-_("<p><b>Kernel Module</b>. Enter the kernel module (driver) name 
+    hw_help = hw_help + _("<p><b>Kernel Module</b>. Enter the kernel module 
(driver) name 
 for your network device here. If the device is already configured, see if 
there is more than one driver available for
 your device in the drop-down list. If necessary, choose a driver from the 
list, but usually the default value works.</p>
 ") +
@@ -55,7 +81,7 @@
 
 _("<p>If you specify options via <b>Ethtool options</b>, ifup will call 
ethtool with these options.</p>\n");
 
-    if(!(LanItems::operation == `edit || Arch::s390 ()))
+    if( isNewDevice() && !Arch::s390() )
     {
 
     /* Manual dialog help 4/4 */
@@ -78,9 +104,10 @@
 in the <b>IBM Device Drivers and Installation Commands</b> manual.</p>");
     }
 
+    return hw_help;
+}
 
 map<string, any> hardware = nil;
-boolean hw_standalone=false;
 
 void initHardware(){
     hardware = $[];
@@ -160,7 +187,7 @@
     );
 
     /* Disable PCMCIA and USB checkboxex on Edit and s390 */
-    if(LanItems::operation == `edit || Arch::s390 ()) CheckBoxes = 
`VSpacing(0);
+    if( !isNewDevice() || Arch::s390 ()) CheckBoxes = `VSpacing(0);
 
        // #116211 - allow user to change modules from list
     /* Frame label */
@@ -206,7 +233,7 @@
          )
         );
 
-    if(LanItems::operation == `edit ) TypeNameWidgets = `Empty();
+    if( !isNewDevice()) TypeNameWidgets = `Empty();
                else UdevWidget = `Empty();
 
    term BlinkCard = `Frame(_("Show visible port identification"),
@@ -227,7 +254,7 @@
 
     term contents =
      `VBox(
-       `HBox(UdevWidget,`HStretch(), (LanItems::operation==`edit) ? BlinkCard 
: `Empty()),
+       `HBox(UdevWidget,`HStretch(), ( isNewDevice()) ? `Empty() : BlinkCard ),
        TypeNameWidgets,
        KernelBox,
        EthtoolWidget,
@@ -242,12 +269,11 @@
     ChangeWidgetIfExists(`id(`hwcfg), `Enabled, hardware["no_hotplug"]:false);
     ChangeWidgetIfExists(`id(`usb), `Enabled, (hardware["hotplug"]:"" == "usb" 
|| hardware["hotplug"]:"" == "") && hardware["type"]:"" != "dummy");
     ChangeWidgetIfExists(`id(`pcmcia), `Enabled, (hardware["hotplug"]:"" == 
"pcmcia" || hardware["hotplug"]:"" == "") && hardware["type"]:"" != "dummy");
-    UI::ChangeWidget(`id(`device_name), `Enabled, false);
-//    UI::ChangeWidget(`id(`options), `Enabled, false);
 
-    UI::ChangeWidget(`id(`device_name), `Value, LanItems::GetItemUdev("NAME"));
+    ChangeWidgetIfExists(`id(`device_name), `Enabled, false);
+    ChangeWidgetIfExists(`id(`device_name), `Value, 
LanItems::GetItemUdev("NAME"));
 
-    if (!hw_standalone) ChangeWidgetIfExists(`id(`dev), `Enabled,false);
+    if (!isNewDevice()) ChangeWidgetIfExists(`id(`dev), `Enabled,false);
     ChangeWidgetIfExists(`id(`num), `ValidChars, 
NetworkInterfaces::ValidCharsIfcfg ());
 //    ChangeWidgetIfExists(`id(`hwcfg), `ValidChars, 
NetworkModules::ValidCharsHwcfg ());
 }
@@ -510,7 +536,7 @@
 }
 
 void storeHW (string key, map event) {
-  if (LanItems::operation==`add){
+  if ( isNewDevice()){
 
     LanItems::type = (string) UI::QueryWidget(`id(`dev), `Value);
     string nm = sformat("%1%2", LanItems::type, (string) 
UI::QueryWidget(`id(`num), `Value));
@@ -552,7 +578,7 @@
 define any S390Dialog() {
     // for virtual devices (no hwinfo) just skip to next dialog (bnc#476490)
     if (size(LanItems::getCurrentItem()["hwinfo"]:$[])==0)
-               return (LanItems::operation==`add) ? `hardware : `next;
+               return ( isNewDevice()) ? `hardware : `next;
 
     // already configured device (on hardware layer), skip this dialog
     if (size(LanItems::Items[LanItems::current, "hwinfo", "dev_name"]:"")>0) 
return `next;
@@ -790,12 +816,16 @@
        "init" : initHwDialog,
        "handle" : handleHW,
        "store" : storeHW,
-       "help" :  hw_help
+       "help" :  initHelp(),
                ]];
 
+/**
+ * Manual network card configuration dialog
+ * @return dialog result
+ */
 any HardwareDialog (){
     string caption = _("Hardware Dialog");
-    hw_standalone = true;
+
     list<map <string, any> > w = CWM::CreateWidgets (["HWDIALOG"], (map 
<string, map <string, any> >) widget_descr_hardware);
         term contents =
                           `VBox(
@@ -816,7 +846,7 @@
     contents = CWM::PrepareDialog(contents, w);
 
     Wizard::OpenNextBackDialog();
-    Wizard::SetContents(caption, contents, "",false, true);
+    Wizard::SetContents(caption, contents, initHelp(),false, true);
     Wizard::SetAbortButton(`cancel, Label::CancelButton());
 //    Wizard::DisableBackButton();
     any ret = CWM::Run(w, $[ /*`abort:ReallyAbort*/ ]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-2.24.2/src/modules/LanItems.ycp 
new/yast2-network-2.24.3/src/modules/LanItems.ycp
--- old/yast2-network-2.24.2/src/modules/LanItems.ycp   2012-07-23 
12:07:14.000000000 +0200
+++ new/yast2-network-2.24.3/src/modules/LanItems.ycp   2012-08-20 
14:59:34.000000000 +0200
@@ -374,15 +374,20 @@
 }
 
 // get list of all configurations for "netcard" macro in NetworkInterfaces 
module
-list<string> getNetworkInterfaces(){
- list<string> confs=[];
- map <string, any> configurations =  
NetworkInterfaces::FilterDevices("netcard");
- foreach(string devtype, 
splitstring(NetworkInterfaces::CardRegex["netcard"]:"", "|"), {
-  foreach(string file, (list<string>) Map::Keys(configurations[devtype]:$[]), {
-   confs = add(confs, file);
-  });
- });
- return confs;
+list<string> getNetworkInterfaces()
+{
+    list<string> confs=[];
+    map <string, any> configurations =  
NetworkInterfaces::FilterDevices("netcard");
+
+    foreach(string devtype, 
splitstring(NetworkInterfaces::CardRegex["netcard"]:"", "|"), 
+    {
+        foreach(string file, (list<string>) 
Map::Keys(configurations[devtype]:$[]), 
+        {
+            confs = add(confs, file);
+        });
+    });
+
+    return confs;
 }
 
 global boolean FindAndSelect(string device){
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-2.24.2/testsuite/tests/include.ycp 
new/yast2-network-2.24.3/testsuite/tests/include.ycp
--- old/yast2-network-2.24.2/testsuite/tests/include.ycp        1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-network-2.24.3/testsuite/tests/include.ycp        2012-08-20 
15:43:48.000000000 +0200
@@ -0,0 +1,4 @@
+// A basic syntax check
+{
+       include "network/lan/hardware.ycp";
+}

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to