home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Author: Klaus KΣmpf
- *
- * Purpose: This module asks the installation method: "New installation" or "update"
- *
- * user_settings:
- *
- * sh@suse.de: THIS HAS CHANGED A LOT!
- * THE OLD INST_MODES ARE OBSOLETE; NOW THE USER CAN ONLY
- * CHOOSE BETWEEN "INSTALL" OR UPDATE!
- *
- * rw: instmode: `install or `update
- *
- * <OBSOLETE>
- * wr: softwaresel: to ".default" if user selects "Straight forward"
- * wr: install_sources: to "false" if user selects "Straight forward"
- * wr: commercial: to "false" if user selects "Straight forward"
- *
- * </OBSOLETE>
- *
- * $Id: inst_mode.ycp,v 1.10 2000/03/10 13:43:23 kkaempf Exp $
- */
- {
- boolean instmode_update = (lookup(user_settings, "instmode") == `update);
-
- term contents =
- `RadioButtonGroup( `id( `options ),
- `HSquash(
- `Frame (
- // message above radiobuttons (installation/update)
- _("Please select"),
- `VBox(
- `Left(`RadioButton(`id(`install),
- // label for radiobutton 1, New installation
- _("New &installation"), ! instmode_update ) ),
- `Left(`RadioButton(`id(`update),
- // label for radiobutton 2, update
- _("&Update an existing system"), instmode_update ))
- )
- )
- )
- );
-
- // help text for installation method
- string help_text = UI(_("\
- <p>
- Select <b>update an existing system</b> to upgrade a SuSE Linux system
- already installed on your machine. This option will preserve
- configuration settings from your existing system whenever possible.
- </p>" ) );
-
- help_text = help_text + UI(_("\
- <p>
- Select <b>new installation</b> if there is no existing SuSE Linux
- system on your machine or if you want to completely replace an
- existing SuSE Linux system, abandoning all its configuration settings.
- </p>
- <br>" ) );
-
- // screen title for installation method
- any dlg = UI(`SetWizardContents(_("Install SuSE Linux"),
- contents,
- help_text,
- Args(0), true));
-
- // Event handling
-
- any ret = nil;
- while (true) {
- ret = UI(`UserInput());
- if (ret == `next || ret == `back) {
- any newmode = UI(`QueryWidget(`id(`options), `CurrentButton));
- if (newmode == nil) {
- // no installation method was selected
- if ( ret != `back )
- {
- UI(`DisplayMessage(_("You have to choose one of the\noptions in order to continue.")));
- continue;
- }
- }
- else {
- user_settings = add(user_settings, "instmode", newmode);
- // revert to default software selection for `auto mode
- if (newmode == `auto) {
- user_settings = add(user_settings, "softwaresel", [.default]);
- user_settings = add(user_settings, "install_sources", false);
- user_settings = add(user_settings, "commercial", false);
- }
- else if (newmode == `install) {
- Shell("rm -f /tmp/update_mode");
- }
- else if (newmode == `update) {
- Shell("touch /tmp/update_mode");
- return `cancel;
- }
- }
- // Handle your option here
- break;
- }
- else break;
- }
- return ret;
- }
-