From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> To: unlisted-recipients:; (no To-header on input) Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Maxim Levitsky <mlevitsk@redhat.com>, Masahiro Yamada <masahiroy@kernel.org>, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] kconfig: qconf: make search fully work again on split mode Date: Mon, 29 Jun 2020 11:35:37 +0200 [thread overview] Message-ID: <a7aebb6046cab082f6f0d589195ca717f8b81070.1593423060.git.mchehab+huawei@kernel.org> (raw) In-Reply-To: <cover.1593423060.git.mchehab+huawei@kernel.org> When the search dialog box finds symbols/menus that match the search criteria, it presents all results at the window. Clicking on a search result should make qconf to navigate to the selected item. This works on singleMode and on fullMode, but on splitMode, the navigation is broken. This was partially caused by an incomplete Qt5 conversion and by the followup patches that restored the original behavior. When qconf is on split mode, it has to update both the config and the menu views. Right now, such logic is broken, as it is not seeking using the right structures. On qconf, the screen is split into 3 parts: +------------+-------+ | | | | Config | Menu | | | | +------------+-------+ | | | ConfigInfo | | | +--------------------+ On singleMode and on fullMode, the menuView is hidden, and search updates only the configList (which controls the ConfigView). On SplitMode, the search logic should detect if the variable is a leaf or not. If it is a leaf, it should be presented at the menuView, and both configList and menuList should be updated. Otherwise, just the configList should be updated. Link: https://lore.kernel.org/lkml/a98b0f0ebe0c23615a76f1d23f25fd0c84835e6b.camel@redhat.com/ Reported-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> --- scripts/kconfig/qconf.cc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 67dac2406a98..85782da3e464 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1636,22 +1636,33 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) return; list->setRootMenu(parent); break; - case symbolMode: + case menuMode: if (menu->flags & MENU_ROOT) { - configList->setRootMenu(menu); + menuList->setRootMenu(menu); configList->clearSelection(); - list = menuList; - } else { list = configList; + } else { parent = menu_get_parent_menu(menu->parent); if (!parent) return; - item = menuList->findConfigItem(parent); + + /* Clear an already-selected item */ + if (!configList->selectedItems().isEmpty()) { + item = (ConfigItem*)configList->selectedItems().first(); + if (item) + item->setSelected(false); + } + + /* Select the config view */ + item = configList->findConfigItem(parent); if (item) { item->setSelected(true); - menuList->scrollToItem(item); + configList->scrollToItem(item); } - list->setRootMenu(parent); + + menuList->setRootMenu(parent); + menuList->clearSelection(); + list = menuList; } break; case fullMode: -- 2.26.2
WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Maxim Levitsky <mlevitsk@redhat.com>, Masahiro Yamada <masahiroy@kernel.org>, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] kconfig: qconf: make search fully work again on split mode Date: Mon, 29 Jun 2020 11:35:37 +0200 [thread overview] Message-ID: <a7aebb6046cab082f6f0d589195ca717f8b81070.1593423060.git.mchehab+huawei@kernel.org> (raw) In-Reply-To: <cover.1593423060.git.mchehab+huawei@kernel.org> When the search dialog box finds symbols/menus that match the search criteria, it presents all results at the window. Clicking on a search result should make qconf to navigate to the selected item. This works on singleMode and on fullMode, but on splitMode, the navigation is broken. This was partially caused by an incomplete Qt5 conversion and by the followup patches that restored the original behavior. When qconf is on split mode, it has to update both the config and the menu views. Right now, such logic is broken, as it is not seeking using the right structures. On qconf, the screen is split into 3 parts: +------------+-------+ | | | | Config | Menu | | | | +------------+-------+ | | | ConfigInfo | | | +--------------------+ On singleMode and on fullMode, the menuView is hidden, and search updates only the configList (which controls the ConfigView). On SplitMode, the search logic should detect if the variable is a leaf or not. If it is a leaf, it should be presented at the menuView, and both configList and menuList should be updated. Otherwise, just the configList should be updated. Link: https://lore.kernel.org/lkml/a98b0f0ebe0c23615a76f1d23f25fd0c84835e6b.camel@redhat.com/ Reported-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> --- scripts/kconfig/qconf.cc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 67dac2406a98..85782da3e464 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1636,22 +1636,33 @@ void ConfigMainWindow::setMenuLink(struct menu *menu) return; list->setRootMenu(parent); break; - case symbolMode: + case menuMode: if (menu->flags & MENU_ROOT) { - configList->setRootMenu(menu); + menuList->setRootMenu(menu); configList->clearSelection(); - list = menuList; - } else { list = configList; + } else { parent = menu_get_parent_menu(menu->parent); if (!parent) return; - item = menuList->findConfigItem(parent); + + /* Clear an already-selected item */ + if (!configList->selectedItems().isEmpty()) { + item = (ConfigItem*)configList->selectedItems().first(); + if (item) + item->setSelected(false); + } + + /* Select the config view */ + item = configList->findConfigItem(parent); if (item) { item->setSelected(true); - menuList->scrollToItem(item); + configList->scrollToItem(item); } - list->setRootMenu(parent); + + menuList->setRootMenu(parent); + menuList->clearSelection(); + list = menuList; } break; case fullMode: -- 2.26.2
next prev parent reply other threads:[~2020-06-29 21:37 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-29 9:35 [PATCH v2 0/5] Fix split view search and debug info navigation Mauro Carvalho Chehab 2020-06-29 9:35 ` Mauro Carvalho Chehab 2020-06-29 9:35 ` [PATCH v2 1/5] kconfig: qconf: cleanup includes Mauro Carvalho Chehab 2020-06-29 9:35 ` Mauro Carvalho Chehab 2020-06-29 9:35 ` [PATCH v2 2/5] kconfig: qconf: ensure that only one item will be highlighted Mauro Carvalho Chehab 2020-06-29 9:35 ` Mauro Carvalho Chehab 2020-06-29 9:35 ` Mauro Carvalho Chehab [this message] 2020-06-29 9:35 ` [PATCH v2 3/5] kconfig: qconf: make search fully work again on split mode Mauro Carvalho Chehab 2020-06-29 9:35 ` [PATCH v2 4/5] kconfig: qconf: make debug links work again Mauro Carvalho Chehab 2020-06-29 9:35 ` Mauro Carvalho Chehab 2020-06-30 3:48 ` Masahiro Yamada 2020-06-29 9:35 ` [PATCH v2 5/5] kconfig: qconf: navigate menus on hyperlinks Mauro Carvalho Chehab 2020-06-29 9:35 ` Mauro Carvalho Chehab 2020-06-30 2:49 ` Masahiro Yamada 2020-06-30 3:36 ` Masahiro Yamada 2020-06-30 6:25 ` Mauro Carvalho Chehab 2020-06-29 10:57 ` [PATCH] kconfig: qconf: re-implement setSelected() Mauro Carvalho Chehab 2020-06-29 10:57 ` Mauro Carvalho Chehab 2020-06-29 12:23 ` [PATCH v2 0/5] Fix split view search and debug info navigation Maxim Levitsky 2020-06-29 14:46 ` Mauro Carvalho Chehab 2020-06-29 14:58 ` Maxim Levitsky
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=a7aebb6046cab082f6f0d589195ca717f8b81070.1593423060.git.mchehab+huawei@kernel.org \ --to=mchehab+huawei@kernel.org \ --cc=linux-kbuild@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=masahiroy@kernel.org \ --cc=mlevitsk@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.