2007-08-18 14:06:20

by Marco Costalba

[permalink] [raw]
Subject: [PATCH] qconf: show red links for disabled options

When 'Show debug info' is checked then a list of links
to dependant symbols is shown in info view right bottom pane.

Currently all links are in standard blue. With this patch
links to disabled symbols are shown in red instead.

This, together with 'Show all options', allows to quickly
check out why a given option is hidden.

Signed-off-by: Marco Costalba <[email protected]>
---

I understand that color coding could be a poor choice due to people
with color differencing problems.

I chose this anyway to avoid crufting the output with additional signs/symbols,
this could became very ugly in case of long option lists.


scripts/kconfig/qconf.cc | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index e4eeb59..e4927c1 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1157,9 +1157,14 @@ void ConfigInfoView::expr_print_help(void
*data, struct symbol *sym, const char
QString str2 = print_filter(str);

if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) {
+ bool disabled = (print_filter(sym_get_string_value(sym)) != "y");
+ if (disabled)
+ *text += "<font color=\"red\">";
*text += QString().sprintf("<a href=\"s%p\">", sym);
*text += str2;
*text += "</a>";
+ if (disabled)
+ *text += "</font>";
} else
*text += str2;
}
--
1.5.3.rc4.67.gf9286


2007-08-21 15:11:49

by Roman Zippel

[permalink] [raw]
Subject: Re: [PATCH] qconf: show red links for disabled options

Hi,

On Sat, 18 Aug 2007, Marco Costalba wrote:

> When 'Show debug info' is checked then a list of links
> to dependant symbols is shown in info view right bottom pane.
>
> Currently all links are in standard blue. With this patch
> links to disabled symbols are shown in red instead.

The way you currently define "disabled" means that even symbols set to 'm'
are disabled, I don't think that's what you really mean. :) When seeing
disabled I also first thought of the option being completely invisible due
to dependencies.

> This, together with 'Show all options', allows to quickly
> check out why a given option is hidden.

Dependencies can also be something like !FOO, in this case you want FOO to
be disabled for option to be unhidden. So if this is intended as a simple
"Click this link to enable this option", then this requires a bit more
work. :)

> I understand that color coding could be a poor choice due to people
> with color differencing problems.
>
> I chose this anyway to avoid crufting the output with additional signs/symbols,
> this could became very ugly in case of long option lists.

Using colors is not the problem, I'm more concerned about using red, as
it's a signal color, often meaning that something is wrong or needs urgent
attention.

bye, Roman

2007-08-22 06:37:17

by Marco Costalba

[permalink] [raw]
Subject: Re: [PATCH] qconf: show red links for disabled options

On 8/21/07, Roman Zippel <[email protected]> wrote:
>
> The way you currently define "disabled" means that even symbols set to 'm'
> are disabled, I don't think that's what you really mean. :) When seeing
> disabled I also first thought of the option being completely invisible due
> to dependencies.
>

Thanks for your feedback Roman.

What about something like this?

if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) {
+ bool isNotSelected = (print_filter(sym_get_string_value(sym)) == "n");
+ if (isNotSelected) {
+ const QColor c(palette().disabled().text());
+ *text += "<font color=\"" + c.name() + "\">";
+ }
*text += QString().sprintf("<a href=\"s%p\">", sym);
*text += str2;
*text += "</a>";
+ if (isNotSelected)
+ *text += "</font>";


It it's ok for you I can resend a proper patch along the above lines.

> > This, together with 'Show all options', allows to quickly
> > check out why a given option is hidden.
>
> Dependencies can also be something like !FOO, in this case you want FOO to
> be disabled for option to be unhidden. So if this is intended as a simple
> "Click this link to enable this option", then this requires a bit more
> work. :)
>

No it is not intended like a 'click me to enable this option', just as
a monitor of current option value.

BTW we can have a disabled symbol in the dependency list of a
currently enabled option if this is preceded by a '!'. So that in this
case you probably would not want to click anywhere.

Thanks
Marco