home *** CD-ROM | disk | FTP | other *** search
- /**
- * File: installation/general/inst_congratulate.ycp
- * Module: Installation
- * Summary: Display congratulation
- * Authors: Arvin Schnell <arvin@suse.de>
- *
- * Display a congratulation message for the user.
- *
- * $Id: inst_congratulate.ycp 34401 2006-11-15 10:42:07Z locilka $
- */
-
- {
- textdomain "installation";
-
- import "Mode";
- import "Wizard";
- import "Popup";
- import "Label";
- import "ProductFeatures";
- import "GetInstArgs";
- import "Call";
- import "Package";
- import "ProductControl";
- import "Stage";
-
- /**
- * Function returns true when the default windowmanager is KDE
- * See bug 170880 for more information
- *
- * @return boolean wm is is_kde
- */
- boolean DisplayKDEHelp () {
- string default_wm = (string) SCR::Read(.sysconfig.windowmanager."DEFAULT_WM");
- y2debug("Default WM: %1", default_wm);
-
- if (default_wm != nil && tolower(default_wm) == "kde") {
- return true;
- }
- return false;
- }
-
- map argmap = GetInstArgs::argmap();
-
- // show button "clone system"?
- boolean show_clone_checkbox = ! Stage::firstboot ();
- boolean clone_checkbox_active = ProductFeatures::GetBooleanFeature("globals", "enable_clone");
- boolean clone_enabled = false;
- if( Package::AvailableAny(["autoyast2"]) &&
- size(ProductControl::clone_modules) > 0 ) {
- clone_enabled = true;
- } else {
- clone_checkbox_active = false;
- }
-
- map display = UI::GetDisplayInfo();
- integer space = display["TextMode"]:true ? 1 : 3;
- string vendor_url_tmp = ProductFeatures::GetStringFeature("globals", "vendor_url");
-
- string vendor_url = "http://www.novell.com/linux/";
-
- if (vendor_url_tmp != nil && vendor_url_tmp != "")
- vendor_url = vendor_url_tmp;
-
- term check_box_do_clone = `Empty();
-
- if (show_clone_checkbox)
- {
- check_box_do_clone = `CheckBox (`id(`do_clone),
- // Check box: start the clone process and store the autoyast
- // profile in /root/autoinst.xml
- _("&Clone This System for Autoyast"), clone_checkbox_active);
- }
-
- // caption for dialog "Congratulation Dialog"
- string caption = _("Installation Completed");
-
- string text = ProductControl::GetTranslatedText ("congratulate");
-
- if (text == "") {
- // congratulation text 1/4
- text = _("<p><b>Congratulations!</b></p>") +
-
- // congratulation text 2/4
- _("<p>The installation of &product; on your machine is complete.
- After clicking <b>Finish</b>, you can log in to the system.</p>
- ") +
-
- // congratulation text 3/4
- sformat(_("<p>Visit us at %1.</p>"), vendor_url ) +
-
- // congratulation text 4/4
- _("<p>Have a lot of fun!<br>Your SUSE Development Team</p>");
- }
- else
- {
- text = sformat (text, vendor_url);
- }
-
-
- term contents = `VBox (
- `VSpacing (space),
- `HBox (
- `HSpacing (2*space),
- `VBox(
- `RichText (`id (`text), text),
- `VSpacing (space/2),
- `Left(check_box_do_clone)
- ),
- `HSpacing (2*space)
- ),
- `VSpacing (space),
- `VSpacing (2)
- );
-
- string help_file = "";
- // help 1/4 for dialog "Congratulation Dialog"
- string help = _("<p>Your system is ready for use.</p>") +
-
- // help 2/4 for dialog "Congratulation Dialog"
- _("<p><b>Finish</b> will close the YaST installation and continue
- to the login screen.</p>
- ") +
-
- // help 3/4 for dialog "Congratulation Dialog"
- (DisplayKDEHelp() ? _("<p>If you choose the default graphical desktop KDE, you can
- adjust some KDE settings to your hardware. Also notice
- our SUSE Welcome Dialog.</p>
- ") : ""); // Show this help only in case of KDE as the default windowmanager
-
- if( show_clone_checkbox ) {
- help = help + _("<p>Use <b>Clone</b> if you want to create an AutoYaST profile.
- AutoYaST is a way to do a complete SUSE Linux installation without user interaction. AutoYaST
- needs a profile to know what the installed system should look like. If this option is
- selected, a profile of the current system is stored in /root/autoyast.xml.</p>
- ");
- }
-
- Wizard::SetContents (caption, contents, help,
- GetInstArgs::enable_back(), GetInstArgs::enable_next());
- Wizard::SetTitleIcon ("SuSEmenu");
-
- Wizard::SetNextButton(`next, Label::FinishButton() );
- Wizard::SetFocusToNextButton();
- if( UI::WidgetExists(`id(`do_clone)) )
- UI::ChangeWidget (`id(`do_clone), `Enabled, clone_enabled);
-
- any ret = nil;
-
- repeat {
-
- ret = Wizard::UserInput();
-
- if (ret == `abort)
- {
- if (Popup::ConfirmAbort (`incomplete))
- break;
- }
- else if ( ret == `help )
- {
- Wizard::ShowHelp (help);
- }
-
- } until ( ret == `next || ret == `back );
-
- if (UI::WidgetExists(`id(`do_clone)) && ret == `next && (boolean)UI::QueryWidget (`id(`do_clone), `Value)) {
- // #165860
- // Save sources now because cloning garbles the target
- // Cloning reinitializes sources when it needs them
- Pkg::SourceFinishAll ();
-
- Call::Function("clone_system" , ["doClone"]);
- }
-
- // bugzilla #221190
- if (ret == `back)
- Wizard::RestoreNextButton ();
-
- return ret;
- }
-