Browse Source

Set correct default choice depending on both whether the item wants to be

default and the installer-menu-item number

r1257
keep-around/c8703c509368e1805e513d61f98a9d17d2cdd9cc
Tollef Fog Heen 21 years ago
parent
commit
ded1b40ed0
  1. 5
      debian/changelog
  2. 18
      main-menu.c

5
debian/changelog

@ -4,8 +4,11 @@ main-menu (0.017) unstable; urgency=low
* Martin Sjögren
- Be more intelligent about the default choice when choosing between
several functionality-providing packages.
* Tollef Fog Heen
- Set correct default choice depending on both whether the item wants to
be default and the installer-menu-item number
-- Tollef Fog Heen <tfheen@debian.org> Fri, 8 Nov 2002 19:51:48 +0100
-- Tollef Fog Heen <tfheen@debian.org> Thu, 14 Nov 2002 00:57:40 +0100
main-menu (0.016) unstable; urgency=low

18
main-menu.c

@ -110,9 +110,10 @@ struct package_t *show_main_menu(struct package_t *packages) {
static struct debconfclient *debconf = NULL;
char *language = NULL;
struct package_t **package_list, *p, *head = NULL, *tail = NULL;
struct package_t *menudefault = NULL;
struct language_description *langdesc;
int i = 0, num = 0;
char *s, *menudefault = NULL;
char *s;
char menutext[1024];
if (! debconf)
@ -174,8 +175,15 @@ struct package_t *show_main_menu(struct package_t *packages) {
*s++ = ',';
*s++ = ' ';
if (! menudefault && isdefault(p))
menudefault = p->description;
if (isdefault(p)) {
if (menudefault) {
if (menudefault->installer_menu_item > p->installer_menu_item) {
menudefault = p;
}
} else {
menudefault = p;
}
}
}
}
/* Trim trailing ", " */
@ -187,11 +195,11 @@ struct package_t *show_main_menu(struct package_t *packages) {
/* Make debconf show the menu and get the user's choice. */
debconf->command(debconf, "TITLE", "Debian Installer Main Menu", NULL);
if (menudefault)
debconf->command(debconf, "SET", MAIN_MENU, menudefault, NULL);
debconf->command(debconf, "SET", MAIN_MENU, menudefault->description, NULL);
debconf->command(debconf, "FSET", MAIN_MENU, "seen", "false", NULL);
debconf->command(debconf, "SUBST", MAIN_MENU, "MENU", menutext, NULL);
if (menudefault)
debconf->command(debconf, "SUBST", MAIN_MENU, "DEFAULT", menudefault, NULL);
debconf->command(debconf, "SUBST", MAIN_MENU, "DEFAULT", menudefault->description, NULL);
debconf->command(debconf, "INPUT medium", MAIN_MENU, NULL);
debconf->command(debconf, "GO", NULL);
debconf->command(debconf, "GET", MAIN_MENU, NULL);

Loading…
Cancel
Save