[yast-commit] r62621 - in /trunk/network: VERSION package/yast2-network.changes src/lan/address.ycp src/modules/LanItems.ycp
Author: mzugec Date: Tue Oct 12 17:44:43 2010 New Revision: 62621 URL: http://svn.opensuse.org/viewcvs/yast?rev=62621&view=rev Log: added support for IFPLUGD_PRIORITY (bnc#586376) Modified: trunk/network/VERSION trunk/network/package/yast2-network.changes trunk/network/src/lan/address.ycp trunk/network/src/modules/LanItems.ycp Modified: trunk/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=62621&r1=62620&r2=62621&view=diff ============================================================================== --- trunk/network/VERSION (original) +++ trunk/network/VERSION Tue Oct 12 17:44:43 2010 @@ -1 +1 @@ -2.19.38 +2.19.39 Modified: trunk/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=62621&r1=62620&r2=62621&view=diff ============================================================================== --- trunk/network/package/yast2-network.changes (original) +++ trunk/network/package/yast2-network.changes Tue Oct 12 17:44:43 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Oct 12 01:19:58 CEST 2010 - mzugec@suse.cz + +- added support for IFPLUGD_PRIORITY (bnc#586376) +- 2.19.39 + +------------------------------------------------------------------- Fri Sep 17 11:27:05 CEST 2010 - mzugec@suse.cz - AY: added IPv6 option (bnc#633310) Modified: trunk/network/src/lan/address.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=62621&r1=62620&r2=62621&view=diff ============================================================================== --- trunk/network/src/lan/address.ycp (original) +++ trunk/network/src/lan/address.ycp Tue Oct 12 17:44:43 2010 @@ -89,7 +89,9 @@ void InitAddrWidget (string key) { any value = settings[key]:nil; my2debug ("AW", sformat ("init k: %1, v: %2", key, value)); - UI::ChangeWidget (`id (key), ValueProp (key), value); + // because IFPLUGD_PRIORITY is integer, not string + if (key != "IFPLUGD_PRIORITY") + UI::ChangeWidget (`id (key), ValueProp (key), value); } @@ -340,7 +342,6 @@ UI::ChangeWidget(`id(key), `Value, LanItems::Items[LanItems::current, "ifcfg"]:"" ); } - /** * Remap the buttons to their Wizard Sequencer values * @param key the widget receiving the event @@ -766,6 +767,17 @@ }); } + +void initIfplugdPriority(string key){ + UI::ChangeWidget(`id("IFPLUGD_PRIORITY"), `Value, tointeger(settings["IFPLUGD_PRIORITY"]:"0")); +} + +symbol handleStartmode (string key, map event){ + +UI::ChangeWidget(`id("IFPLUGD_PRIORITY"), `Enabled, (UI::QueryWidget(`id("STARTMODE"), `Value)=="ifplugd")); + return nil; +} + /** * Dialog for setting up IP address * @return dialog result @@ -798,6 +810,7 @@ // general tab: // "IFNAME": ifname, "STARTMODE": LanItems::startmode, + "IFPLUGD_PRIORITY": LanItems::ifplugd_priority, "USERCONTROL": LanItems::usercontrol, // problems when renaming the interface? "FWZONE": fwzone, @@ -858,6 +871,26 @@ wd["STARTMODE"] = MakeStartmode ( ["auto", "ifplugd", "hotplug", "manual", "off", "nfsroot" ]); + wd["STARTMODE", "handle"] = handleStartmode; + wd["STARTMODE", "opt"] = [`notify]; + + wd["IFPLUGD_PRIORITY"] = $[ + "widget": `intfield, + "minimum":0, + "maximum":100, + // Combo box label - when to activate device (e.g. on boot, manually, never,..) + "label": _("Ifplugd priority"), + "help": + // Device activation main help. The individual parts will be + // substituted as %1 +_("<p><b><big>IFPLUGD PRIORITY</big></b></p> +<p> All interfaces configured with <b>On Cable Connection</b> and with IFPLUGD_PRIORITY != 0 will be + used mutually exclusive. If more then one of these interfaces is <b>On Cable Connection</b> + then we need a way to decide which interface to take up. Therefore we have to + set the priority of each interface. </p> +"), + "init": initIfplugdPriority + ]; wd["IFCFGTYPE", "items"] = BuildTypesListCWM (device_types); wd["IFCFGID", "items"] = [[settings["IFCFGID"]:"", @@ -986,7 +1019,7 @@ `VBox( // TODO: // "MANDATORY", - `Frame( _("Device Activation"), `HBox(("STARTMODE"), `HStretch())), + `Frame( _("Device Activation"), `HBox(("STARTMODE"), ("IFPLUGD_PRIORITY"), `HStretch())), `VSpacing(0.4), `Frame(_("Firewall Zone"), `HBox(("FWZONE"), `HStretch())), `VSpacing(0.4), @@ -1069,6 +1102,10 @@ string ifcfgname = LanItems::Items[LanItems::current, "ifcfg"]:"";//settings["IFCFGID"]:""; // general tab LanItems::startmode = settings["STARTMODE"]:""; + if (LanItems::startmode=="ifplugd"){ + string ifp_prio=tostring(UI::QueryWidget(`id("IFPLUGD_PRIORITY"), `Value)); + if(ifp_prio!=nil) LanItems::ifplugd_priority=ifp_prio; + } LanItems::usercontrol = settings["USERCONTROL"]:false; if (fw_is_installed) { Modified: trunk/network/src/modules/LanItems.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp?rev=62621&r1=62620&r2=62621&view=diff ============================================================================== --- trunk/network/src/modules/LanItems.ycp (original) +++ trunk/network/src/modules/LanItems.ycp Tue Oct 12 17:44:43 2010 @@ -62,6 +62,7 @@ global string prefix = ""; global string startmode = "auto"; +global string ifplugd_priority = "0"; global boolean usercontrol = false; global string mtu = ""; global string ethtool_options = ""; @@ -827,6 +828,7 @@ mtu = GetDeviceVar (devmap, defaults, "MTU"); ethtool_options = GetDeviceVar (devmap, defaults, "ETHTOOL_OPTIONS"); startmode = GetDeviceVar (devmap, defaults, "STARTMODE"); + ifplugd_priority = GetDeviceVar (devmap, defaults, "IFPLUGD_PRIORITY"); usercontrol = GetDeviceVar (devmap, defaults, "USERCONTROL") == "yes"; description = GetDeviceVar (devmap, defaults, "NAME"); bond_option = GetDeviceVar(devmap, defaults, "BONDING_MODULE_OPTS"); @@ -900,6 +902,7 @@ "ETHTOOL_OPTIONS": "", "NAME": "", "STARTMODE": "manual", + "IFPLUGD_PRIORITY": "0", "USERCONTROL": "no", "WIRELESS_MODE": "Managed", "WIRELESS_ESSID": "", @@ -1019,7 +1022,6 @@ "wlan": "10", ]; - /** * Commit pending operation * @return true if success @@ -1046,9 +1048,15 @@ // it is not in Select yet because we don't have a widget for it if (startmode == "ifplugd") { +/* string prio = ifplugd_priorities[type]:""; newdev["IFPLUGD_PRIORITY"] = prio; - } +*/ + if (ifplugd_priority!=nil) + newdev["IFPLUGD_PRIORITY"] = ifplugd_priority; + else + newdev["IFPLUGD_PRIORITY"] = ifplugd_priorities[type]:"0"; + } // else if (haskey(newdev, "IFPLUGD_PRIORITY"))newdev = remove(newdev, "IFPLUGD_PRIORITY"); newdev["USERCONTROL"] = usercontrol? "yes": "no"; newdev["BOOTPROTO"] = bootproto; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mzugec@svn2.opensuse.org