2010-04-27 07:46:30

by Li Zefan

[permalink] [raw]
Subject: [PATCH 1/6] kconfig: print symbol type in help text

Randy suggested to print out the symbol type in gconfig.

Note this change does more than Randy's suggestion, that it also
affects the display of help text in other config tools.

│ Symbol: BLOCK [=y]
│ Type : boolean
│ Prompt: Enable the block layer
│ Defined at block/Kconfig:4
│ Depends on: EMBEDDED [=n]

Signed-off-by: Li Zefan <[email protected]>
---
scripts/kconfig/menu.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index e150176..b5d15fa 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -501,9 +501,11 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
bool hit;
struct property *prop;

- if (sym && sym->name)
+ if (sym && sym->name) {
str_printf(r, "Symbol: %s [=%s]\n", sym->name,
sym_get_string_value(sym));
+ str_printf(r, "Type : %s\n", sym_type_name(sym->type));
+ }
for_all_prompts(sym, prop)
get_prompt_str(r, prop);
hit = false;
--
1.6.3


2010-04-27 07:46:42

by Li Zefan

[permalink] [raw]
Subject: Re: [PATCH 1/6] kconfig: print symbol type in help text

[PATCH 2/6] menuconfig: improive help text a bit

Suggested-by: Randy Dunlap <[email protected]>
Signed-off-by: Li Zefan <[email protected]>
---
scripts/kconfig/mconf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 33f31eb..7ca6e8e 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -74,7 +74,7 @@ static const char mconf_readme[] = N_(
"\n"
" Shortcut: Press <H> or <?>.\n"
"\n"
-"o To show hidden options, press <Z>.\n"
+"o To toggle the display of hidden options, press <Z>.\n"
"\n"
"\n"
"Radiolists (Choice lists)\n"
--
1.6.3

2010-04-27 07:46:59

by Li Zefan

[permalink] [raw]
Subject: [PATCH 3/6] gconfig: fix to tag NEW symbols correctly

The logic should be reversed.

Signed-off-by: Li Zefan <[email protected]>
---
scripts/kconfig/gconf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index bef1041..1b18329 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1114,7 +1114,7 @@ static gchar **fill_row(struct menu *menu)

row[COL_OPTION] =
g_strdup_printf("%s %s", _(menu_get_prompt(menu)),
- sym && sym_has_value(sym) ? "(NEW)" : "");
+ sym && !sym_has_value(sym) ? "(NEW)" : "");

if (opt_mode == OPT_ALL && !menu_is_visible(menu))
row[COL_COLOR] = g_strdup("DarkGray");
--
1.6.3

2010-04-27 07:47:14

by Li Zefan

[permalink] [raw]
Subject: [PATCH 4/6] gconfig: fix null pointer warning

In gconfig if you enable "Show all options", you'll see some "(null)"
config options, and clicking those options triggers a warning:

(gconf:9368): Gtk-CRITICAL **: gtk_text_buffer_insert_with_tags: assertion `text != NULL' failed

Signed-off-by: Li Zefan <[email protected]>
---
scripts/kconfig/gconf.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 1b18329..d669882 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1343,7 +1343,8 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
#endif

if ((opt_mode == OPT_NORMAL && !menu_is_visible(child1)) ||
- (opt_mode == OPT_PROMPT && !menu_has_prompt(child1))) {
+ (opt_mode == OPT_PROMPT && !menu_has_prompt(child1)) ||
+ (opt_mode == OPT_ALL && !menu_get_prompt(child1))) {

/* remove node */
if (gtktree_iter_find_node(dst, menu1) != NULL) {
@@ -1425,7 +1426,7 @@ static void display_tree(struct menu *menu)

if ((opt_mode == OPT_NORMAL && menu_is_visible(child)) ||
(opt_mode == OPT_PROMPT && menu_has_prompt(child)) ||
- (opt_mode == OPT_ALL))
+ (opt_mode == OPT_ALL && menu_get_prompt(child)))
place_node(child, fill_row(child));
#ifdef DEBUG
printf("%*c%s: ", indent, ' ', menu_get_prompt(child));
--
1.6.3

2010-04-27 07:47:27

by Li Zefan

[permalink] [raw]
Subject: [PATCH 5/6] xconfig: remove unused function

Remove ConfigInfoView::setSource().

Signed-off-by: Li Zefan <[email protected]>
---
scripts/kconfig/qconf.cc | 28 ----------------------------
scripts/kconfig/qconf.h | 1 -
2 files changed, 0 insertions(+), 29 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 00c5150..d950fff 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -964,34 +964,6 @@ void ConfigInfoView::setInfo(struct menu *m)
menuInfo();
}

-void ConfigInfoView::setSource(const QString& name)
-{
- const char *p = name.latin1();
-
- menu = NULL;
- sym = NULL;
-
- switch (p[0]) {
- case 'm':
- struct menu *m;
-
- if (sscanf(p, "m%p", &m) == 1 && menu != m) {
- menu = m;
- menuInfo();
- emit menuSelected(menu);
- }
- break;
- case 's':
- struct symbol *s;
-
- if (sscanf(p, "s%p", &s) == 1 && sym != s) {
- sym = s;
- symbolInfo();
- }
- break;
- }
-}
-
void ConfigInfoView::symbolInfo(void)
{
QString str;
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index b3b5657..54775ae 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -254,7 +254,6 @@ public:
public slots:
void setInfo(struct menu *menu);
void saveSettings(void);
- void setSource(const QString& name);
void setShowDebug(bool);

signals:
--
1.6.3

2010-04-27 07:47:44

by Li Zefan

[permalink] [raw]
Subject: [PATCH 6/6] xconfig: Add support to show hidden options which have prompts

This feature has been supported in menuconfig and gconfig, so
here add it to xconfig.

Signed-off-by: Li Zefan <[email protected]>
---
scripts/kconfig/qconf.cc | 62 ++++++++++++++++++++++++++++++++-------------
scripts/kconfig/qconf.h | 16 +++++++++---
2 files changed, 56 insertions(+), 22 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index d950fff..f8c07c6 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -149,7 +149,7 @@ void ConfigItem::updateMenu(void)
case S_TRISTATE:
char ch;

- if (!sym_is_changable(sym) && !list->showAll) {
+ if (!sym_is_changable(sym) && list->optMode != normalOpt) {
setPixmap(promptColIdx, 0);
setText(noColIdx, QString::null);
setText(modColIdx, QString::null);
@@ -320,7 +320,7 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void),
- showAll(false), showName(false), showRange(false), showData(false),
+ showName(false), showRange(false), showData(false), optMode(normalOpt),
rootEntry(0), headerPopup(0)
{
int i;
@@ -337,10 +337,10 @@ ConfigList::ConfigList(ConfigView* p, const char *name)

if (name) {
configSettings->beginGroup(name);
- showAll = configSettings->readBoolEntry("/showAll", false);
showName = configSettings->readBoolEntry("/showName", false);
showRange = configSettings->readBoolEntry("/showRange", false);
showData = configSettings->readBoolEntry("/showData", false);
+ optMode = (enum optionMode)configSettings->readNumEntry("/optionMode", false);
configSettings->endGroup();
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
}
@@ -352,6 +352,17 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
reinit();
}

+bool ConfigList::menuSkip(struct menu *menu)
+{
+ if (optMode == normalOpt && menu_is_visible(menu))
+ return false;
+ if (optMode == promptOpt && menu_has_prompt(menu))
+ return false;
+ if (optMode == allOpt)
+ return false;
+ return true;
+}
+
void ConfigList::reinit(void)
{
removeColumn(dataColIdx);
@@ -380,7 +391,7 @@ void ConfigList::saveSettings(void)
configSettings->writeEntry("/showName", showName);
configSettings->writeEntry("/showRange", showRange);
configSettings->writeEntry("/showData", showData);
- configSettings->writeEntry("/showAll", showAll);
+ configSettings->writeEntry("/optionMode", (int)optMode);
configSettings->endGroup();
}
}
@@ -606,7 +617,7 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu)
}

visible = menu_is_visible(child);
- if (showAll || visible) {
+ if (!menuSkip(child)) {
if (!child->sym && !child->list && !child->prompt)
continue;
if (!item || item->menu != child)
@@ -860,13 +871,16 @@ ConfigView::~ConfigView(void)
}
}

-void ConfigView::setShowAll(bool b)
+void ConfigView::setOptionMode(QAction *act)
{
- if (list->showAll != b) {
- list->showAll = b;
- list->updateListAll();
- emit showAllChanged(b);
- }
+ if (act == showNormalAction)
+ list->optMode = normalOpt;
+ else if (act == showAllAction)
+ list->optMode = allOpt;
+ else
+ list->optMode = promptOpt;
+
+ list->updateListAll();
}

void ConfigView::setShowName(bool b)
@@ -1321,11 +1335,22 @@ ConfigMainWindow::ConfigMainWindow(void)
connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
showDataAction->setOn(configList->showData);
- QAction *showAllAction = new QAction(NULL, _("Show All Options"), 0, this);
- showAllAction->setToggleAction(TRUE);
- connect(showAllAction, SIGNAL(toggled(bool)), configView, SLOT(setShowAll(bool)));
- connect(showAllAction, SIGNAL(toggled(bool)), menuView, SLOT(setShowAll(bool)));
- showAllAction->setOn(configList->showAll);
+
+ QActionGroup *optGroup = new QActionGroup(this);
+ optGroup->setExclusive(TRUE);
+ connect(optGroup, SIGNAL(selected(QAction *)), configView,
+ SLOT(setOptionMode(QAction *)));
+
+ configView->showNormalAction = new QAction(NULL, _("Show Normal Options"), 0, optGroup);
+ configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup);
+ configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup);
+ configView->showNormalAction->setToggleAction(TRUE);
+ configView->showNormalAction->setOn(configList->optMode == normalOpt);
+ configView->showAllAction->setToggleAction(TRUE);
+ configView->showAllAction->setOn(configList->optMode == allOpt);
+ configView->showPromptAction->setToggleAction(TRUE);
+ configView->showPromptAction->setOn(configList->optMode == promptOpt);
+
QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this);
showDebugAction->setToggleAction(TRUE);
connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
@@ -1368,7 +1393,8 @@ ConfigMainWindow::ConfigMainWindow(void)
showRangeAction->addTo(optionMenu);
showDataAction->addTo(optionMenu);
optionMenu->insertSeparator();
- showAllAction->addTo(optionMenu);
+ optGroup->addTo(optionMenu);
+ optionMenu->insertSeparator();
showDebugAction->addTo(optionMenu);

// create help menu
@@ -1463,7 +1489,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
ConfigList* list = NULL;
ConfigItem* item;

- if (!menu_is_visible(menu) && !configView->showAll())
+ if (configList->menuSkip(menu))
return;

switch (configList->mode) {
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 54775ae..37bdaec 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -44,6 +44,9 @@ enum colIdx {
enum listMode {
singleMode, menuMode, symbolMode, fullMode, listMode
};
+enum optionMode {
+ normalOpt = 0, allOpt, promptOpt
+};

class ConfigList : public QListView {
Q_OBJECT
@@ -115,6 +118,8 @@ public:
void setAllOpen(bool open);
void setParentMenu(void);

+ bool menuSkip(struct menu *);
+
template <class P>
void updateMenuList(P*, struct menu*);

@@ -124,8 +129,9 @@ public:
QPixmap choiceYesPix, choiceNoPix;
QPixmap menuPix, menuInvPix, menuBackPix, voidPix;

- bool showAll, showName, showRange, showData;
+ bool showName, showRange, showData;
enum listMode mode;
+ enum optionMode optMode;
struct menu *rootEntry;
QColorGroup disabledColorGroup;
QColorGroup inactivedColorGroup;
@@ -222,17 +228,15 @@ public:
static void updateList(ConfigItem* item);
static void updateListAll(void);

- bool showAll(void) const { return list->showAll; }
bool showName(void) const { return list->showName; }
bool showRange(void) const { return list->showRange; }
bool showData(void) const { return list->showData; }
public slots:
- void setShowAll(bool);
void setShowName(bool);
void setShowRange(bool);
void setShowData(bool);
+ void setOptionMode(QAction *);
signals:
- void showAllChanged(bool);
void showNameChanged(bool);
void showRangeChanged(bool);
void showDataChanged(bool);
@@ -242,6 +246,10 @@ public:

static ConfigView* viewList;
ConfigView* nextView;
+
+ QAction *showNormalAction;
+ QAction *showAllAction;
+ QAction *showPromptAction;
};

class ConfigInfoView : public QTextBrowser {
--
1.6.3

2010-04-27 20:37:05

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 4/6] gconfig: fix null pointer warning

On Tue, 27 Apr 2010 15:49:00 +0800 Li Zefan wrote:

> In gconfig if you enable "Show all options", you'll see some "(null)"
> config options, and clicking those options triggers a warning:
>
> (gconf:9368): Gtk-CRITICAL **: gtk_text_buffer_insert_with_tags: assertion `text != NULL' failed
>
> Signed-off-by: Li Zefan <[email protected]>

Acked-by: Randy Dunlap <[email protected]>

> ---
> scripts/kconfig/gconf.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 1b18329..d669882 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -1343,7 +1343,8 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
> #endif
>
> if ((opt_mode == OPT_NORMAL && !menu_is_visible(child1)) ||
> - (opt_mode == OPT_PROMPT && !menu_has_prompt(child1))) {
> + (opt_mode == OPT_PROMPT && !menu_has_prompt(child1)) ||
> + (opt_mode == OPT_ALL && !menu_get_prompt(child1))) {
>
> /* remove node */
> if (gtktree_iter_find_node(dst, menu1) != NULL) {
> @@ -1425,7 +1426,7 @@ static void display_tree(struct menu *menu)
>
> if ((opt_mode == OPT_NORMAL && menu_is_visible(child)) ||
> (opt_mode == OPT_PROMPT && menu_has_prompt(child)) ||
> - (opt_mode == OPT_ALL))
> + (opt_mode == OPT_ALL && menu_get_prompt(child)))
> place_node(child, fill_row(child));
> #ifdef DEBUG
> printf("%*c%s: ", indent, ' ', menu_get_prompt(child));
> --


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2010-04-27 20:38:25

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 1/6] kconfig: print symbol type in help text

On Tue, 27 Apr 2010 15:48:16 +0800 Li Zefan wrote:

> Randy suggested to print out the symbol type in gconfig.
>
> Note this change does more than Randy's suggestion, that it also
> affects the display of help text in other config tools.
>
> │ Symbol: BLOCK [=y]
> │ Type : boolean
> │ Prompt: Enable the block layer
> │ Defined at block/Kconfig:4
> │ Depends on: EMBEDDED [=n]
>
> Signed-off-by: Li Zefan <[email protected]>

Acked-by: Randy Dunlap <[email protected]>

Thanks.

> ---
> scripts/kconfig/menu.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index e150176..b5d15fa 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -501,9 +501,11 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
> bool hit;
> struct property *prop;
>
> - if (sym && sym->name)
> + if (sym && sym->name) {
> str_printf(r, "Symbol: %s [=%s]\n", sym->name,
> sym_get_string_value(sym));
> + str_printf(r, "Type : %s\n", sym_type_name(sym->type));
> + }
> for_all_prompts(sym, prop)
> get_prompt_str(r, prop);
> hit = false;
> --
> 1.6.3


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2010-04-27 20:38:30

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 1/6] kconfig: print symbol type in help text

On Tue, 27 Apr 2010 15:48:29 +0800 Li Zefan wrote:

> [PATCH 2/6] menuconfig: improive help text a bit
>
> Suggested-by: Randy Dunlap <[email protected]>
> Signed-off-by: Li Zefan <[email protected]>

Acked-by: Randy Dunlap <[email protected]>

> ---
> scripts/kconfig/mconf.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
> index 33f31eb..7ca6e8e 100644
> --- a/scripts/kconfig/mconf.c
> +++ b/scripts/kconfig/mconf.c
> @@ -74,7 +74,7 @@ static const char mconf_readme[] = N_(
> "\n"
> " Shortcut: Press <H> or <?>.\n"
> "\n"
> -"o To show hidden options, press <Z>.\n"
> +"o To toggle the display of hidden options, press <Z>.\n"
> "\n"
> "\n"
> "Radiolists (Choice lists)\n"
> --


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2010-04-27 20:44:54

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 6/6] xconfig: Add support to show hidden options which have prompts

On Tue, 27 Apr 2010 15:49:30 +0800 Li Zefan wrote:

> This feature has been supported in menuconfig and gconfig, so
> here add it to xconfig.

Looks/sounds reasonable, but it does hide some symbols that were previously displayed
when in "Show all options" mode.

E.g., CONFIG_64BIT is not displayed at all with this patch applied
(except by the Search function).
Also, X86_32 is not displayed at all (when this patch is applied)
and it cannot be found or displayed by the Search function.

IOW, Show all options mode is busted. :(


> Signed-off-by: Li Zefan <[email protected]>
> ---
> scripts/kconfig/qconf.cc | 62 ++++++++++++++++++++++++++++++++-------------
> scripts/kconfig/qconf.h | 16 +++++++++---
> 2 files changed, 56 insertions(+), 22 deletions(-)
>
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index d950fff..f8c07c6 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -149,7 +149,7 @@ void ConfigItem::updateMenu(void)
> case S_TRISTATE:
> char ch;
>
> - if (!sym_is_changable(sym) && !list->showAll) {
> + if (!sym_is_changable(sym) && list->optMode != normalOpt) {
> setPixmap(promptColIdx, 0);
> setText(noColIdx, QString::null);
> setText(modColIdx, QString::null);
> @@ -320,7 +320,7 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
> symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
> choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
> menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void),
> - showAll(false), showName(false), showRange(false), showData(false),
> + showName(false), showRange(false), showData(false), optMode(normalOpt),
> rootEntry(0), headerPopup(0)
> {
> int i;
> @@ -337,10 +337,10 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
>
> if (name) {
> configSettings->beginGroup(name);
> - showAll = configSettings->readBoolEntry("/showAll", false);
> showName = configSettings->readBoolEntry("/showName", false);
> showRange = configSettings->readBoolEntry("/showRange", false);
> showData = configSettings->readBoolEntry("/showData", false);
> + optMode = (enum optionMode)configSettings->readNumEntry("/optionMode", false);
> configSettings->endGroup();
> connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
> }
> @@ -352,6 +352,17 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
> reinit();
> }
>
> +bool ConfigList::menuSkip(struct menu *menu)
> +{
> + if (optMode == normalOpt && menu_is_visible(menu))
> + return false;
> + if (optMode == promptOpt && menu_has_prompt(menu))
> + return false;
> + if (optMode == allOpt)
> + return false;
> + return true;
> +}
> +
> void ConfigList::reinit(void)
> {
> removeColumn(dataColIdx);
> @@ -380,7 +391,7 @@ void ConfigList::saveSettings(void)
> configSettings->writeEntry("/showName", showName);
> configSettings->writeEntry("/showRange", showRange);
> configSettings->writeEntry("/showData", showData);
> - configSettings->writeEntry("/showAll", showAll);
> + configSettings->writeEntry("/optionMode", (int)optMode);
> configSettings->endGroup();
> }
> }
> @@ -606,7 +617,7 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu)
> }
>
> visible = menu_is_visible(child);
> - if (showAll || visible) {
> + if (!menuSkip(child)) {
> if (!child->sym && !child->list && !child->prompt)
> continue;
> if (!item || item->menu != child)
> @@ -860,13 +871,16 @@ ConfigView::~ConfigView(void)
> }
> }
>
> -void ConfigView::setShowAll(bool b)
> +void ConfigView::setOptionMode(QAction *act)
> {
> - if (list->showAll != b) {
> - list->showAll = b;
> - list->updateListAll();
> - emit showAllChanged(b);
> - }
> + if (act == showNormalAction)
> + list->optMode = normalOpt;
> + else if (act == showAllAction)
> + list->optMode = allOpt;
> + else
> + list->optMode = promptOpt;
> +
> + list->updateListAll();
> }
>
> void ConfigView::setShowName(bool b)
> @@ -1321,11 +1335,22 @@ ConfigMainWindow::ConfigMainWindow(void)
> connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
> connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
> showDataAction->setOn(configList->showData);
> - QAction *showAllAction = new QAction(NULL, _("Show All Options"), 0, this);
> - showAllAction->setToggleAction(TRUE);
> - connect(showAllAction, SIGNAL(toggled(bool)), configView, SLOT(setShowAll(bool)));
> - connect(showAllAction, SIGNAL(toggled(bool)), menuView, SLOT(setShowAll(bool)));
> - showAllAction->setOn(configList->showAll);
> +
> + QActionGroup *optGroup = new QActionGroup(this);
> + optGroup->setExclusive(TRUE);
> + connect(optGroup, SIGNAL(selected(QAction *)), configView,
> + SLOT(setOptionMode(QAction *)));
> +
> + configView->showNormalAction = new QAction(NULL, _("Show Normal Options"), 0, optGroup);
> + configView->showAllAction = new QAction(NULL, _("Show All Options"), 0, optGroup);
> + configView->showPromptAction = new QAction(NULL, _("Show Prompt Options"), 0, optGroup);
> + configView->showNormalAction->setToggleAction(TRUE);
> + configView->showNormalAction->setOn(configList->optMode == normalOpt);
> + configView->showAllAction->setToggleAction(TRUE);
> + configView->showAllAction->setOn(configList->optMode == allOpt);
> + configView->showPromptAction->setToggleAction(TRUE);
> + configView->showPromptAction->setOn(configList->optMode == promptOpt);
> +
> QAction *showDebugAction = new QAction(NULL, _("Show Debug Info"), 0, this);
> showDebugAction->setToggleAction(TRUE);
> connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
> @@ -1368,7 +1393,8 @@ ConfigMainWindow::ConfigMainWindow(void)
> showRangeAction->addTo(optionMenu);
> showDataAction->addTo(optionMenu);
> optionMenu->insertSeparator();
> - showAllAction->addTo(optionMenu);
> + optGroup->addTo(optionMenu);
> + optionMenu->insertSeparator();
> showDebugAction->addTo(optionMenu);
>
> // create help menu
> @@ -1463,7 +1489,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
> ConfigList* list = NULL;
> ConfigItem* item;
>
> - if (!menu_is_visible(menu) && !configView->showAll())
> + if (configList->menuSkip(menu))
> return;
>
> switch (configList->mode) {
> diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
> index 54775ae..37bdaec 100644
> --- a/scripts/kconfig/qconf.h
> +++ b/scripts/kconfig/qconf.h
> @@ -44,6 +44,9 @@ enum colIdx {
> enum listMode {
> singleMode, menuMode, symbolMode, fullMode, listMode
> };
> +enum optionMode {
> + normalOpt = 0, allOpt, promptOpt
> +};
>
> class ConfigList : public QListView {
> Q_OBJECT
> @@ -115,6 +118,8 @@ public:
> void setAllOpen(bool open);
> void setParentMenu(void);
>
> + bool menuSkip(struct menu *);
> +
> template <class P>
> void updateMenuList(P*, struct menu*);
>
> @@ -124,8 +129,9 @@ public:
> QPixmap choiceYesPix, choiceNoPix;
> QPixmap menuPix, menuInvPix, menuBackPix, voidPix;
>
> - bool showAll, showName, showRange, showData;
> + bool showName, showRange, showData;
> enum listMode mode;
> + enum optionMode optMode;
> struct menu *rootEntry;
> QColorGroup disabledColorGroup;
> QColorGroup inactivedColorGroup;
> @@ -222,17 +228,15 @@ public:
> static void updateList(ConfigItem* item);
> static void updateListAll(void);
>
> - bool showAll(void) const { return list->showAll; }
> bool showName(void) const { return list->showName; }
> bool showRange(void) const { return list->showRange; }
> bool showData(void) const { return list->showData; }
> public slots:
> - void setShowAll(bool);
> void setShowName(bool);
> void setShowRange(bool);
> void setShowData(bool);
> + void setOptionMode(QAction *);
> signals:
> - void showAllChanged(bool);
> void showNameChanged(bool);
> void showRangeChanged(bool);
> void showDataChanged(bool);
> @@ -242,6 +246,10 @@ public:
>
> static ConfigView* viewList;
> ConfigView* nextView;
> +
> + QAction *showNormalAction;
> + QAction *showAllAction;
> + QAction *showPromptAction;
> };
>
> class ConfigInfoView : public QTextBrowser {
> --


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2010-04-30 17:52:18

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 6/6] xconfig: Add support to show hidden options which have prompts

On 04/28/10 22:58, Li Zefan wrote:
> Randy Dunlap wrote:
>> On Tue, 27 Apr 2010 15:49:30 +0800 Li Zefan wrote:
>>
>>> This feature has been supported in menuconfig and gconfig, so
>>> here add it to xconfig.
>>
>> Looks/sounds reasonable, but it does hide some symbols that were previously displayed
>> when in "Show all options" mode.
>>
>> E.g., CONFIG_64BIT is not displayed at all with this patch applied
>> (except by the Search function).
>> Also, X86_32 is not displayed at all (when this patch is applied)
>> and it cannot be found or displayed by the Search function.
>>

I'm using a kernel source tree with your 12 patches applied.
Should that be OK?

I don't see any of the hidden (no prompt string) symbols from
arch/x86/Kconfig displayed. Or maybe they have just moved, but I can't
locate them.

>
> I don't see this issue, though I found a bug in this patch...
> Could you send me your .config (in private) ?

Done, but the issue is not config-specific.

>> IOW, Show all options mode is busted. :(


--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***