From fe13bd0b5e978f8a7c822e5dd4d039a5981f7204 Mon Sep 17 00:00:00 2001 From: jkh Date: Sat, 29 Apr 1995 19:33:06 +0000 Subject: o Add extra menu types (radio implemented, multiple choice shortly). o Make the framework generally more robust. o Figured out how to nest the menu descriptions - no more grotty initialization of menus. o Fix bug with helpline and helpfile not being reset. o Add stubs for the media selection code. Coming next: Fdisk and disklabel screens using Phk's new libdisk stuff. --- usr.sbin/sysinstall/menus.c | 177 +++++++++++++++++++++----------------------- 1 file changed, 86 insertions(+), 91 deletions(-) (limited to 'usr.sbin/sysinstall/menus.c') diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 3450a3e..c4afad5 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: menus.c,v 1.1.1.1 1995/04/27 12:50:34 jkh Exp $ + * $Id: menus.c,v 1.2 1995/04/27 18:03:54 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -55,83 +55,9 @@ extern DMenu MenuMedia; extern DMenu MenuInstallType; extern DMenu MenuInstallOptions; -/* - * Bloody C won't let me nest these initializers properly - do the - * items and the menus containing them as two seperate initializers - * done in two groups. - */ - -/* First, the lists of items */ - -/* Documentation menu */ -DMenuItem _doc_items[] = { - { "README", "Read this for a general description of FreeBSD", /* R */ - MENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 }, - { "Hardware", "The FreeBSD survival guide for PC hardware.", /* H */ - MENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 }, - { "Install", "A step-by-step guide to installing FreeBSD.", /* I */ - MENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 }, - { "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */ - MENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 }, - { NULL } -}; - -/* Language menu */ -DMenuItem _lang_items[] = { - { "English", "The system default language", /* E */ - MENU_SET_VARIABLE, (void *)"LANG=en", 0 }, - { "French", "French language and character set (ISO-8859-1)", /* F */ - MENU_SET_VARIABLE, (void *)"LANG=fr", 0 }, - { "German", "German language and character set (ISO-8859-1)", /* G */ - MENU_SET_VARIABLE, (void *)"LANG=de", 0 }, - { "Japanese", "Japanese language and character set (JIS?)", /* J */ - MENU_SET_VARIABLE, (void *)"LANG=jp", 0 }, - { "Russian", "Russian language and character set (cp866-8x14)", /* R */ - MENU_SET_VARIABLE, (void *)"LANG=ru", 0 }, - { NULL }, -}; - -/* The first menu */ -DMenuItem _initial_items[] = { - { "Usage", "Quick start - How to use this menu system.", /* U */ - MENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 }, - { "Doc", "More detailed documentation on FreeBSD.", /* D */ - MENU_SUBMENU, (void *)&MenuDocumentation, 0 }, - { "Lang", "Select natural language options.", /* L */ - MENU_SUBMENU, (void *)&MenuLanguage, 0 }, - { "Express", "Express installation (don't ask)", /* E */ - MENU_CALL, (void *)installExpress, 0 }, - { "Custom", "Custom installation (please ask)", /* C */ - MENU_CALL, (void *)installCustom, 0 }, - { NULL }, -}; - -/* Installation media menu */ -DMenuItem _media_items[] = { - { "CDROM", "Install from a FreeBSD CDROM", - MENU_CALL, (void *)mediaSetCDROM, 0 }, - { NULL }, -}; - -/* Installation main menu */ -DMenuItem _install_items[] = { - { "Media", "Choose Installation media type", /* M */ - MENU_SUBMENU, (void *)&MenuMedia, 0 }, - { "Type", "Choose the type of installation you want", /* T */ - MENU_SUBMENU, (void *)&MenuInstallType, 0 }, - { "Options", "Specify installation options", /* O */ - MENU_SUBMENU, (void *)&MenuInstallOptions, 0 }, - { "Proceed", "Proceed with installation", /* P */ - MENU_CANCEL, (void *)NULL, 0 }, - { NULL }, -}; - -DMenuItem _null_items[] = { - { NULL }, -}; - -/* Start the menu outer bodies */ +/* The initial installation menu */ DMenu MenuInitial = { + DMENU_NORMAL_TYPE, "Welcome to FreeBSD 2.0.5!", /* title */ "This is the main menu of the FreeBSD installation system. Please\n\ select one of the options below by using the arrow keys or typing the\n\ @@ -139,12 +65,26 @@ first character of the option name you're interested in. Invoke an\n\ option by pressing enter.", /* prompt */ "Press F1 for further help", /* help line */ "help/initial.hlp", /* help file */ - _initial_items, + { { "Usage", "Quick start - How to use this menu system.", /* U */ + DMENU_DISPLAY_FILE, (void *)"help/initial.hlp", 0 }, + { "Doc", "More detailed documentation on FreeBSD.", /* D */ + DMENU_SUBMENU, (void *)&MenuDocumentation, 0 }, + { "Lang", "Select natural language options.", /* L */ + DMENU_SUBMENU, (void *)&MenuLanguage, 0 }, + { "Express", "Express installation (don't ask)", /* E */ + DMENU_CALL, (void *)installExpress, 0 }, + { "Custom", "Custom installation (please ask)", /* C */ + DMENU_CALL, (void *)installCustom, 0 }, + { "Maint", "Go into maintainance mode (`fix it').", /* M */ + DMENU_CALL, (void *)installMaint, 0 }, + { NULL } }, }; +/* The main documentation menu */ DMenu MenuDocumentation = { + DMENU_NORMAL_TYPE, "Documentation for FreeBSD 2.0.5", /* Title */ - "If you are at all unsure about the configuration of your hardware\n + "If you are at all unsure about the configuration of your hardware\n\ or are looking to build a system specifically for FreeBSD, read the\n\ Hardware guide! New users should also read the Install document for\n\ a step-by-step tutorial on installing FreeBSD. For general information,\n\ @@ -152,50 +92,97 @@ consult the README file. If you're having other problems, you may find\n\ answers in the FAQ.", "Having trouble? Press F1 for help!", /* help line */ "help/usage.hlp", /* help file */ - _doc_items, + { { "README", "Read this for a general description of FreeBSD", /* R */ + DMENU_DISPLAY_FILE, (void *)"help/readme.hlp", 0 }, + { "Hardware", "The FreeBSD survival guide for PC hardware.", /* H */ + DMENU_DISPLAY_FILE, (void *)"help/hardware.hlp", 0 }, + { "Install", "A step-by-step guide to installing FreeBSD.", /* I */ + DMENU_DISPLAY_FILE, (void *)"help/install.hlp", 0 }, + { "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */ + DMENU_DISPLAY_FILE, (void *)"help/faq.hlp", 0 }, + { NULL } }, }; +/* The language selection menu */ +/* + * Note: The RADIO menus use a slightly different syntax. If an item + * name starts with `*', it's considered to be "ON" by default, + * otherwise off. + */ DMenu MenuLanguage = { + DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "Natural language selection", /* title */ - "Please specify the language you'd like to use by default.\n\ -While a large amount of the system's documentation is still\n\ -written in english (and may never be translated), there are some\n\ -guides and system documentation that may be written in your\n\ + "Please specify the language you'd like to use by default.\n\n\ +While almost all of the system's documentation is still\n\ +written in english (and may never be translated), there are a few\n\ +guides and types of system documentation that may be written in your\n\ preferred language. When such are found, they will be used instead\n\ of the english versions.", /* prompt */ "Press F1 for more information", /* help line */ "help/language.hlp", /* help file */ - _lang_items, + { { "Danish", "Danish language and character set (ISO-8859-1)", /* D */ + DMENU_SET_VARIABLE, (void *)"LANG=en", 0 }, + { "*English", "English language (system default)", /* E */ + DMENU_SET_VARIABLE, (void *)"LANG=en", 0 }, + { "French", "French language and character set (ISO-8859-1)", /* F */ + DMENU_SET_VARIABLE, (void *)"LANG=fr", 0 }, + { "German", "German language and character set (ISO-8859-1)", /* G */ + DMENU_SET_VARIABLE, (void *)"LANG=de", 0 }, + { "Japanese", "Japanese language and character set (JIS?)", /* J */ + DMENU_SET_VARIABLE, (void *)"LANG=jp", 0 }, + { "Russian", "Russian language and character set (cp866-8x14)", /* R */ + DMENU_SET_VARIABLE, (void *)"LANG=ru", 0 }, + { NULL } }, }; +/* The media selection menu */ DMenu MenuMedia = { + DMENU_NORMAL_TYPE, "Choose Installation Media", "FreeBSD can be installed from a variety of different installation\n\ media, from floppies to the Internet. If you're installing FreeBSD from\n\ a supported CDROM drive then this is generally the best method to\n\ use unless you have some overriding reason for using another method.", - NULL, - NULL, - _media_items, + "Press F1 for more information on the various media types", + "help/media.hlp", + { { "CDROM", "Install from a FreeBSD CDROM", + DMENU_CALL, (void *)mediaSetCDROM, 0 }, + { "FLOPPY", "Install from a floppy disk set", + DMENU_CALL, (void *)mediaSetFloppy, 0 }, + { "DOS", "Install from a DOS partition", + DMENU_CALL, (void *)mediaSetDOS, 0 }, + { "TAPE", "Install from SCSI or QIC tape", + DMENU_CALL, (void *)mediaSetTape, 0 }, + { "FTP", "Install from an Internet FTP server", + DMENU_CALL, (void *)mediaSetFTP, 0 }, + { "FILESYSTEM", "Install from a UFS or NFS mounted distribution", + DMENU_CALL, (void *)mediaSetFS, 0 }, + { NULL } }, }; +/* The installation type menu */ DMenu MenuInstallType = { + DMENU_NORMAL_TYPE, "Choose Installation Type", "blah blah", NULL, NULL, - _null_items, + { { NULL } }, }; +/* The installation options menu */ DMenu MenuInstallOptions = { + DMENU_NORMAL_TYPE, "Choose Installation Options", "blah blah", NULL, NULL, - _null_items, + { { NULL } }, }; +/* The main installation menu */ DMenu MenuInstall = { + DMENU_NORMAL_TYPE, "Choose Installation Options", /* title */ "Before installation can continue, you need to specify a few items\n\ of information regarding the location of the distribution and the kind\n\ @@ -204,6 +191,14 @@ of options you can specify in the Options menu. If you do not wish to\n\ install FreeBSD at this time, you may select Cancel to leave this menu", "You may wish to read the install guide - press F1 to do so", "help/install.hlp", - _install_items, + { { "Media", "Choose Installation media type", /* M */ + DMENU_SUBMENU, (void *)&MenuMedia, 0 }, + { "Type", "Choose the type of installation you want", /* T */ + DMENU_SUBMENU, (void *)&MenuInstallType, 0 }, + { "Options", "Specify installation options", /* O */ + DMENU_SUBMENU, (void *)&MenuInstallOptions, 0 }, + { "Proceed", "Proceed with installation", /* P */ + DMENU_CANCEL, (void *)NULL, 0 }, + { NULL } }, }; -- cgit v1.1