[yast-commit] r67466 - in /trunk/s390/src: dasd/dialogs.ycp modules/DASDController.ycp
Author: aschnell Date: Thu Feb 16 15:18:01 2012 New Revision: 67466 URL: http://svn.opensuse.org/viewcvs/yast?rev=67466&view=rev Log: - moved functionality to module Modified: trunk/s390/src/dasd/dialogs.ycp trunk/s390/src/modules/DASDController.ycp Modified: trunk/s390/src/dasd/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/dasd/dialogs.ycp?rev=67466&r1=67465&r2=67466&view=diff ============================================================================== --- trunk/s390/src/dasd/dialogs.ycp (original) +++ trunk/s390/src/dasd/dialogs.ycp Thu Feb 16 15:18:01 2012 @@ -543,10 +543,7 @@ "diag" : diag, ]; - integer index = 0; - while (haskey (DASDController::devices, index)) - index = index + 1; - DASDController::devices[index] = d; + DASDController::AddDevice(d); } return ret; @@ -566,10 +563,15 @@ } list<integer> selected = ListSelectedDASD(); - - DASDController::devices = filter(integer index, map<string, any> d, DASDController::devices, { - return !contains(selected, index); - }); + if (isempty(selected)) + { + // error popup message + Popup::Message (_("No disk selected.")); + } + else + { + foreach(integer index, selected, { DASDController::RemoveDevice(index); }); + } return `next; } Modified: trunk/s390/src/modules/DASDController.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/modules/DASDController.ycp?rev=67466&r1=67465&r2=67466&view=diff ============================================================================== --- trunk/s390/src/modules/DASDController.ycp (original) +++ trunk/s390/src/modules/DASDController.ycp Thu Feb 16 15:18:01 2012 @@ -275,6 +275,23 @@ } + global void + AddDevice(map<string, any> d) + { + integer index = 0; + while (haskey(devices, index)) + index = index + 1; + devices[index] = d; + } + + + global void + RemoveDevice(integer index) + { + devices = remove(devices, index); + } + + global integer GetDeviceIndex(string channel) { -- 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