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
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme
Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
* Move column width manipulation into the lib tree adapter
* Fix issue with GTK where if someone types too fast, the part
column gets 0 width.
Fixes: lp:1841584
* https://bugs.launchpad.net/kicad/+bug/1841584
There is a rendering bug in GTK3, which appears to be
an upstream GTK issue.
This can be worked around by, when filtering, ensuring the
*parent* item of the selected item is visible. This will
not cause the selected item to not be visible, as the selected
item will be the first shown child. So it will be visible, as long
as the list box is greater than a single row high, which it will be
in all practical scenarios.
This is done on all platforms, as it has a beneficial side-effect:
the parent library of the selection is naturally shown to the
user, so they don't need to scroll up to see what library their
current filter selection was in.
Fixes: lp:1804400
* https://bugs.launchpad.net/kicad/+bug/1804400
The indent size was estimated by the width of characters. But MSW
indent is substantially different from OSX and Linux. It also cuts off
the middle characters rather than the end leading to poor display if the
width does not fit. This uses the system setting for indent to account
for the indent spacing + 'M' to account for the arrow inset.
Fixes: lp:1815401
* https://bugs.launchpad.net/kicad/+bug/1815401
When filtering, we update the width of the displayed column to ensure
the full text is visible to the user. Check is rough, based on line
width (doesn't completely account for differing char widths) but is
sufficient for the approximate difference
Fixes: lp:1815401
* https://bugs.launchpad.net/kicad/+bug/1815401
Fixes: lp:1788495
* https://bugs.launchpad.net/kicad/+bug/1788495
When the user cancels the footprint load, we should assume they are
canceling the placement of a new footprint. This also adds sanity check
when populating the list
Fixes: lp:1814181
* https://bugs.launchpad.net/kicad/+bug/1814181
Be more intelligent about sorting lib tree items. (Footprint
entries, for instance, come out of an already-sorted list.)
Don't recreate menus twice when laoding Footprint Editor.
More pervasive use of WX_FILENAME to avoid expensive calls to
wxFileName::SplitPath() and string concatenation.
For POSIX kernels do all the work on the file-system side so we
don't have to keep converting back and forth between encodings.