/**
 * File:	clients/autoinst_general.ycp
 * Package:	Autoinstallation Configuration System
 * Summary:	General Settings
 * Authors:	Anas Nashif<nashif@suse.de>
 *
 * $Id: general_auto.ycp 19969 2004-10-27 02:01:08Z nashif $
 */
{
    textdomain "autoinst";

    import "AutoinstGeneral";
    import "Wizard";
    import "Label";
    import "Popup";
    import "Sequencer";

    include "autoinstall/general_dialogs.ycp";

    any ret = nil;
    string func = "";
    map param = $[];

    /* Check arguments */
    if(size(WFM::Args()) > 0 && is(WFM::Args(0), string))
    {
	func = (string) WFM::Args(0);
	if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
	    param = (map) WFM::Args(1);
    }

    y2debug("func=%1", func);
    y2debug("param=%1", param);

    if (func == "Import") {
	ret = AutoinstGeneral::Import(param);
    }
    /* create a  summary*/
    else if (func == "Summary") {
	ret =  AutoinstGeneral::Summary();
    }
    else if (func == "GetModified") {
	ret =  AutoinstGeneral::GetModified();
    }
    else if (func == "SetModified") {
	AutoinstGeneral::SetModified();
    }
    else if (func == "Reset") {
	AutoinstGeneral::Import($[]);
	ret = $[];
    }
    else if (func == "Change") {
	ret = generalSequence();
	return ret;
    }
    else if (func == "Export") {
	ret = AutoinstGeneral::Export();
    }
    /* unknown function */
    else {
	y2error("unknown function: %1", func);
	ret =  false;
    }

    y2debug("ret=%1", ret);
    y2milestone("General auto finished");
    y2milestone("----------------------------------------");

    return ret;

/* EOF */
}
