/**
 * File:	clients/inst_welcome.ycp
 * Package:	Installation
 * Summary:	Generic Welcome File
 * Authors:	Anas Nashif <nashif@suse.de>
 *
 * $Id: inst_welcome.ycp 22083 2005-03-02 06:51:52Z nashif $
 *
 */

{
textdomain "installation";
import "Wizard";
import "Directory";
import "GetInstArgs";
import "RichText";
import "CustomDialogs";
import "Language";

map argmap = GetInstArgs::argmap();

list<string> default_patterns = ["welcome.%1.txt", "welcome.txt"];

string directory = argmap["directory"]:Directory::datadir;

if (argmap["directory"]:"" != "")
    directory = Directory::custom_workflow_dir + directory;

list<string> patterns = argmap["patterns"]:default_patterns;

map welcome = CustomDialogs::load_file_locale(patterns,directory, Language::language);
y2debug("welcome map: %1", welcome );


map display = UI::GetDisplayInfo();
integer space = display["TextMode"]:true ? 1 : 3;

// dialog caption
string caption = _("Welcome");

// welcome text 1/4
string text = _("<p><b>Welcome!</b></p>") +

    // welcome text 2/4
_("<p>There are a few more steps to take before your system is ready to
use. YaST will now guide you through some basic configuration.  Click
<b>Next</b> to continue. </p>
            
");

/* welcome text */
string welcome_text = welcome["text"]:"" != "" ? welcome["text"]:"" : text;


// help ttext
string help =  _("<p>Click <b>Next</b> to go through the
basic configuration of the system.</p>
");

term rt = `Empty();

if (regexpmatch(welcome_text, "</.*>")) {
    rt = `RichText(`id( `welcome_text), welcome_text);
} else {
    y2debug("plain text");
    rt = `RichText(`id( `welcome_text), `opt(`plainText), welcome_text);
}


term contents = `VBox (
        `VSpacing (space),
        `HBox (
            `HSpacing (2*space),
            rt,
            `HSpacing (2*space)
            ),
        `VSpacing (2)
			   );




Wizard::SetContents(caption, contents, help ,
        GetInstArgs::enable_back(),
        GetInstArgs::enable_next());
Wizard::SetFocusToNextButton();


any ret = UI::UserInput();


return ret;

/* EOF */
}
