mconf.c (a23e1966932464e1c5226cb9ac4ce1d5fc10ba22) | mconf.c (fde192511bdbff554320b31574bb8a9cb3275522) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 4 * 5 * Introduced single menu mode (show all sub-menus in one large tree). 6 * 2002-11-06 Petr Baudis <pasky@ucw.cz> 7 * 8 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br> --- 509 unchanged lines hidden (view full) --- 518 struct menu *def_menu = NULL; 519 520 child_count++; 521 for (child = menu->list; child; child = child->next) { 522 if (menu_is_visible(child) && child->sym == def_sym) 523 def_menu = child; 524 } 525 | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 4 * 5 * Introduced single menu mode (show all sub-menus in one large tree). 6 * 2002-11-06 Petr Baudis <pasky@ucw.cz> 7 * 8 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br> --- 509 unchanged lines hidden (view full) --- 518 struct menu *def_menu = NULL; 519 520 child_count++; 521 for (child = menu->list; child; child = child->next) { 522 if (menu_is_visible(child) && child->sym == def_sym) 523 def_menu = child; 524 } 525 |
526 val = sym_get_tristate_value(sym); 527 if (sym_is_changeable(sym)) { 528 switch (type) { 529 case S_BOOLEAN: 530 item_make("[%c]", val == no ? ' ' : '*'); 531 break; 532 case S_TRISTATE: 533 switch (val) { 534 case yes: ch = '*'; break; 535 case mod: ch = 'M'; break; 536 default: ch = ' '; break; 537 } 538 item_make("<%c>", ch); 539 break; 540 } 541 item_set_tag('t'); 542 item_set_data(menu); 543 } else { 544 item_make(" "); 545 item_set_tag(def_menu ? 't' : ':'); 546 item_set_data(menu); 547 } | 526 item_make(" "); 527 item_set_tag(def_menu ? 't' : ':'); 528 item_set_data(menu); |
548 549 item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu)); | 529 530 item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu)); |
550 if (val == yes) { 551 if (def_menu) { 552 item_add_str(" (%s)", menu_get_prompt(def_menu)); 553 item_add_str(" --->"); 554 if (def_menu->list) { 555 indent += 2; 556 build_conf(def_menu); 557 indent -= 2; 558 } 559 } 560 return; 561 } | 531 if (def_menu) 532 item_add_str(" (%s) --->", menu_get_prompt(def_menu)); 533 return; |
562 } else { 563 if (menu == current_menu) { 564 item_make("---%*c%s", indent + 1, ' ', menu_get_prompt(menu)); 565 item_set_tag(':'); 566 item_set_data(menu); 567 goto conf_childs; 568 } 569 child_count++; 570 val = sym_get_tristate_value(sym); | 534 } else { 535 if (menu == current_menu) { 536 item_make("---%*c%s", indent + 1, ' ', menu_get_prompt(menu)); 537 item_set_tag(':'); 538 item_set_data(menu); 539 goto conf_childs; 540 } 541 child_count++; 542 val = sym_get_tristate_value(sym); |
571 if (sym_is_choice_value(sym) && val == yes) { 572 item_make(" "); 573 item_set_tag(':'); | 543 switch (type) { 544 case S_BOOLEAN: 545 if (sym_is_changeable(sym)) 546 item_make("[%c]", val == no ? ' ' : '*'); 547 else 548 item_make("-%c-", val == no ? ' ' : '*'); 549 item_set_tag('t'); |
574 item_set_data(menu); | 550 item_set_data(menu); |
575 } else { 576 switch (type) { 577 case S_BOOLEAN: 578 if (sym_is_changeable(sym)) 579 item_make("[%c]", val == no ? ' ' : '*'); 580 else 581 item_make("-%c-", val == no ? ' ' : '*'); 582 item_set_tag('t'); 583 item_set_data(menu); 584 break; 585 case S_TRISTATE: 586 switch (val) { 587 case yes: ch = '*'; break; 588 case mod: ch = 'M'; break; 589 default: ch = ' '; break; 590 } 591 if (sym_is_changeable(sym)) { 592 if (sym->rev_dep.tri == mod) 593 item_make("{%c}", ch); 594 else 595 item_make("<%c>", ch); 596 } else 597 item_make("-%c-", ch); 598 item_set_tag('t'); 599 item_set_data(menu); 600 break; 601 default: 602 tmp = 2 + strlen(sym_get_string_value(sym)); /* () = 2 */ 603 item_make("(%s)", sym_get_string_value(sym)); 604 tmp = indent - tmp + 4; 605 if (tmp < 0) 606 tmp = 0; 607 item_add_str("%*c%s%s", tmp, ' ', menu_get_prompt(menu), 608 (sym_has_value(sym) || !sym_is_changeable(sym)) ? 609 "" : " (NEW)"); 610 item_set_tag('s'); 611 item_set_data(menu); 612 goto conf_childs; | 551 break; 552 case S_TRISTATE: 553 switch (val) { 554 case yes: ch = '*'; break; 555 case mod: ch = 'M'; break; 556 default: ch = ' '; break; |
613 } | 557 } |
558 if (sym_is_changeable(sym)) { 559 if (sym->rev_dep.tri == mod) 560 item_make("{%c}", ch); 561 else 562 item_make("<%c>", ch); 563 } else 564 item_make("-%c-", ch); 565 item_set_tag('t'); 566 item_set_data(menu); 567 break; 568 default: 569 tmp = 2 + strlen(sym_get_string_value(sym)); /* () = 2 */ 570 item_make("(%s)", sym_get_string_value(sym)); 571 tmp = indent - tmp + 4; 572 if (tmp < 0) 573 tmp = 0; 574 item_add_str("%*c%s%s", tmp, ' ', menu_get_prompt(menu), 575 (sym_has_value(sym) || !sym_is_changeable(sym)) ? 576 "" : " (NEW)"); 577 item_set_tag('s'); 578 item_set_data(menu); 579 goto conf_childs; |
|
614 } 615 item_add_str("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu), 616 (sym_has_value(sym) || !sym_is_changeable(sym)) ? 617 "" : " (NEW)"); 618 if (menu->prompt->type == P_MENU) { 619 item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->"); 620 return; 621 } --- 207 unchanged lines hidden (view full) --- 829 switch (item_tag()) { 830 case 'm': 831 if (single_menu_mode) 832 submenu->data = (void *) (long) !submenu->data; 833 else 834 conf(submenu, NULL); 835 break; 836 case 't': | 580 } 581 item_add_str("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu), 582 (sym_has_value(sym) || !sym_is_changeable(sym)) ? 583 "" : " (NEW)"); 584 if (menu->prompt->type == P_MENU) { 585 item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->"); 586 return; 587 } --- 207 unchanged lines hidden (view full) --- 795 switch (item_tag()) { 796 case 'm': 797 if (single_menu_mode) 798 submenu->data = (void *) (long) !submenu->data; 799 else 800 conf(submenu, NULL); 801 break; 802 case 't': |
837 if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) | 803 if (sym_is_choice(sym)) |
838 conf_choice(submenu); 839 else if (submenu->prompt->type == P_MENU) 840 conf(submenu, NULL); 841 break; 842 case 's': 843 conf_string(submenu); 844 break; 845 } --- 151 unchanged lines hidden --- | 804 conf_choice(submenu); 805 else if (submenu->prompt->type == P_MENU) 806 conf(submenu, NULL); 807 break; 808 case 's': 809 conf_string(submenu); 810 break; 811 } --- 151 unchanged lines hidden --- |