/**
 * File:	include/tftp-server/wizards.ycp
 * Package:	Configuration of tftp-server
 * Summary:	Wizards definitions
 * Authors:	Martin Vidner <mvidner@suse.cz>
 *
 * $Id: wizards.ycp 16001 2004-03-11 07:59:45Z jhumpol $
 */

{

textdomain "tftp-server";

import "Label";
import "Popup";
import "Wizard";

include "wizard/sequencer.ycp";
include "tftp-server/dialogs.ycp";

/**
 * Whole configuration of tftp-server
 * @return sequence result
 */
define symbol TftpServerSequence() ``{

    map aliases = $[
	"packages"	: [ ``( Packages() ), true ],
	"read"	: [ ``( ReadDialog() ), true ],
	"main"	:   ``( MainDialog() ),
	"write"	: [ ``( WriteDialog() ), true ]
    ];

    map sequence = $[
	"ws_start" : "packages",
	"packages" : $[
	    `next	: "read",
		`abort	: `abort
	],
	"read" : $[
	    `abort	: `abort,
	    `next	: "main"
	],
	"main" : $[
	    `abort	: `abort,
	    `next	: "write"
	],
	"write" : $[
	    `abort	: `abort,
	    `next	: `next
	]
    ];

    /* Tftp-server dialog caption */
    string caption = _("TFTP Server Configuration");

    // progress label
    term contents = `Label(_("Initializing ..."));

    Wizard::CreateDialog();
    Wizard::SetDesktopIcon("tftp-server");
    Wizard::SetContentsButtons(caption, contents, "",
	    Label::BackButton(), Label::NextButton());

    any ret = WizardSequencer(aliases, sequence);

    UI::CloseDialog();
    return (symbol) ret;
}

/**
 * Whole configuration of tftp-server
 * @return sequence result
 */
define symbol TftpServerAutoSequence() ``{

    map aliases = $[
	"packages"	: [ ``( Packages() ), true ],
	"main"	:   ``( MainDialog() )
    ];

    map sequence = $[
	"ws_start" : "packages",
	"packages" : $[
	    `next	: "main"
	],
	"main" : $[
	    `abort	: `abort,
		`next	: `next
	]
    ];

    /* Tftp-server dialog caption */
    string caption = _("TFTP Server Configuration");

    // progress label
    term contents = `Label(_("Initializing ..."));

    Wizard::CreateDialog();
    Wizard::SetDesktopIcon("tftp-server");
    Wizard::SetContentsButtons(caption, contents, "",
	    Label::BackButton(), Label::NextButton());

    any ret = WizardSequencer(aliases, sequence);

    UI::CloseDialog();
    return (symbol) ret;
}

/* EOF */
}
