/**
 * File:	clients/sysconfig.ycp
 * Package:	Sysconfig editor
 * Summary:	Main file
 * Authors:	Ladislav Slezak <lslezak@suse.cz>
 *
 * $Id: sysconfig.ycp,v 1.16 2004/11/16 14:01:04 lslezak Exp $
 *
 * Main file for sysconfig configuration. Uses all other files.
 */

{

/***
 * <h3>Configuration of the sysconfig</h3>
 */

textdomain "sysconfig";

/* The main () */
y2milestone ("----------------------------------------");
y2milestone ("Sysconfig module started");

import "Sysconfig";
import "CommandLine";

include "sysconfig/wizards.ycp";
include "sysconfig/cmdline.ycp";

    /**
     * Command line definition
     */
    map cmdline = $[
	// help text header - configuration of 'powertweak' utility
	"help"      : (Sysconfig::powertweak_mode == true) ? _("Powertweak Configuration") :
	// help text header - sysconfig editor
	 _("Editor for /etc/sysconfig Files"),
	"id"        : (Sysconfig::powertweak_mode == true) ? "powertweak" : "sysconfig",
	"guihandler": SysconfigSequence,
	"initialize": Sysconfig::Read,
	// use write handler - disable progress bar
	"finish"    : writeHandler,
	"actions"   : $[
	    "list" : $[
		// help text for command 'list'
		"help"      : _("Display configuration summary"),
		"handler"   : listHandler
	    ],
	    "set" : $[
		// help text for command 'set'
		"help"      : _("Set variable value"),
		"handler"   : setHandler
	     ],
	    "clear" : $[
		// help text for command 'set'
		"help"      : _("Set empty value (\"\")"),
		"handler"   : clearHandler
	     ],
	    "details" : $[
		// help text for command 'details'
		"help"      : _("Show details about selected variable"),
		"handler"   : detailsHandler
	    ]
	],
	"options" : $[
	    "all" : $[
		// help text for option 'all'
		"help"	    : _("Display all variables")
	    ],
	    "variable" : $[
		// help text for option 'variable'
		"help"      : _("Selected variable"),
		"type"      : "string"
	    ],
	    "value" : $[
		// help text for option 'value'
		"help"      : _("New value"),
		"type"      : "string"
	    ]
	],
	"mappings" : $[
	    "list" : ["all"],
	    "set"  : ["variable", "value"],
	    "clear"  : ["variable"],
	    "details" : ["variable"]
	]
    ];


/* main ui function */
any ret = CommandLine::Run(cmdline);

y2debug("ret == %1", ret);

/* Finish */
y2milestone("Sysconfig module finished");
y2milestone("----------------------------------------");

return ret;

/* EOF */
}
