Allow both types of XFree86 setup script to be run at user choice.

This commit is contained in:
Jordan K. Hubbard 1997-01-24 20:20:12 +00:00
parent d733b8a9fb
commit 7ce6b270fd
9 changed files with 99 additions and 6 deletions

View File

@ -398,16 +398,26 @@ configUsers(dialogMenuItem *self)
int
configXFree86(dialogMenuItem *self)
{
if (file_executable("/usr/X11R6/bin/XF86Setup")) {
char *config, *execfile;
dialog_clear_norefresh();
dmenuOpenSimple(&MenuXF86Config, FALSE);
config = variable_get(VAR_XF86_CONFIG);
if (!config)
return DITEM_FAILURE | DITEM_RESTORE;
execfile = string_concat("/usr/X11R6/bin/", config);
if (file_executable(execfile)) {
dialog_clear_norefresh();
if (!file_readable("/dev/mouse") && !msgYesNo("Does this system have a mouse attached to it?"))
dmenuOpenSimple(&MenuMouse, FALSE);
dialog_clear();
systemExecute("/sbin/ldconfig /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat");
systemExecute("/usr/X11R6/bin/XF86Setup");
systemExecute(execfile);
return DITEM_SUCCESS | DITEM_RESTORE;
}
else {
dialog_clear_norefresh();
msgConfirm("XFree86 does not appear to be installed! Please install\n"
"The XFree86 distribution before attempting to configure it.");
return DITEM_FAILURE;

View File

@ -378,6 +378,25 @@ DMenu MenuMouse = {
{ NULL } },
};
DMenu MenuXF86Config = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Please select the XFree86 configuration tool you want to use.",
"The first tool, XF86Setup, is fully graphical and requires the\n"
"VGA16 server in order to work (should have been selected by\n"
"default, but if you de-selected it then you won't be able to\n"
"use this fancy setup tool). The second tool, xf86config, is\n"
"a more simplistic shell-script based tool and less friendly to\n"
"new users, but it may work in situations where the fancier one\n"
"does not.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86",
{ { "XF86Setup", "Use the fully graphical XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF86Setup" },
{ "xf86config", "Use the shell-script based XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" },
{ NULL } },
};
DMenu MenuMediaCDROM = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a CDROM type",

View File

@ -145,6 +145,7 @@
#define VAR_UFS_PATH "ufs"
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"
#define VAR_XF86_CONFIG "xf86config"
#define DEFAULT_TAPE_BLOCKSIZE "20"
@ -366,6 +367,7 @@ extern DMenu MenuDiskDevices; /* Disk devices menu */
extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
extern DMenu MenuUsermgmt; /* User management menu */
extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
extern DMenu MenuXF86Config; /* Select XFree86 configuration type */
/* Stuff from libdialog which isn't properly declared outside */
extern void display_helpfile(void);

View File

@ -398,16 +398,26 @@ configUsers(dialogMenuItem *self)
int
configXFree86(dialogMenuItem *self)
{
if (file_executable("/usr/X11R6/bin/XF86Setup")) {
char *config, *execfile;
dialog_clear_norefresh();
dmenuOpenSimple(&MenuXF86Config, FALSE);
config = variable_get(VAR_XF86_CONFIG);
if (!config)
return DITEM_FAILURE | DITEM_RESTORE;
execfile = string_concat("/usr/X11R6/bin/", config);
if (file_executable(execfile)) {
dialog_clear_norefresh();
if (!file_readable("/dev/mouse") && !msgYesNo("Does this system have a mouse attached to it?"))
dmenuOpenSimple(&MenuMouse, FALSE);
dialog_clear();
systemExecute("/sbin/ldconfig /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat");
systemExecute("/usr/X11R6/bin/XF86Setup");
systemExecute(execfile);
return DITEM_SUCCESS | DITEM_RESTORE;
}
else {
dialog_clear_norefresh();
msgConfirm("XFree86 does not appear to be installed! Please install\n"
"The XFree86 distribution before attempting to configure it.");
return DITEM_FAILURE;

View File

@ -378,6 +378,25 @@ DMenu MenuMouse = {
{ NULL } },
};
DMenu MenuXF86Config = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Please select the XFree86 configuration tool you want to use.",
"The first tool, XF86Setup, is fully graphical and requires the\n"
"VGA16 server in order to work (should have been selected by\n"
"default, but if you de-selected it then you won't be able to\n"
"use this fancy setup tool). The second tool, xf86config, is\n"
"a more simplistic shell-script based tool and less friendly to\n"
"new users, but it may work in situations where the fancier one\n"
"does not.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86",
{ { "XF86Setup", "Use the fully graphical XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF86Setup" },
{ "xf86config", "Use the shell-script based XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" },
{ NULL } },
};
DMenu MenuMediaCDROM = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a CDROM type",

View File

@ -145,6 +145,7 @@
#define VAR_UFS_PATH "ufs"
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"
#define VAR_XF86_CONFIG "xf86config"
#define DEFAULT_TAPE_BLOCKSIZE "20"
@ -366,6 +367,7 @@ extern DMenu MenuDiskDevices; /* Disk devices menu */
extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
extern DMenu MenuUsermgmt; /* User management menu */
extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
extern DMenu MenuXF86Config; /* Select XFree86 configuration type */
/* Stuff from libdialog which isn't properly declared outside */
extern void display_helpfile(void);

View File

@ -398,16 +398,26 @@ configUsers(dialogMenuItem *self)
int
configXFree86(dialogMenuItem *self)
{
if (file_executable("/usr/X11R6/bin/XF86Setup")) {
char *config, *execfile;
dialog_clear_norefresh();
dmenuOpenSimple(&MenuXF86Config, FALSE);
config = variable_get(VAR_XF86_CONFIG);
if (!config)
return DITEM_FAILURE | DITEM_RESTORE;
execfile = string_concat("/usr/X11R6/bin/", config);
if (file_executable(execfile)) {
dialog_clear_norefresh();
if (!file_readable("/dev/mouse") && !msgYesNo("Does this system have a mouse attached to it?"))
dmenuOpenSimple(&MenuMouse, FALSE);
dialog_clear();
systemExecute("/sbin/ldconfig /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat");
systemExecute("/usr/X11R6/bin/XF86Setup");
systemExecute(execfile);
return DITEM_SUCCESS | DITEM_RESTORE;
}
else {
dialog_clear_norefresh();
msgConfirm("XFree86 does not appear to be installed! Please install\n"
"The XFree86 distribution before attempting to configure it.");
return DITEM_FAILURE;

View File

@ -378,6 +378,25 @@ DMenu MenuMouse = {
{ NULL } },
};
DMenu MenuXF86Config = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Please select the XFree86 configuration tool you want to use.",
"The first tool, XF86Setup, is fully graphical and requires the\n"
"VGA16 server in order to work (should have been selected by\n"
"default, but if you de-selected it then you won't be able to\n"
"use this fancy setup tool). The second tool, xf86config, is\n"
"a more simplistic shell-script based tool and less friendly to\n"
"new users, but it may work in situations where the fancier one\n"
"does not.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86",
{ { "XF86Setup", "Use the fully graphical XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF86Setup" },
{ "xf86config", "Use the shell-script based XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" },
{ NULL } },
};
DMenu MenuMediaCDROM = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a CDROM type",

View File

@ -145,6 +145,7 @@
#define VAR_UFS_PATH "ufs"
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"
#define VAR_XF86_CONFIG "xf86config"
#define DEFAULT_TAPE_BLOCKSIZE "20"
@ -366,6 +367,7 @@ extern DMenu MenuDiskDevices; /* Disk devices menu */
extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
extern DMenu MenuUsermgmt; /* User management menu */
extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
extern DMenu MenuXF86Config; /* Select XFree86 configuration type */
/* Stuff from libdialog which isn't properly declared outside */
extern void display_helpfile(void);