home *** CD-ROM | disk | FTP | other *** search
Wrap
/** * Module: inst_xen_create.ycp * * Authors: Michael G. Fritch <mgfritch@novell.com> * * Purpose: Ask user what type of Xen VM to create (new install or use existing). * * $Id: inst_xen_mode.ycp 28754 2006-03-09 12:33:30Z lslezak $ * */ { textdomain "vm"; import "VM_Common"; import "Wizard"; import "Popup"; import "Report"; import "Label"; import "Mode"; // check whether X window system is accessible if ( VM_Common::isGraphicalDisplay() == false ) { // error - the installation runs in xterm, we need access to a X server Report::Error(_("Virtual machine installation requires access to a graphical environment.")); return `abort; } // screen title for the Xen create selection string title = _("Create a Virtual Machine"); // build and show dialog Wizard::OpenNextBackDialog (); term contents = `HBox( `HSpacing(2), `RadioButtonGroup(`id(`rb_group), // frame label `Frame( _("Method for Installing the VM's Operating System"), `VBox( `VSpacing(0.5), // radio button label `Left(`RadioButton(`id("new"), _("Run an OS installation program"), (VM_Common::proposal_type != "existing"))), `VSpacing(0.5), // radio button label `Left(`RadioButton(`id("existing"), _("Use a disk image or a physical disk that contains OS boot files"), (VM_Common::proposal_type == "existing"))), `VSpacing(0.5) ) ) ), `HSpacing(2) ); // Create a Virtual Machine - help text 1/4 string help_text = sformat(_("<p><b><big>%1</big></b></p>"), title) // Create a Virtual Machine - help text 2/4 + _("<p>Creating a VM requires that you install the VM's operating system by either running an OS installation program or specifying a disk image that already contains an operating system.</p>") // Create a Virtual Machine - help text 3/4 + _("<p><b>Run an OS Installation Program</b>: You can install a VM's operating system by running an OS installation program from a YaST Network Installation Source, a CD / DVD device, or an ISO image file.</p>") // Create a Virtual Machine - help text 1/4 + _("<p><b>Use a Disk Image</b>: You can specify that the VM boots an already-installed operating system from boot files located on a disk image or a physical disk.</p>"); Wizard::SetContents (title, contents, help_text, true, true); symbol ret = nil; while (true) { ret = (symbol) Wizard::UserInput(); if (ret == `abort || ret == `cancel) { if (Popup::ReallyAbort(VM_Common::GetModified())) break; } else if (ret == `back) { break; } else if (ret == `next) { string selected = (string)(UI::QueryWidget(`id(`rb_group), `CurrentButton)); if (selected == "new") ret = `install; else if (selected == "existing") ret = `existing; else { // popup error message Report::Error(_("At least one item must be selected.")); continue; } break; } else { y2error("unexpected retcode: %1", ret); continue; } } Wizard::CloseDialog(); return ret; /* EOF */ }