ACC SHELL

Path : /var/lib/ntp/var/lib/ntp/proc/self/root/usr/share/YaST2/clients/
File Upload :
Current File : //var/lib/ntp/var/lib/ntp/proc/self/root/usr/share/YaST2/clients/general_proposal.ycp

/**
 * File:	clients/general_proposal.ycp
 * Package:	Network configuration
 * Summary:	Network mode + ipv6 proposal
 * Authors:	Martin Vidner <mvidner@suse.cz>
 *
 * $Id: general_proposal.ycp 51122 2008-09-12 13:37:48Z mzugec $
 *
 * This is not a standalone proposal, it depends on lan_proposal. It
 * must run after it.
 */

{

textdomain "network";

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

import "Lan";
import "LanItems";
import "NetworkService";

include "network/lan/complex.ycp";

list args = WFM::Args();

string func = args[0]:"";
map param = args[1]:$[];
map ret = $[];

/* create a textual proposal */
if(func == "MakeProposal") {
    string proposal = "";
    list<string> links = [];
    string warning = nil;
    symbol warning_level = nil;

    list sum = Lan::SummaryGeneral ();
    proposal = sum[0]:"";
    links = sum[1]:[];

    ret = $[
	"preformatted_proposal" : proposal,
	"links" : links,
	"warning_level" : warning_level,
	"warning" : warning,
    ];
}
/* run the module */
else if(func == "AskUser") {
    string chosen_id = param["chosen_id"]:"";
    symbol seq = `next;
    if (chosen_id == "lan--nm-enable")
    {
	NetworkService::SetManaged (true);
    }
    else if (chosen_id == "lan--nm-disable")
    {
	NetworkService::SetManaged (false);
    }
    else if(chosen_id == "ipv6-enable")
    {
	Lan::SetIPv6(true);
    }
    else if(chosen_id == "ipv6-disable")
    {
	Lan::SetIPv6(false);
    }
    else if(chosen_id == "virtual-enable")
    {
	Lan::virt_net_proposal=true;
    }
    else if(chosen_id == "virtual-revert")
    {
	Lan::virt_net_proposal=false;
    }
    else
    {
	Wizard::CreateDialog();
	Wizard::SetDesktopIcon("lan");

	seq = ManagedDialog();
	Wizard::CloseDialog();
    }
    LanItems::proposal_valid = false; // repropose
    LanItems::SetModified ();
    ret = $[
	"workflow_sequence" : seq
    ];
}
/* create titles */
else if(func == "Description") {
    ret = $[
	/* RichText label */
	"rich_text_title" : _("General Network Settings"),
	/* Menu label */
	"menu_title" : _("General &Network Settings"),
	"id" : "networkmode",
    ];
}
/* write the proposal */
else if (func == "Write") {
    y2debug ("lan_proposal did it");
}
/* unknown function */
else {
    y2error("unknown function: %1", func);
}

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

/* EOF */
}

ACC SHELL 2018