public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/8] kconfig: print symbol type in help text
@ 2010-05-07  5:56 Li Zefan
  2010-05-07  5:56 ` [PATCH v2 2/8] kconfig: print the range of integer/hex symbol " Li Zefan
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

Randy suggested to print out the symbol type in gconfig.

Note this change does more than Randy's suggestion, that it also
affects menuconfig and "make config".

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

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/8] kconfig: print the range of integer/hex symbol in help text
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
@ 2010-05-07  5:56 ` Li Zefan
  2010-05-07  5:57 ` [PATCH v2 3/8] kconfig: fix to tag NEW symbols correctly Li Zefan
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

Without this patch, one has to refer to the Kconfig file to find
out the range of an integer/hex symbol.

  │ Symbol: NR_CPUS [=4]
  │ Type  : integer
  │ Range : [2 8]
  │ Prompt: Maximum number of CPUs
  │   Defined at arch/x86/Kconfig:761
  │   Depends on: SMP [=y] && !MAXSMP [=n]
  │   Location:
  │     -> Processor type and features

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 scripts/kconfig/expr.c |    2 +-
 scripts/kconfig/menu.c |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index edd3f39..e5e13f5 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -1098,7 +1098,7 @@ void expr_fprint(struct expr *e, FILE *out)
 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str)
 {
 	str_append((struct gstr*)data, str);
-	if (sym)
+	if (sym && sym->type != S_UNKNOWN)
 		str_printf((struct gstr*)data, " [=%s]", sym_get_string_value(sym));
 }
 
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b5d15fa..c547692 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -505,6 +505,14 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
 		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));
+		if (sym->type == S_INT || sym->type == S_HEX) {
+			prop = sym_get_range_prop(sym);
+			if (prop) {
+				str_printf(r, "Range : ");
+				expr_gstr_print(prop->expr, r);
+				str_append(r, "\n");
+			}
+		}
 	}
 	for_all_prompts(sym, prop)
 		get_prompt_str(r, prop);
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 3/8] kconfig: fix to tag NEW symbols correctly
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
  2010-05-07  5:56 ` [PATCH v2 2/8] kconfig: print the range of integer/hex symbol " Li Zefan
@ 2010-05-07  5:57 ` Li Zefan
  2010-05-07  5:57 ` [PATCH v2 4/8] menuconfig: improive help text a bit Li Zefan
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:57 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

Those configs are not new:

  $ cat .config
  ...
  CONFIG_NAMESPACES=y
  ...
  CONFIG_BLOCK=y
  ...

But are tagged as NEW:

  $ yes "" | make config > myconf
  $ cat myconf | grep '(NEW)'
  Namespaces support (NAMESPACES) [Y/?] (NEW) y
  ...
  Enable the block layer (BLOCK) [Y/?] (NEW) y
  ...

You can also notice this bug when using gconfig/xconfig.

It's because the SYMBOL_DEF_USER bit of an invisible symbol is cleared
when the config file is read:

int conf_read(const char *name)
{
	...
	for_all_symbols(i, sym) {
		if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
			/* Reset values of generates values, so they'll appear
			 * as new, if they should become visible, but that
			 * doesn't quite work if the Kconfig and the saved
			 * configuration disagree.
			 */
			if (sym->visible == no && !conf_unsaved)
				sym->flags &= ~SYMBOL_DEF_USER;
	...
}

But a menu item which represents an invisible symbol is still
visible, if it's sub-menu is visible, so its SYMBOL_DEF_USER
bit should be set to indicate it's not NEW.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 scripts/kconfig/menu.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index c547692..85ccd02 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -419,9 +419,13 @@ bool menu_is_visible(struct menu *menu)
 	if (!sym || sym_get_tristate_value(menu->sym) == no)
 		return false;
 
-	for (child = menu->list; child; child = child->next)
-		if (menu_is_visible(child))
+	for (child = menu->list; child; child = child->next) {
+		if (menu_is_visible(child)) {
+			if (sym)
+				sym->flags |= SYMBOL_DEF_USER;
 			return true;
+		}
+	}
 
 	return false;
 }
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 4/8] menuconfig: improive help text a bit
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
  2010-05-07  5:56 ` [PATCH v2 2/8] kconfig: print the range of integer/hex symbol " Li Zefan
  2010-05-07  5:57 ` [PATCH v2 3/8] kconfig: fix to tag NEW symbols correctly Li Zefan
@ 2010-05-07  5:57 ` Li Zefan
  2010-05-07  5:57 ` [PATCH v2 5/8] gconfig: fix to tag NEW symbols correctly Li Zefan
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:57 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

Suggested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 5/8] gconfig: fix to tag NEW symbols correctly
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
                   ` (2 preceding siblings ...)
  2010-05-07  5:57 ` [PATCH v2 4/8] menuconfig: improive help text a bit Li Zefan
@ 2010-05-07  5:57 ` Li Zefan
  2010-05-07  5:57 ` [PATCH v2 6/8] gconfig: fix null pointer warning Li Zefan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:57 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

The logic should be reversed.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 6/8] gconfig: fix null pointer warning
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
                   ` (3 preceding siblings ...)
  2010-05-07  5:57 ` [PATCH v2 5/8] gconfig: fix to tag NEW symbols correctly Li Zefan
@ 2010-05-07  5:57 ` Li Zefan
  2010-05-07  5:58 ` [PATCH v2 7/8] xconfig: clean up Li Zefan
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:57 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

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 <lizf@cn.fujitsu.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 7/8] xconfig: clean up
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
                   ` (4 preceding siblings ...)
  2010-05-07  5:57 ` [PATCH v2 6/8] gconfig: fix null pointer warning Li Zefan
@ 2010-05-07  5:58 ` Li Zefan
  2010-05-07  5:58 ` [PATCH v2 8/8] xconfig: remove unused function Li Zefan
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:58 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

@ok is a pointer to a bool var, so we should check the value of
*ok. But actually we don't need to check it, so just remove the
if statement.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 scripts/kconfig/qconf.cc |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 00c5150..47cdeae 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -58,11 +58,10 @@ QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
 {
 	QValueList<int> result;
 	QStringList entryList = readListEntry(key, ok);
-	if (ok) {
-		QStringList::Iterator it;
-		for (it = entryList.begin(); it != entryList.end(); ++it)
-			result.push_back((*it).toInt());
-	}
+	QStringList::Iterator it;
+
+	for (it = entryList.begin(); it != entryList.end(); ++it)
+		result.push_back((*it).toInt());
 
 	return result;
 }
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 8/8] xconfig: remove unused function
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
                   ` (5 preceding siblings ...)
  2010-05-07  5:58 ` [PATCH v2 7/8] xconfig: clean up Li Zefan
@ 2010-05-07  5:58 ` Li Zefan
  2010-05-10  8:33 ` [PATCH v2 9/8] xconfig: add support to show hidden options which have prompts Li Zefan
  2010-05-14  6:57 ` [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-07  5:58 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

Remove ConfigInfoView::setSource().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 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 47cdeae..5e01af2 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -963,34 +963,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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 9/8] xconfig: add support to show hidden options which have prompts
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
                   ` (6 preceding siblings ...)
  2010-05-07  5:58 ` [PATCH v2 8/8] xconfig: remove unused function Li Zefan
@ 2010-05-10  8:33 ` Li Zefan
  2010-05-14  6:57 ` [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
  8 siblings, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-10  8:33 UTC (permalink / raw)
  To: Michal Marek, Randy Dunlap; +Cc: Andrew Morton, linux-kbuild, LKML

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

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---

(This patch is based on the previous patchset I sent several days ago.)

Randy, I've fixed the bug you reported. The bug was seen only
in split view.

---
 scripts/kconfig/qconf.cc |   69 +++++++++++++++++++++++++++++++++------------
 scripts/kconfig/qconf.h  |   16 ++++++++--
 2 files changed, 62 insertions(+), 23 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 47cdeae..d0b1958 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -148,7 +148,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);
@@ -319,7 +319,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;
@@ -336,10 +336,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()));
 	}
@@ -351,6 +351,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);
@@ -379,7 +390,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();
 	}
 }
@@ -605,7 +616,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)
@@ -834,7 +845,10 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
 		e->ignore();
 }
 
-ConfigView* ConfigView::viewList;
+ConfigView*ConfigView::viewList;
+QAction *ConfigView::showNormalAction;
+QAction *ConfigView::showAllAction;
+QAction *ConfigView::showPromptAction;
 
 ConfigView::ConfigView(QWidget* parent, const char *name)
 	: Parent(parent, name)
@@ -859,13 +873,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)
@@ -1348,11 +1365,24 @@ 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 *)));
+	connect(optGroup, SIGNAL(selected(QAction *)), menuView,
+		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)));
@@ -1395,7 +1425,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
@@ -1490,7 +1521,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 b3b5657..a7f2686 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;
+
+	static QAction *showNormalAction;
+	static QAction *showAllAction;
+	static QAction *showPromptAction;
 };
 
 class ConfigInfoView : public QTextBrowser {
-- 
1.6.3



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/8] kconfig: print symbol type in help text
  2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
                   ` (7 preceding siblings ...)
  2010-05-10  8:33 ` [PATCH v2 9/8] xconfig: add support to show hidden options which have prompts Li Zefan
@ 2010-05-14  6:57 ` Li Zefan
  2010-05-14 20:43   ` Michal Marek
  8 siblings, 1 reply; 13+ messages in thread
From: Li Zefan @ 2010-05-14  6:57 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

Hi Michal, what do you think about those patches? Seems
Randy has had no further comments on them.

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 menuconfig and "make config".
> 
>   │ Symbol: BLOCK [=y]
>   │ Type  : boolean
>   │ Prompt: Enable the block layer
>   │   Defined at block/Kconfig:4
>   │   Depends on: EMBEDDED [=n]
> 
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/8] kconfig: print symbol type in help text
  2010-05-14  6:57 ` [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
@ 2010-05-14 20:43   ` Michal Marek
  2010-05-17  2:18     ` Li Zefan
  2010-06-02 13:41     ` Michal Marek
  0 siblings, 2 replies; 13+ messages in thread
From: Michal Marek @ 2010-05-14 20:43 UTC (permalink / raw)
  To: Li Zefan; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

On 14.5.2010 08:57, Li Zefan wrote:
> Hi Michal, what do you think about those patches? Seems
> Randy has had no further comments on them.

Sorry, I've been quite busy this week due to a new arrival in our
family. The patches are ok, thank you for your work and Randy for his
review! I'll apply them.

Michal

> 
> 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 menuconfig and "make config".
>>
>>   │ Symbol: BLOCK [=y]
>>   │ Type  : boolean
>>   │ Prompt: Enable the block layer
>>   │   Defined at block/Kconfig:4
>>   │   Depends on: EMBEDDED [=n]
>>
>> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
>> Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/8] kconfig: print symbol type in help text
  2010-05-14 20:43   ` Michal Marek
@ 2010-05-17  2:18     ` Li Zefan
  2010-06-02 13:41     ` Michal Marek
  1 sibling, 0 replies; 13+ messages in thread
From: Li Zefan @ 2010-05-17  2:18 UTC (permalink / raw)
  To: Michal Marek; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

>> Hi Michal, what do you think about those patches? Seems
>> Randy has had no further comments on them.
>
> Sorry, I've been quite busy this week due to a new arrival in our

Congratulation!

> family. The patches are ok, thank you for your work and Randy for his
> review! I'll apply them.

Thanks! And take your time. :)


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/8] kconfig: print symbol type in help text
  2010-05-14 20:43   ` Michal Marek
  2010-05-17  2:18     ` Li Zefan
@ 2010-06-02 13:41     ` Michal Marek
  1 sibling, 0 replies; 13+ messages in thread
From: Michal Marek @ 2010-06-02 13:41 UTC (permalink / raw)
  To: Li Zefan; +Cc: Randy Dunlap, Andrew Morton, linux-kbuild, LKML

On 14.5.2010 22:43, Michal Marek wrote:
> On 14.5.2010 08:57, Li Zefan wrote:
>> Hi Michal, what do you think about those patches? Seems
>> Randy has had no further comments on them.
> 
> Sorry, I've been quite busy this week due to a new arrival in our
> family. The patches are ok, thank you for your work and Randy for his
> review! I'll apply them.

Applied now.

Michal

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-06-02 13:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07  5:56 [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
2010-05-07  5:56 ` [PATCH v2 2/8] kconfig: print the range of integer/hex symbol " Li Zefan
2010-05-07  5:57 ` [PATCH v2 3/8] kconfig: fix to tag NEW symbols correctly Li Zefan
2010-05-07  5:57 ` [PATCH v2 4/8] menuconfig: improive help text a bit Li Zefan
2010-05-07  5:57 ` [PATCH v2 5/8] gconfig: fix to tag NEW symbols correctly Li Zefan
2010-05-07  5:57 ` [PATCH v2 6/8] gconfig: fix null pointer warning Li Zefan
2010-05-07  5:58 ` [PATCH v2 7/8] xconfig: clean up Li Zefan
2010-05-07  5:58 ` [PATCH v2 8/8] xconfig: remove unused function Li Zefan
2010-05-10  8:33 ` [PATCH v2 9/8] xconfig: add support to show hidden options which have prompts Li Zefan
2010-05-14  6:57 ` [PATCH v2 1/8] kconfig: print symbol type in help text Li Zefan
2010-05-14 20:43   ` Michal Marek
2010-05-17  2:18     ` Li Zefan
2010-06-02 13:41     ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox