/**
 * File:        clients/remote_proposal.ycp
 * Package:     Network configuration
 * Summary:     Proposal for Remote Administration
 * Authors:     Arvin Schnell <arvin@suse.de>
 *		Michal Svec <msvec@suse.cz>
 *
 * $Id: remote_proposal.ycp 20144 2004-11-03 12:16:43Z mvidner $
 */

{

textdomain "network";

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

import "Remote";
import "Wizard";
include "network/remote/dialogs.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) Remote::Reset();
    ret = $[ "raw_proposal" : [ Remote::Summary() ] ];
}
/* run the module */
else if(func == "AskUser") {
    // single dialog, no need to Export/Import

    Wizard::CreateDialog();
    Wizard::SetDesktopIcon("remote");
    symbol result = (symbol) RemoteMainDialog ();
    UI::CloseDialog();

    y2debug("result=%1", result);
    ret = $[ "workflow_sequence" : result ];
}
/* create titles */
else if(func == "Description") {
    ret = $[
	/* RichText label */
	"rich_text_title" : _("VNC Remote Administration"),
	/* Menu label */
	"menu_title" : _("VNC &Remote Administration"),
	"id" : "admin_stuff",
    ];
}
/* write the proposal */
else if(func == "Write") {
    Remote::Write();
}
/* unknown function */
else {
    y2error("unknown function: %1", func);
}

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

/* EOF */
}
