[yast-commit] r67434 - in /trunk/s390/src/dasd: dialogs.ycp wizards.ycp

Author: aschnell Date: Wed Feb 15 12:15:43 2012 New Revision: 67434 URL: http://svn.opensuse.org/viewcvs/yast?rev=67434&view=rev Log: - implemented deleting of dasds in autoyast editor Modified: trunk/s390/src/dasd/dialogs.ycp trunk/s390/src/dasd/wizards.ycp Modified: trunk/s390/src/dasd/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/dasd/dialogs.ycp?rev=674... ============================================================================== --- trunk/s390/src/dasd/dialogs.ycp (original) +++ trunk/s390/src/dasd/dialogs.ycp Wed Feb 15 12:15:43 2012 @@ -234,11 +234,11 @@ { DisplayDASDDialog (); ReloadDASDDialog (); - any ret = nil; + symbol ret = nil; while (ret == nil) { - ret = UI::UserInput(); + ret = (symbol) UI::UserInput(); if (ret == `filter) { @@ -395,7 +395,7 @@ `PushButton (`id (`cancel), Label::CancelButton ()) ) )); - ret = UI::UserInput (); + ret = (symbol) UI::UserInput(); par = (integer) UI::QueryWidget(`id(`par), `Value); boolean write_vl = (boolean) UI::QueryWidget(`id(`write_label), `Value); UI::CloseDialog (); @@ -441,7 +441,7 @@ ret = nil; } } - return (symbol)ret; + return ret; } @@ -449,11 +449,11 @@ * Run the dialog for adding DASDs * @return symbol from AddDASDDiskDialog */ -symbol AddDASDDiskDialog () +symbol AddDASDDiskDialog() { - if (! Mode::config ()) + if (!Mode::config()) { - y2error ("DASD Add Disk dialog shouldn't be run in Mode::config ()"); + y2error("DASD Add Disk dialog shouldn't be run in Mode::config()"); return `back; } @@ -484,11 +484,12 @@ Wizard::RestoreBackButton (); Wizard::RestoreAbortButton (); - any ret = nil; + UI::ChangeWidget(`id(`channel), `ValidChars, "0123456789abcdefABCDEF."); + symbol ret = nil; while (ret == nil) { - ret = UI::UserInput(); + ret = (symbol) UI::UserInput(); if (ret == `abort || ret == `cancel) { @@ -522,7 +523,29 @@ DASDController::devices[index] = m; } - return (symbol) ret; + return ret; +} + + +/** + * Run the dialog for deleting DASDs + * @return symbol from DeleteDASDDiskDialog + */ +symbol DeleteDASDDiskDialog() +{ + if (!Mode::config()) + { + y2error("DASD Delete Disk dialog shouldn't be run in Mode::config()"); + return `back; + } + + list<integer> selected = ListSelectedDASD(); + + DASDController::devices = filter(integer index, map<string, any> d, DASDController::devices, { + return !contains(selected, index); + }); + + return `next; } } Modified: trunk/s390/src/dasd/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/dasd/wizards.ycp?rev=674... ============================================================================== --- trunk/s390/src/dasd/wizards.ycp (original) +++ trunk/s390/src/dasd/wizards.ycp Wed Feb 15 12:15:43 2012 @@ -23,7 +23,8 @@ { map aliases = $[ "main" : ``(DASDDialog()), - "add" : ``(AddDASDDiskDialog()) + "add" : ``(AddDASDDiskDialog()), + "delete" : ``(DeleteDASDDiskDialog()) ]; map sequence = $[ @@ -32,10 +33,15 @@ `abort : `abort, `next : `next, `add : "add", + `delete : "delete" ], "add" : $[ `abort : `abort, - `next : "main", + `next : "main" + ], + "delete" : $[ + `abort : `abort, + `next : "main" ], ]; @@ -50,9 +56,9 @@ any DASDSequence() { map aliases = $[ - "read" : [ ``( ReadDialog() ), true ], - "main" : ``( MainDASDSequence() ), - "write" : [ ``( WriteDialog() ), true ] + "read" : [ ``(ReadDialog()), true ], + "main" : ``(MainDASDSequence()), + "write" : [ ``(WriteDialog()), true ] ]; map sequence = $[ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn2.opensuse.org