Totally refrobnicate stage0. Add an extern to sysinstall.h so we can
all share the same `selection' variable.
This commit is contained in:
parent
cff7905259
commit
61386f1ebb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3972
@ -1,13 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* ----------------------------------------------------------------------------
|
* Copyright (c) 1994, Jordan Hubbard, Paul Richards and Poul-Henning Kamp.
|
||||||
* "THE BEER-WARE LICENSE" (Revision 42):
|
|
||||||
* <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
|
|
||||||
* can do whatever you want with this stuff. If we meet some day, and you think
|
|
||||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
|
||||||
* ----------------------------------------------------------------------------
|
|
||||||
*
|
*
|
||||||
* $Id: stage0.c,v 1.2 1994/10/20 04:59:56 phk Exp $
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
* This software may be used, modified, copied, distributed, and
|
||||||
|
* sold, in both source and binary form provided that the above
|
||||||
|
* copyright and these terms are retained, verbatim, as the first
|
||||||
|
* lines of this file. Under no circumstances is the author
|
||||||
|
* responsible for the proper functioning of this software, nor does
|
||||||
|
* the author assume any responsibility for damages incurred with
|
||||||
|
* its use.
|
||||||
|
*
|
||||||
|
* [Note: This file bears almost no resemblance to what was here in an
|
||||||
|
* earlier incarnation].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -19,15 +24,50 @@
|
|||||||
|
|
||||||
#include "sysinstall.h"
|
#include "sysinstall.h"
|
||||||
|
|
||||||
void
|
static char *welcome[] = {
|
||||||
stage0()
|
"View 'READ ME FIRST' File.",
|
||||||
|
"View FreeBSD Copyright Information.",
|
||||||
|
"Proceed with installation.",
|
||||||
|
"Repair existing installation ('fixit' mode).",
|
||||||
|
"Exit to shell.",
|
||||||
|
};
|
||||||
|
|
||||||
|
void stage0()
|
||||||
{
|
{
|
||||||
|
int valid = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (!dialog_menu("Welcome to FreeBSD!",
|
||||||
|
"Please select one of the following options.\n",
|
||||||
|
10, 75, 5, 5, welcome, selection))
|
||||||
|
valid = 1;
|
||||||
|
dialog_clear();
|
||||||
|
} while (!valid);
|
||||||
|
switch (atoi(selection)) {
|
||||||
|
case 1: /* View readme */
|
||||||
if (!access(README_FILE, R_OK)) {
|
if (!access(README_FILE, R_OK)) {
|
||||||
dialog_clear();
|
dialog_clear();
|
||||||
dialog_textbox("READ ME FIRST", README_FILE, 24, 80);
|
dialog_textbox("READ ME FIRST", README_FILE, 24, 80);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: /* View copyrights */
|
||||||
if (!access(COPYRIGHT_FILE, R_OK)) {
|
if (!access(COPYRIGHT_FILE, R_OK)) {
|
||||||
dialog_clear();
|
dialog_clear();
|
||||||
dialog_textbox("COPYRIGHT", COPYRIGHT_FILE, 24, 80);
|
dialog_textbox("COPYRIGHT", COPYRIGHT_FILE, 24, 80);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3: /* Proceed (do nothing special, really) */
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
dialog_msgbox("Sorry!", "This feature not currently implemented.",
|
||||||
|
6, 75, 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
exit(0);
|
||||||
|
break; /* hope not! :) */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
EXTERN char *devicename[MAXFS+1];
|
EXTERN char *devicename[MAXFS+1];
|
||||||
EXTERN char *mountpoint[MAXFS+1];
|
EXTERN char *mountpoint[MAXFS+1];
|
||||||
EXTERN int dialog_active;
|
EXTERN int dialog_active;
|
||||||
|
EXTERN char selection[];
|
||||||
|
|
||||||
extern unsigned char **avail_disknames;
|
extern unsigned char **avail_disknames;
|
||||||
extern int no_disks;
|
extern int no_disks;
|
||||||
|
Loading…
Reference in New Issue
Block a user