[yast-commit] r67439 - in /trunk/s390/src: clients/dasd_auto.ycp modules/DASDController.ycp
Author: aschnell
Date: Wed Feb 15 12:42:36 2012
New Revision: 67439
URL: http://svn.opensuse.org/viewcvs/yast?rev=67439&view=rev
Log:
- improved DASDController::modified handling
- use switch statement
Modified:
trunk/s390/src/clients/dasd_auto.ycp
trunk/s390/src/modules/DASDController.ycp
Modified: trunk/s390/src/clients/dasd_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/clients/dasd_auto.ycp?rev=67439&r1=67438&r2=67439&view=diff
==============================================================================
--- trunk/s390/src/clients/dasd_auto.ycp (original)
+++ trunk/s390/src/clients/dasd_auto.ycp Wed Feb 15 12:42:36 2012
@@ -10,17 +10,7 @@
* goes through the configuration and return the setting.
* Does not do any changes to the configuration.
*/
-
-/**
- * @param function to execute
- * @param map/list of controller settings
- * @return map edited settings, Summary or boolean on success depending on called function
- * @example map mm = $[ "FAIL_DELAY" : "77" ];
- * @example map ret = WFM::CallFunction ("controller_auto", [ "Summary", mm ]);
- */
-
{
-
textdomain "s390";
y2milestone("----------------------------------------");
@@ -43,60 +33,88 @@
y2debug("func=%1", func);
y2debug("param=%1", param);
-/* Create a summary*/
-if(func == "Summary") {
- ret = HTML::List(DASDController::Summary());
-}
-/* Reset configuration */
-else if (func == "Reset") {
- DASDController::Import($[]);
- ret = $[];
-}
-/* Change configuration (run AutoSequence) */
-else if (func == "Change") {
- ret = DASDAutoSequence();
-}
-/* Import configuration */
-else if (func == "Import") {
- ret = DASDController::Import(param);
-}
-/* Return actual state */
-else if (func == "Export") {
- ret = DASDController::Export();
-}
-/* did configuration change */
-else if (func == "GetModified") {
- ret = DASDController::modified;
-}
-/* set configuration as changed */
-else if (func == "SetModified") {
- DASDController::modified = true;
- ret = true;
-}
-/* Return needed packages */
-else if (func == "Packages") {
- ret = DASDController::AutoPackages();
-}
-/* Read current state */
-else if (func == "Read") {
- import "Progress";
- Progress::off();
- ret = DASDController::Read();
- Progress::on();
-}
-/* Write given settings */
-else if (func == "Write") {
- import "Progress";
- Progress::off();
- DASDController::write_only = true;
- ret = DASDController::Write();
- Progress::on();
-}
-/* Unknown function */
-else {
- y2error("Unknown function: %1", func);
- ret = false;
-}
+ switch (func)
+ {
+ case "Summary": // Create a summary
+ {
+ ret = HTML::List(DASDController::Summary());
+ break;
+ }
+
+ case "Reset": // Reset configuration
+ {
+ DASDController::Import($[]);
+ DASDController::SetModified(true);
+ ret = $[];
+ break;
+ }
+
+ case "Change": // Change configuration
+ {
+ ret = DASDAutoSequence();
+ DASDController::SetModified(true);
+ break;
+ }
+
+ case "Import": // Import configuration
+ {
+ ret = DASDController::Import(param);
+ DASDController::SetModified(true);
+ break;
+ }
+
+ case "Export": // Return actual state
+ {
+ ret = DASDController::Export();
+ DASDController::SetModified(false);
+ break;
+ }
+
+ case "GetModified": // Did configuration change
+ {
+ ret = DASDController::GetModified();
+ break;
+ }
+
+ case "SetModified": // Set configuration as changed
+ {
+ DASDController::SetModified(true);
+ ret = true;
+ break;
+ }
+
+ case "Packages": // Return needed packages
+ {
+ ret = DASDController::AutoPackages();
+ break;
+ }
+
+ case "Read": // Read current state
+ {
+ import "Progress";
+ Progress::off();
+ ret = DASDController::Read();
+ Progress::on();
+ DASDController::SetModified(true);
+ break;
+ }
+
+ case "Write": // Write given settings
+ {
+ import "Progress";
+ Progress::off();
+ ret = DASDController::Write();
+ Progress::on();
+ break;
+ }
+
+ default: // Unknown function
+ {
+ y2error("Unknown function: %1", func);
+ ret = false;
+ break;
+ }
+ }
y2debug("ret=%1", ret);
y2milestone("DASD auto finished");
@@ -104,5 +122,4 @@
return ret;
-/* EOF */
}
Modified: trunk/s390/src/modules/DASDController.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/s390/src/modules/DASDController.ycp?rev=67439&r1=67438&r2=67439&view=diff
==============================================================================
--- trunk/s390/src/modules/DASDController.ycp (original)
+++ trunk/s390/src/modules/DASDController.ycp Wed Feb 15 12:42:36 2012
@@ -44,20 +44,17 @@
*/
global boolean Modified();
+
/**
* Data was modified?
*/
-global boolean modified = true; // TODO
+boolean modified = false;
+
/**
*/
global boolean proposal_valid = false;
-/**
- * Write only, used during autoinstallation.
- * Don't run services and SuSEconfig, it's all done at one place.
- */
-global boolean write_only = false;
/**
* Abort function
@@ -80,11 +77,18 @@
* Data was modified?
* @return true if modified
*/
-global boolean Modified() {
- y2debug("modified=%1",modified);
+global boolean GetModified()
+{
return modified;
}
+
+global void SetModified(boolean value)
+{
+ modified = value;
+}
+
+
/**
* Is this kind of disk controller available?
* @return boolean true if it is
@@ -113,11 +117,14 @@
{
ProbeDisks();
- devices = mapmap(integer index, map
participants (1)
-
aschnell@svn2.opensuse.org