From patchwork Sat Apr 30 08:15:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 8986711 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6759F9F1C1 for ; Sat, 30 Apr 2016 08:15:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A891201B9 for ; Sat, 30 Apr 2016 08:15:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0052420142 for ; Sat, 30 Apr 2016 08:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752261AbcD3IPu (ORCPT ); Sat, 30 Apr 2016 04:15:50 -0400 Received: from services.gouders.net ([141.101.32.176]:43562 "EHLO services.gouders.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752223AbcD3IPr (ORCPT ); Sat, 30 Apr 2016 04:15:47 -0400 Received: from localhost (ltea-047-067-015-221.pools.arcor-ip.net [47.67.15.221]) (authenticated bits=0) by services.gouders.net (8.14.8/8.14.8) with ESMTP id u3U8FjIa028408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 30 Apr 2016 10:15:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1462004146; bh=H+t2Va1/gC5LJDHLuIcAPYbhutlYeehyHI9wXkkM8aY=; h=From:To:Subject:Date; b=S0G+X20qmxqy4sxgt1rNpQARkZA9njpy4g6nADMw/x/2vG78jQ51upMnWV3Gx5ark ljl8RycwgSjMCX0O5QOKLqc3BJ0E97UUKinVtLRoGYOqj3iAo1k5jAOw6QDe+xh68R WS/c6tIgHXM5E1Aim8Gg982yutf/zC5NKbhM+lwE= From: Dirk Gouders To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] mconf: expand show_all_options to choices' checklist menus User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Date: Sat, 30 Apr 2016 10:15:36 +0200 Message-ID: MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_ADSP_DISCARD, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Boolean choices' checklist menus are currently immune against the 'z' key that toggles visibility of all options. Expansion of the 'z' toggle could be of use when debugging problems with comlex choice menus. A new tag 'z' for dialog_items was introduced for this purpose. Signed-off-by: Dirk Gouders --- scripts/kconfig/lxdialog/checklist.c | 31 ++++++++++++++++++++++++++----- scripts/kconfig/mconf.c | 11 ++++++++--- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c index 8d016fa..2e3bc33 100644 --- a/scripts/kconfig/lxdialog/checklist.c +++ b/scripts/kconfig/lxdialog/checklist.c @@ -46,7 +46,14 @@ static void print_item(WINDOW * win, int choice, int selected) wattrset(win, selected ? dlg.check_selected.atr : dlg.check.atr); if (!item_is_tag(':')) - wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); + if (item_is_tag('z')) + /* + * inactive items visible because of + * show_all_options. + */ + wprintw(win, "- -"); + else + wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); mvwaddch(win, choice, item_x, list_item[0]); @@ -296,10 +303,18 @@ do_resize: item_foreach() item_set_selected(0); item_set(scroll + choice); - item_set_selected(1); - delwin(list); - delwin(dialog); - return button; + if (!item_is_tag('z') || button == 1) { + /* + Return if selected item isn't an + item only visible because of + show_all options or if help was selected. + */ + item_set_selected(1); + delwin(list); + delwin(dialog); + return button; + } + continue; case TAB: case KEY_LEFT: case KEY_RIGHT: @@ -316,6 +331,12 @@ do_resize: case KEY_ESC: key = on_key_esc(dialog); break; + case 'z': + case 'Z': + button = 2; /* toggle show_all_options */ + delwin(list); + delwin(dialog); + return button; case KEY_RESIZE: delwin(list); delwin(dialog); diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 315ce2c..e87a117 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -811,11 +811,13 @@ static void conf_choice(struct menu *menu) current_menu = menu; for (child = menu->list; child; child = child->next) { - if (!menu_is_visible(child)) + if (!menu_is_visible(child) && !show_all_options) continue; - if (child->sym) + if (child->sym) { item_make("%s", _(menu_get_prompt(child))); - else { + if (!menu_is_visible(child)) + item_set_tag('z'); + } else { item_make("*** %s ***", _(menu_get_prompt(child))); item_set_tag(':'); } @@ -850,6 +852,9 @@ static void conf_choice(struct menu *menu) } else show_help(menu); break; + case 2: + show_all_options = !show_all_options; + break; case KEY_ESC: return; case -ERRDISPLAYTOOSMALL: