Debugger and duchain hints overlaps

David Nolden zwabel at googlemail.com
Sat Dec 4 19:57:20 UTC 2010


2010/12/4 Vladimir Prus <ghost at cs.msu.su>:
> Per documentation:
>
>          ///@param priority The priority of this tooltip. Lower is better.     Multiple tooltips will be stacked down in the given order.
>         ///                If it is zero, the given tooltip will be shown exclusively.
>
> So, I sure can add call to showToolTip and pass 0 as priority. In fact, it works, kinda.
>
> The good thing is that when I'm debugging, and in debug perspective, I see
> just one tooltip. Yeah!

Nice, I already forgot that this I implemented this. :-)

> The bad thing is that when I'm debugging, and switch to code perspective, I also
> get debug tooltip, and only it. Ehm. If I switched to code perspective while not
> stopping the debugger, I probably wanted to browse some code.
>
> What this suggests, is that each Area should specify the list of tooltips that
> it would like to see, or not see. It probably means that each tooltip should be
> given an id (at present, the uniqueId parameter to showToolTip is not used
> anywhere in the codebase).
It is used, exactly according to the documentation.

> And each area, just like it specifies tool view
> preferences, should specify tooltip preferences. And, for extra bonus, Area
> can specify tooltips in priority order -- which would clear my concerns about
> current priority mechanism which is picked by each plugin at random.
>
> How does that sound?

That sounds complicated. You thereby shift the theoretical problem to
another place, because now the areas need to know all plugins that can
show tooltips. Anyway I think the "multiple tooltips at the same time"
case is a corner-case, and we don't need to make it that complicated.

You could simply do something like:
showToolTip(activeToolTip_,
ICore::self()->uiController()->activeMainWindow()->activeArea()->name()
== "debug" ? 0 : 10)

We could write some reference priority values into showToolTip, so
other values can be picked on that basis.

If you want to implement that "tooltip preference" thing, feel free to
do it, but keep in mind that there may be additional plugins showing
tooltips that you don't know about, those tooltips must have fair
chances too.

Greetings, David




More information about the KDevelop-devel mailing list