ACC SHELL

Path : /proc/self/root/usr/share/YaST2/clients/
File Upload :
Current File : //proc/self/root/usr/share/YaST2/clients/isdn_proposal.ycp

/**
 * File:	clients/isdn_proposal.ycp
 * Package:	Configuration of network
 * Summary:	ISDN configuration proposal
 * Authors:	Michal Svec <msvec@suse.cz>
 *
 * $Id: isdn_proposal.ycp 46138 2008-04-04 16:31:10Z locilka $
 */

{

textdomain "network";

/* The main () */
y2milestone("----------------------------------------");
y2milestone("ISDN proposal started");
y2milestone("Arguments: %1", WFM::Args());

import "ISDN";
import "Progress";
import "GetInstArgs";

include "network/routines.ycp";

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 || !ISDN::proposal_valid) {
	ISDN::proposal_valid = true;
	if (! GetInstArgs::automatic_configuration())
	    /* Popup text */
	    BusyPopup(_("Detecting ISDN cards..."));
	boolean progress_orig = Progress::set (false);
	ISDN::Read();
	// no ISDN::Propose () ?
	Progress::set (progress_orig);
	if (! GetInstArgs::automatic_configuration())
	    BusyPopupClose();
    }
    list sum = ISDN::Summary(false);
    proposal = sum[0]:"";

    ret = $[
	"preformatted_proposal" : proposal,
	"warning_level" : warning_level,
	"warning" : warning,
    ];
}
/* run the module */
else if(func == "AskUser") {
    map stored = ISDN::Export();
    any seq = WFM::CallFunction("isdn", [.propose]);
    if(seq != `next) ISDN::Import(stored);
    ret = $[
	"workflow_sequence" : seq
    ];
}
/* create titles */
else if(func == "Description") {
    ret = $[
	/* RichText label */
	"rich_text_title" : _("ISDN Adapters"),
	/* Menu label */
	"menu_title" : _("&ISDN Adapters"),
	"id" : "isdn",
    ];
}
/* write the proposal */
else if(func == "Write") {
    ISDN::Write (true);		// #74096, full init before internet test
}
/* unknown function */
else {
    y2error("unknown function: %1", func);
}

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

/* EOF */
}

ACC SHELL 2018