ACC SHELL

Path : /usr/share/YaST2/clients/
File Upload :
Current File : //usr/share/YaST2/clients/mail-server_proposal.ycp

/**
 * File:	clients/mail-server_proposal.ycp
 * Package:	Configuration of mail-server
 * Summary:	Proposal function dispatcher.
 * Authors:	Peter Varkoly <varkoly@suse.de>
 *
 * $Id: mail-server_proposal.ycp 19955 2004-10-26 12:28:16Z varkoly $
 *
 * Proposal function dispatcher for mail-server configuration.
 * See source/installation/proposal/proposal-API.txt
 */

{

textdomain "mail";

import "MailServer";
import "Progress";

/* The main () */
y2milestone("----------------------------------------");
y2milestone("MailServer proposal started");

string func = (string) WFM::Args(0);
map param = (map) WFM::Args(1);
map ret = $[];

/* create a textual proposal */
if(func == "MakeProposal") {
    string proposal = "";
    string warning = nil;
    symbol warning_level = nil;
    boolean force_reset = param["force_reset"]:false;

    if(force_reset || !MailServer::proposal_valid) {
        MailServer::proposal_valid = true;
	Progress::off();
	MailServer::Read();
    }
    list sum = MailServer::Summary();
    proposal = sum[0]:"";
    Progress::on();

    ret = $[
	"preformatted_proposal" : proposal,
	"warning_level" : warning_level,
	"warning" : warning,
    ];
}
/* run the module */
else if(func == "AskUser") {
    map stored = MailServer::Export();
    symbol seq = (symbol) WFM::CallFunction("mail-server", [.propose]);
    if(seq != `next) MailServer::Import(stored);
    y2debug("stored=%1",stored);
    y2debug("seq=%1",seq);
    ret = $[
	"workflow_sequence" : seq
    ];
}
/* create titles */
else if(func == "Description") {
    ret = $[
	/* Rich text title for MailServer in proposals */
	"rich_text_title" : _("Mail Server"),
	/* Menu title for MailServer in proposals */
	"menu_title" : _("&Mail Server"),
	"id" : "mail-server",
    ];
}
/* write the proposal */
else if(func == "Write") {
    MailServer::Write();
}
/* unknown function */
else {
    y2error("unknown function: %1", func);
}

/* Finish */
y2debug("ret=%1",ret);
y2milestone("MailServer proposal finished");
y2milestone("----------------------------------------");
return ret;

/* EOF */
}

ACC SHELL 2018