Mailinglist Archive: yast-commit (190 mails)
| < Previous | Next > |
[yast-commit] r38163 - in /trunk/network: VERSION package/yast2-network.changes src/lan/address.ycp src/lan/complex.ycp src/lan/hardware.ycp
- From: mzugec@xxxxxxxxxxxxxxxx
- Date: Tue, 29 May 2007 07:04:15 -0000
- Message-id: <20070529070415.95BF7481D7@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Tue May 29 09:04:15 2007
New Revision: 38163
URL: http://svn.opensuse.org/viewcvs/yast?rev=38163&view=rev
Log:
improve add/edit device dialogs (device type)
Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/lan/address.ycp
trunk/network/src/lan/complex.ycp
trunk/network/src/lan/hardware.ycp
Modified: trunk/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Tue May 29 09:04:15 2007
@@ -1 +1 @@
-2.15.35
+2.15.36
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Tue May 29 09:04:15 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue May 29 09:03:20 CEST 2007 - mzugec@xxxxxxx
+
+- improve add/edit device dialogs (device type)
+- 2.15.36
+
+-------------------------------------------------------------------
Mon May 28 17:07:40 CEST 2007 - mzugec@xxxxxxx
- disable routing dialog when NetworkManager used (#178538)
Modified: trunk/network/src/lan/address.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/src/lan/address.ycp (original)
+++ trunk/network/src/lan/address.ycp Tue May 29 09:04:15 2007
@@ -135,14 +135,11 @@
break;
case "none" : UI::ChangeWidget(`id(`bootproto), `CurrentButton, `none);
break;
-
-
}
}
symbol handleBootProto (string key, map event) {
-// if (event["EventReason"]:"" == "ValueChanged"){
boolean none = false;
boolean dynamic = false;
boolean stat = false;
@@ -157,8 +154,6 @@
UI::ChangeWidget(`dyn, `Enabled, dynamic);
UI::ChangeWidget(`ipaddr, `Enabled, stat);
UI::ChangeWidget(`netmask, `Enabled, stat);
-
-// }
return nil;
}
@@ -196,22 +191,13 @@
void initIfcfg (string key) {
UI::ChangeWidget(`id(key), `Value, Lan::type);
+ UI::ChangeWidget(`id(key), `Enabled, false);
}
void initIfcfgId (string key) {
UI::ChangeWidget(`id(key), `Value, Lan::device);
}
-/**
- * Event handler for ifcfg name
- * enable or disable depending on whether we are adding a new interface
- * @param key the widget receiving the event
- * @param event the event being handled
- * @return nil so that the dialog loops on
- */
-symbol HandleIfcfg (string key, map event) {
- UI::ChangeWidget (`id (key), `Enabled, Lan::operation == `add);
- return nil;
-}
+
/**
* Remap the buttons to their Wizard Sequencer values
@@ -300,18 +286,6 @@
}
/**
- * Initialize the dialog as a whole
- * Sets default focus
- * @param key id of the widget
- */
-
-/*
-void InitDialog (string key) {
- UI::SetFocus (`id ("IPADDR"));
-}
-*/
-
-/**
* If the traffic would be blocked, ask the user
* if he wants to change it
* @param event the event being handled
@@ -381,19 +355,6 @@
}
/**
- * Store values computed from the whole dialog
- * @param key the widget being validated
- * @param event the event being handled
- */
-
-/*
-void StoreDialog (string key, map event) {
- return;
-}
-*/
-
-
-/**
* Initialize value of firewall zone widget
* (disables it when SuSEFirewall is not installed)
* @param key id of the widget
@@ -410,7 +371,7 @@
"widget" : `custom,
"custom_widget" :
/* Frame label */
- `Frame(`id(`f_additional), _("Additional Addresses"), `HBox(`HSpacing(3), `VBox(
+ `Frame(`id(`f_additional), _("Additional Addresses"), `HBox(`HSpacing(3), `VBox(
`VSpacing(1),
`Table(`id(`table), `opt(`notify), `header(
/* Table header label */
@@ -498,7 +459,7 @@
"help": "",
// "items" will be filled in the dialog itself
"init" : initIfcfg,
- "handle": HandleIfcfg,
+// "handle": HandleIfcfg,
"validate_type": `function,
"validate_function": ValidateIfcfgType,
],
@@ -511,7 +472,7 @@
"help": "",
"init" : initIfcfgId,
"valid_chars": NetworkDevices::ValidCharsIfcfg (),
- "handle": HandleIfcfg,
+// "handle": HandleIfcfg,
],
"BONDSLAVE": $[
@@ -883,21 +844,16 @@
"tab_help" : "",
"fallback_functions" : functions,
];
-
-// if (Lan::operation == `add) wd_content["initial_tab"] = "hardware";
-
+ hw_standalone=false;
wd = (map<string, map<string,any> >) union (wd, $[
"tab" : CWMTab::CreateWidget (wd_content)
]);
- term contents2 = `HBox ("tab");
-
-
any ret = CWM::ShowAndRun (
$[
"widget_names": ["tab"],
"widget_descr": wd,
- "contents": contents2,
+ "contents": `HBox ("tab"),
/* Address dialog caption */
"caption": _("Network Card Setup"),
"back_button" : Label::BackButton (),
@@ -905,7 +861,7 @@
"fallback_functions" : functions,
]);
y2milestone ("ShowAndRun: %1", ret);
-
+
if (ret != `back && ret != `abort)
{
string ifcfgname = NetworkDevices::device_name (
Modified: trunk/network/src/lan/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/complex.ycp?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/src/lan/complex.ycp (original)
+++ trunk/network/src/lan/complex.ycp Tue May 29 09:04:15 2007
@@ -216,10 +216,8 @@
list<map<string,any> > o_items = nil;
void initOverview (string key) ``{
-// if (o_items == nil){
o_items = (list<map<string,any> >)Lan::Overview();
o_items = o_items + Lan::Unconfigured ();
-// }
list<term> term_items = maplist (map<string,any> i, o_items, {
term t = `item (`id (i["id"]:""));
Modified: trunk/network/src/lan/hardware.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/hardware.ycp?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/src/lan/hardware.ycp (original)
+++ trunk/network/src/lan/hardware.ycp Tue May 29 09:04:15 2007
@@ -61,11 +61,13 @@
_("<p>Options for the module should be written in the format specified
in the <b>IBM Device Drivers and Installation Commands</b> manual.</p>");
}
+
map<string, any> hardware = nil;
+boolean hw_standalone=false;
+
void initHwDialog(string text) {
hardware = $[];
-// ScreenName("lan-hardware");
/* Manual dialog caption */
string caption = _("Manual Network Card Configuration");
@@ -88,7 +90,7 @@
// #38213, remember device id when we switch back from pcmcia/usb
hardware["non_hotplug_device_id"] = hardware["device"]:"";
hardware["hwcfg"] = Lan::nm_name;
-if (Lan::nm_name=="" && Lan::nm_name_old!=nil) hardware["hwcfg"]=Lan::nm_name_old;
+ if (Lan::nm_name=="" && Lan::nm_name_old!=nil) hardware["hwcfg"]=Lan::nm_name_old;
// FIXME duplicated in address.ycp
hardware["device_types"] = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond" ];
@@ -99,10 +101,9 @@
if(Arch::ia64 ())
hardware["device_types"] = add(hardware["device_types"]:[], "xp");
- if(issubstring(hardware["device"]:"", "bus-pcmcia"))
- hardware["hotplug"] = "pcmcia";
- else if(issubstring(hardware["device"]:"", "bus-usb"))
- hardware["hotplug"] = "usb";
+ if(issubstring(hardware["device"]:"", "bus-pcmcia")) hardware["hotplug"] = "pcmcia";
+ else if(issubstring(hardware["device"]:"", "bus-usb")) hardware["hotplug"] = "usb";
+
y2milestone("hotplug=%1", Lan::hotplug);
term CheckBoxes = `HBox(
@@ -124,9 +125,6 @@
`HSpacing(1.5)
);
- /* Pushbutton label */
- term ListButton = `PushButton(`id(`list), _("Select from &List"));
-
/* Disable PCMCIA and USB checkboxex on Edit and s390 */
if(Lan::operation == `edit /* FIXME: unique || Lan::unique != "" */ || Arch::s390 () == true)
CheckBoxes = `VSpacing(0);
@@ -147,6 +145,7 @@
CheckBoxes,
`VSpacing(0.4)
),`HSpacing(0.5)));
+
hardware["devices"] = Lan::FreeDevices(hardware["realtype"]:""); // TODO: id-, bus-, ... here
if(!contains(hardware["devices"]:[], hardware["device"]:"")) hardware["devices"] = prepend(hardware["devices"]:[], hardware["device"]:"");
@@ -156,7 +155,6 @@
/* Manual dialog contents */
term TypeNameWidgets =
-// `Frame(_("Network &Configuration"),
`VBox(
`VSpacing(0.2),
`HBox(
@@ -168,8 +166,6 @@
DeviceNumberBox,
`HSpacing(0.5)
)
-// `VSpacing(0.2)
-// )
);
/* Add hardware -> don't allow some changes (card type) */
@@ -201,7 +197,8 @@
term ButtonBox = `HBox(
`HStretch(),
`HSpacing(0.5),
- ListButton,
+ /* Pushbutton label */
+ `PushButton(`id(`list), _("Select from &List")),
`HSpacing(0.5),
`HStretch()
);
@@ -223,6 +220,7 @@
));
UI::ReplaceWidget(`hw_content, contents);
+
if (Lan::nm_name=="" && Lan::nm_name_old!=nil) UI::ChangeWidget(`enable_hwconfig, `Value, false);
hardware["no_hotplug"] = hardware["hotplug"]:"" == "";
hardware["no_hotplug_dummy"] = hardware["no_hotplug"]:false && hardware["type"]:"" != "dummy";
@@ -232,7 +230,7 @@
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");
-
+ if (!hw_standalone) ChangeWidgetIfExists(`id(`dev), `Enabled,false);
ChangeWidgetIfExists(`id(`num), `ValidChars, NetworkDevices::ValidCharsIfcfg ());
ChangeWidgetIfExists(`id(`hwcfg), `ValidChars, NetworkModules::ValidCharsHwcfg ());
}
@@ -723,6 +721,7 @@
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(
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Tue May 29 09:04:15 2007
New Revision: 38163
URL: http://svn.opensuse.org/viewcvs/yast?rev=38163&view=rev
Log:
improve add/edit device dialogs (device type)
Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/lan/address.ycp
trunk/network/src/lan/complex.ycp
trunk/network/src/lan/hardware.ycp
Modified: trunk/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Tue May 29 09:04:15 2007
@@ -1 +1 @@
-2.15.35
+2.15.36
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Tue May 29 09:04:15 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue May 29 09:03:20 CEST 2007 - mzugec@xxxxxxx
+
+- improve add/edit device dialogs (device type)
+- 2.15.36
+
+-------------------------------------------------------------------
Mon May 28 17:07:40 CEST 2007 - mzugec@xxxxxxx
- disable routing dialog when NetworkManager used (#178538)
Modified: trunk/network/src/lan/address.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/src/lan/address.ycp (original)
+++ trunk/network/src/lan/address.ycp Tue May 29 09:04:15 2007
@@ -135,14 +135,11 @@
break;
case "none" : UI::ChangeWidget(`id(`bootproto), `CurrentButton, `none);
break;
-
-
}
}
symbol handleBootProto (string key, map event) {
-// if (event["EventReason"]:"" == "ValueChanged"){
boolean none = false;
boolean dynamic = false;
boolean stat = false;
@@ -157,8 +154,6 @@
UI::ChangeWidget(`dyn, `Enabled, dynamic);
UI::ChangeWidget(`ipaddr, `Enabled, stat);
UI::ChangeWidget(`netmask, `Enabled, stat);
-
-// }
return nil;
}
@@ -196,22 +191,13 @@
void initIfcfg (string key) {
UI::ChangeWidget(`id(key), `Value, Lan::type);
+ UI::ChangeWidget(`id(key), `Enabled, false);
}
void initIfcfgId (string key) {
UI::ChangeWidget(`id(key), `Value, Lan::device);
}
-/**
- * Event handler for ifcfg name
- * enable or disable depending on whether we are adding a new interface
- * @param key the widget receiving the event
- * @param event the event being handled
- * @return nil so that the dialog loops on
- */
-symbol HandleIfcfg (string key, map event) {
- UI::ChangeWidget (`id (key), `Enabled, Lan::operation == `add);
- return nil;
-}
+
/**
* Remap the buttons to their Wizard Sequencer values
@@ -300,18 +286,6 @@
}
/**
- * Initialize the dialog as a whole
- * Sets default focus
- * @param key id of the widget
- */
-
-/*
-void InitDialog (string key) {
- UI::SetFocus (`id ("IPADDR"));
-}
-*/
-
-/**
* If the traffic would be blocked, ask the user
* if he wants to change it
* @param event the event being handled
@@ -381,19 +355,6 @@
}
/**
- * Store values computed from the whole dialog
- * @param key the widget being validated
- * @param event the event being handled
- */
-
-/*
-void StoreDialog (string key, map event) {
- return;
-}
-*/
-
-
-/**
* Initialize value of firewall zone widget
* (disables it when SuSEFirewall is not installed)
* @param key id of the widget
@@ -410,7 +371,7 @@
"widget" : `custom,
"custom_widget" :
/* Frame label */
- `Frame(`id(`f_additional), _("Additional Addresses"), `HBox(`HSpacing(3), `VBox(
+ `Frame(`id(`f_additional), _("Additional Addresses"), `HBox(`HSpacing(3), `VBox(
`VSpacing(1),
`Table(`id(`table), `opt(`notify), `header(
/* Table header label */
@@ -498,7 +459,7 @@
"help": "",
// "items" will be filled in the dialog itself
"init" : initIfcfg,
- "handle": HandleIfcfg,
+// "handle": HandleIfcfg,
"validate_type": `function,
"validate_function": ValidateIfcfgType,
],
@@ -511,7 +472,7 @@
"help": "",
"init" : initIfcfgId,
"valid_chars": NetworkDevices::ValidCharsIfcfg (),
- "handle": HandleIfcfg,
+// "handle": HandleIfcfg,
],
"BONDSLAVE": $[
@@ -883,21 +844,16 @@
"tab_help" : "",
"fallback_functions" : functions,
];
-
-// if (Lan::operation == `add) wd_content["initial_tab"] = "hardware";
-
+ hw_standalone=false;
wd = (map<string, map<string,any> >) union (wd, $[
"tab" : CWMTab::CreateWidget (wd_content)
]);
- term contents2 = `HBox ("tab");
-
-
any ret = CWM::ShowAndRun (
$[
"widget_names": ["tab"],
"widget_descr": wd,
- "contents": contents2,
+ "contents": `HBox ("tab"),
/* Address dialog caption */
"caption": _("Network Card Setup"),
"back_button" : Label::BackButton (),
@@ -905,7 +861,7 @@
"fallback_functions" : functions,
]);
y2milestone ("ShowAndRun: %1", ret);
-
+
if (ret != `back && ret != `abort)
{
string ifcfgname = NetworkDevices::device_name (
Modified: trunk/network/src/lan/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/complex.ycp?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/src/lan/complex.ycp (original)
+++ trunk/network/src/lan/complex.ycp Tue May 29 09:04:15 2007
@@ -216,10 +216,8 @@
list<map<string,any> > o_items = nil;
void initOverview (string key) ``{
-// if (o_items == nil){
o_items = (list<map<string,any> >)Lan::Overview();
o_items = o_items + Lan::Unconfigured ();
-// }
list<term> term_items = maplist (map<string,any> i, o_items, {
term t = `item (`id (i["id"]:""));
Modified: trunk/network/src/lan/hardware.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/hardware.ycp?rev=38163&r1=38162&r2=38163&view=diff
==============================================================================
--- trunk/network/src/lan/hardware.ycp (original)
+++ trunk/network/src/lan/hardware.ycp Tue May 29 09:04:15 2007
@@ -61,11 +61,13 @@
_("<p>Options for the module should be written in the format specified
in the <b>IBM Device Drivers and Installation Commands</b> manual.</p>");
}
+
map<string, any> hardware = nil;
+boolean hw_standalone=false;
+
void initHwDialog(string text) {
hardware = $[];
-// ScreenName("lan-hardware");
/* Manual dialog caption */
string caption = _("Manual Network Card Configuration");
@@ -88,7 +90,7 @@
// #38213, remember device id when we switch back from pcmcia/usb
hardware["non_hotplug_device_id"] = hardware["device"]:"";
hardware["hwcfg"] = Lan::nm_name;
-if (Lan::nm_name=="" && Lan::nm_name_old!=nil) hardware["hwcfg"]=Lan::nm_name_old;
+ if (Lan::nm_name=="" && Lan::nm_name_old!=nil) hardware["hwcfg"]=Lan::nm_name_old;
// FIXME duplicated in address.ycp
hardware["device_types"] = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond" ];
@@ -99,10 +101,9 @@
if(Arch::ia64 ())
hardware["device_types"] = add(hardware["device_types"]:[], "xp");
- if(issubstring(hardware["device"]:"", "bus-pcmcia"))
- hardware["hotplug"] = "pcmcia";
- else if(issubstring(hardware["device"]:"", "bus-usb"))
- hardware["hotplug"] = "usb";
+ if(issubstring(hardware["device"]:"", "bus-pcmcia")) hardware["hotplug"] = "pcmcia";
+ else if(issubstring(hardware["device"]:"", "bus-usb")) hardware["hotplug"] = "usb";
+
y2milestone("hotplug=%1", Lan::hotplug);
term CheckBoxes = `HBox(
@@ -124,9 +125,6 @@
`HSpacing(1.5)
);
- /* Pushbutton label */
- term ListButton = `PushButton(`id(`list), _("Select from &List"));
-
/* Disable PCMCIA and USB checkboxex on Edit and s390 */
if(Lan::operation == `edit /* FIXME: unique || Lan::unique != "" */ || Arch::s390 () == true)
CheckBoxes = `VSpacing(0);
@@ -147,6 +145,7 @@
CheckBoxes,
`VSpacing(0.4)
),`HSpacing(0.5)));
+
hardware["devices"] = Lan::FreeDevices(hardware["realtype"]:""); // TODO: id-, bus-, ... here
if(!contains(hardware["devices"]:[], hardware["device"]:"")) hardware["devices"] = prepend(hardware["devices"]:[], hardware["device"]:"");
@@ -156,7 +155,6 @@
/* Manual dialog contents */
term TypeNameWidgets =
-// `Frame(_("Network &Configuration"),
`VBox(
`VSpacing(0.2),
`HBox(
@@ -168,8 +166,6 @@
DeviceNumberBox,
`HSpacing(0.5)
)
-// `VSpacing(0.2)
-// )
);
/* Add hardware -> don't allow some changes (card type) */
@@ -201,7 +197,8 @@
term ButtonBox = `HBox(
`HStretch(),
`HSpacing(0.5),
- ListButton,
+ /* Pushbutton label */
+ `PushButton(`id(`list), _("Select from &List")),
`HSpacing(0.5),
`HStretch()
);
@@ -223,6 +220,7 @@
));
UI::ReplaceWidget(`hw_content, contents);
+
if (Lan::nm_name=="" && Lan::nm_name_old!=nil) UI::ChangeWidget(`enable_hwconfig, `Value, false);
hardware["no_hotplug"] = hardware["hotplug"]:"" == "";
hardware["no_hotplug_dummy"] = hardware["no_hotplug"]:false && hardware["type"]:"" != "dummy";
@@ -232,7 +230,7 @@
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");
-
+ if (!hw_standalone) ChangeWidgetIfExists(`id(`dev), `Enabled,false);
ChangeWidgetIfExists(`id(`num), `ValidChars, NetworkDevices::ValidCharsIfcfg ());
ChangeWidgetIfExists(`id(`hwcfg), `ValidChars, NetworkModules::ValidCharsHwcfg ());
}
@@ -723,6 +721,7 @@
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(
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |