at() can throw when it doesn't find the proper reference. This catches
the errors and attempts to properly handle them assuming the user
initiated the removal. Warns the developer (wxLogDebug) when this is
not the case
Fixes https://gitlab.com/kicad/code/kicad/issues/12241
wxWidgets 3.1 has deprecated wxPATH_NORM_ALL when normalizing file
paths when calling wxFileName::Normalize(). This change keeps the
existing behavior except in places where our own internal
ExpandEnvVarSubstitutions() to expand environment variables.
This allows them to work in places like search boxes in standard file
dialogs. If wxWidgets doesn't find the standard IDs in our menus
then it won't enable them.
Also find a few more places where we are reaching into a new frame to
perform actions that need to have dialogs closed.
Running actions should also wait for the next cycle rather than being
immediately executed when we are calling into a new frame. This allow
for the cleanup actions onClose() to happen prior to the next action
starting
Fixes https://gitlab.com/kicad/code/kicad/issues/11891
Adds package update available state, package update operation and all
the corresponding logic around it to make updating package to another
version easy.
Thread pools are long-lasting executors that have close to zero overhead
when launching new jobs. This is advantageous over creating new threads
as we can use this for threading smalling jobs and smaller quanta. It
also avoids the heuristics needed to determine the optimal number of
threads to spawn
The json schema for packages implies that kicad min/max version
restriction takes major.minor.patch string but actual logic
only checks major and minor.
This fixes the logic to work with full major.minor.patch tuple.
Additionally the version max logic will substitute missing portions
with 999 for a reasonable default so that say 7.1 is still considered
as >= 7.1.5 when checking for max version.
Reported here
https://forum.kicad.info/t/updating-already-installed-plugins-using-content-manager/35532/5?u=qu1ck
When there are no pending actions, we should not show the user the
ability to apply/discard the pending actions. This uses wxUpdateUI in
the correct manner, limiting it to only the elements being updated and
using the event actions to ensure we don't have a cascade
Fixes https://gitlab.com/kicad/code/kicad/issues/10761
(cherry picked from commit 09a2d50e09)
Our menu bar code is interestingly complex. But we were throwing away newly made menu items to the void in the cases of constructed on the fly submenus
ADDED: with cmake KICAD_MACOSX_APP_BUNDLE option the user can disable
the macOS app bundle creation when compiling on macOS. This permit to
use/install KiCad like any other *nix platform (/usr/bin, /usr/share,
ecc.). By default, cmake build the app bundle.
wxSafeYield() is not "safe". Pending actions may include deletion of
the currently active class. This will cause crashes when exiting. If
needed for specific behaviors, we should use wxSafeYieldFor( flag ) with
the appropriate events specified rather than a general yield which can
cause more problems
(cherry picked from commit 9864337914)
The single string ctor of wxFileName treats the string as a path and file
name. If there is a dot in the last path name, it assumes that the last
path is actually a file name and extension.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10116
The flag is to protect against the frame going out of scope with the
references intact. This shouldn't be in CloseProject because we close
the project without removing the frame. Instead, placing it in OnExit
gets set correctly when closing the whole project manager
Fixes https://gitlab.com/kicad/code/kicad/issues/10018
An old size for the window could cut off the PCM button if it were
migrated, so to ensure the button is visible, just always use a fresh
window size on migration.
Fixes https://gitlab.com/kicad/code/kicad/issues/9649
- do not use KICAD_MANAGER_CONTROL::Execute() to run PCM: it is not an external app.
- add a workaround to avoid keeping incorrect focus on buttons in PANEL_KICAD_LAUNCHER.
Fixes#9780https://gitlab.com/kicad/code/kicad/issues/9780
This prevents any potential breakage of a project due to the file changes.
It is overly zealous because the project manager doesn't actually have any
knowledge of which files belong to the project.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9654
Processing a menu event for quitting results in the frame being
destroyed. This crashes the program when it tries to access the newly
freed frame to check for autosave data. We bind the closing flag into
the base program which will be the last item freed on exit to ensure we
can correctly check for data loss
Fixes https://gitlab.com/kicad/code/kicad/issues/8638
1. Allow dots in package id for namespacing requirements
2. Add regex anchoring to force matching whole string
3. sha hex digest can only have [a-f0-9] chars
For some reason, escaped double quotes in wxString::Format cause issues
on Mac. We can replace them with single quotes in most places without
loss of clarity
In particular, don't use a fixed height for the templates chooser,
and Wrap() must be called again whenever the text is changed.
Also moves the buttons to icon buttons.
Fixes https://gitlab.com/kicad/code/kicad/issues/9241
This also moves closing the existing project earlier to improve the
workflow -- so there's a chance that the main fix might not be needed
anymore, but it's still safer to not have a control-flow that crashes
rather than to just not use that control-flow.
Fixes https://gitlab.com/kicad/code/kicad/issues/9200
Also removes the return value from the BITMAP_STORE's themeChanged
method as it will provide the wrong answer for the second frame it's
called on.
Also hooked up ACTION_TOOLBAR, the app launcher, and the project tree
to the wx event for system color changes so they change on the fly.
Fixes https://gitlab.com/kicad/code/kicad/issues/6026
Mac already uses diverse font sizes (for instance, smaller fonts for
radio button groups), and the anti-aliasing is a lot better. The
other platforms need a more limited range of sizes.
Fixes https://gitlab.com/kicad/code/kicad/issues/8608
It appears that both strategies in the last commit worked, leaving us
with squared scaling. The dialog pixel architecture seems safer than
our icon scaling stuff, so this version attempts to use only it.
Also works around a bug where wxELLIPSIZE_MIDDLE doesn't work on Mac.
Fixes https://gitlab.com/kicad/code/kicad/issues/8608
Fixes https://gitlab.com/kicad/code/kicad/issues/8375
used **only** in PCM (in Kicad manager), it is not found in some cases at run time.
So just use it in the main module to avoid a not found issue for the
wxbase315u_xml_gcc_custom shared object when launching Kicad
(the cost is very low)
curl.h has constraints on Windows (because it includes winsocks2.h) and must be
included before any wxxxx.h.
Because only very few files need curl.h, kicad_curl.h is included only in these files
Creates a script that will fomat the MacOS icons at 80% of the total
size in line with Apple's guidelines.
Script requires Inkscape 1.0 and png2icns (available on Linux boxen)
Fixes https://gitlab.com/kicad/code/kicad/issues/7977
Also fixes a bug where an empty window would get left when loading
a file from the KiCad manager window errored out.
Also fixes a bug where we were getting the wrong exception because
we were rethrowing the type-casted one (rather than just calling
throw).
Fixes https://gitlab.com/kicad/code/kicad/issues/8604
The goal of this work is to let developers run Python things
on macOS on their builds without generating a full
relocatable and redistributable build.
This is a WIP.
The project footprint folder gets renamed to the new project name. We
need to handle non-footprint files that may be stored there by updating
this path manually when copying extra files.
Fixes https://gitlab.com/kicad/code/kicad/issues/8503
While I haven't been able to reproduce the crash, my theory is that
those that do are running into situations where wxWidgets defers
destructing the window.
Fixes https://gitlab.com/kicad/code/kicad/issues/8458
The current sizing behavior leaves a lot of padding to the right side
of the window so don't set the minimum window size to the best size
calculated by the sizers. This will allow the user to resize as desired.
* Remove unused wxLogDebug calls.
* Add add application level character tracing to detect unhandled key
events.
* Catch unhandled exceptions in KiCad main event loop like single top
applications.
wx/wx.h includes all wxWidgets .h files, and sometimes creates collision
names in #define between kicad and windows headers
Moreover, blindly including a lot of useless files is compil time consuming
This is a work-in-progress. It could use testing while I continue to fix
the remaining pieces.
There are some changes that will be needed for signing and notarization.
This currently relies on a Python tool I wrote (dyldstyle) to fixup
KiCad.app correctly. I would like any bundle fixing necessary to use a
built KiCad on macOS to live inside KiCad, rather than in
kicad-mac-builder or elsewhere. While I was experimenting, I found this
worked, however, and I would love to get extra hands testing.
I added a CMake argument, MACOS_EXTRA_BUNDLE_FIX_DIRS, for devs and
packagers who have extra directories they need to add to
fixup_bundle on KiCad.app.
There's an issue about differing behavior when KiCad is opened via
the command line or via Finder/launchd.
After commit 9535153f9e there were no more IDs inside the legacy ID
system. Therefore the entire system for dispatching and looking up
the legacy ideas and handling those events can now be removed and
the tool dispatcher simplified (it no longer needs to know about
the ACTIONS class).
Saying "Import/Export" on the labels when the submenu has "Import"
or "Export" in it is redundant.
Note that we can't just update the action text with the new name,
because that is used in the hotkey list and would become too confusing
without the "Import"/"Export" text.
The first phase is for the environment before the OS
apps are created, and the second phase is for after
the OS app is created but before all of our processing.
Fixes https://gitlab.com/kicad/code/kicad/issues/7992
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.
Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz
The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.
Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.
Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.