Also changes the scoring algorithm to start at 0 and then increment
to 1 (the value that tells us to show, but not expand) only if the
search terms and lib filters are empty.
Also simplifies the scoring algorithm so that it only
differentiates between exact-match, match-at-start and
any-match. The rest of the position-based matching
stuff is gone, as is the knowledge of the name vs the
keywords vs the description. All that is left to the
provider of the weighted search terms array.
CHANGED: Symbol chooser search now considers custom symbol fields
Visible columns can be controlled in database libraries.
In standard KiCad libraries, we show columns for all custom fields for now.
Customizable column visibility will be added in the future.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11946
When using the "Filter" search for footprints/symbols, the least
surprising outcome is that the window filters the existing
(alphabetically sorted) list but does not change the display order based
on scoring.
This also needs to adjust the fix for
https://gitlab.com/kicad/code/kicad/-/issues/259 as that assumed the
selected element would be the first below the group (not the case if we
are sorting alphabetically)
Fixes https://gitlab.com/kicad/code/kicad/issues/11746
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
It's tempting to say that we don't need to exclude filename chars
from symbols, but we might regret that decision down the road. Better
to just escape them.
Fixes https://gitlab.com/kicad/code/kicad/issues/8694
This is under the supposition that we can't set the column widths
on some Mac instances because the host controls haven't yet been
created. This is primarily conjecture based on looking at things
that have the *possibility* of going wrong. Why this only happens
in some installs is beyond me.
Fixes https://gitlab.com/kicad/code/kicad/issues/5479
So many things can go wrong with this control in GTK. We have to
collapse the tree when updating the search string to avoid a crash when
referencing a child object but collapsing the tree will iterate over
elements and crash when we have deleted a symbol.
The temporary fix for this nonsense is to carefully order the calls.
We only need to collapse the search tree if we are not keeping our state
(in other words if we are fully re-building the tree)
Fixes https://gitlab.com/kicad/code/kicad/issues/6910
When preparing for clearing the tree, GTK requires walking through
parents. After calling "Freeze()" to protect against returning bad data
(see #6458 and #4471), we can no longer access Parent() from GTK and the
tree cannot be cleared.
The fix is to collapse the first element if it is open. This prevents
the common case of the history elements being expanded in the tree
Fixes https://gitlab.com/kicad/code/kicad/issues/6102
(cherry picked from commit 7eea344f91)
In some cases, the BeforeReset() will cause an iteration over the tree
elements. If we have deleted an element before doing this, we risk a
corruption/crash.
Fixes https://gitlab.com/kicad/code/kicad/issues/6192
Iteration on a suggestion from Mikołaj Wielgus to resolve
elusive crashing issue when searching in lib tree in GTK.
GTK issues two commands when clearing (BeforeReset() and AfterReset())
BeforeReset() needs to have a valid model and cannot have selection
events during its lifetime. On MacOS and MSW, this is a NOP.
AfterReset() performs the re-association for GTK, removing the need for
the extra associate step. For MacOS and MSW, this is only the Cleared()
action.
Fixes https://gitlab.com/kicad/code/kicad/issues/5732
Fixes https://gitlab.com/kicad/code/kicad/issues/5891
This freeze/thaw is different than the update locker freeze/thaw,
and is needed to prevent crashes due to accessing invalid (already
freed) data on GTK.
Fixes https://gitlab.com/kicad/code/kicad/issues/5289
The tree model adapter appears to have update issues when modifying the
scores while it _might_ get updated. This moves the lock higher and
removes the extraneous Freeze/Thaw call.
Unfortunately, this only exposes an additional issue in the tool handler
but this will hopefully be easier to debug.
Fixes https://gitlab.com/kicad/code/kicad/issues/5206
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.
There is still some debugging output in test code that really needs to
be moved into a unit test.
Add debugging output section to the coding policy regarding debugging
output.
GTK only calculates new widths once the tree is displayed,
so calling Refresh after updating the tree but before display
will return a column width of 0. Instead, use saved column
widths if an invalid width was returned.
Fixes https://gitlab.com/kicad/code/kicad/issues/4837
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.
ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070