Commit Graph

275 Commits

Author SHA1 Message Date
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
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.
2021-03-11 08:37:35 -05:00
Jeff Young 57e948ff08 Make sure axesEnabled is set before saving config.
We don't actually allow the user to change this at present, so one
could argue that we should remove it from what is saved out of the
config.  But this is a smaller, safer change.

Fixes https://gitlab.com/kicad/code/kicad/issues/7666
2021-03-01 20:37:04 +00:00
Jeff Young 86aaa2e9cb Rationalize footprint bounding boxes and cache all of them.
Fixes https://gitlab.com/kicad/code/kicad/issues/7720
2021-02-26 13:50:27 +00:00
Jeff Young 2d28ed8eda Move canvas backend selection to Preferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/7630
2021-02-21 20:12:43 +00:00
Jeff Young 91e876ce0d Make sure the title is updated when file is saved/reverted/etc.
Fixes https://gitlab.com/kicad/code/kicad/issues/7626
2021-02-20 15:09:47 +00:00
Jeff Young 881cb3182b Move writable dir checking lower down.
(Well, it was already lower down, this really just removes the higher
up calls that were getting in the way.)

Fixes https://gitlab.com/kicad/code/kicad/issues/5937
2021-02-19 22:24:08 +00:00
Jeff Young 5994ce3711 Be more aggressive about updating title to show dirty status.
Fixes https://gitlab.com/kicad/code/kicad/issues/7613
2021-02-19 21:58:49 +00:00
Jeff Young 66b33834b5 Always enable save; move dirty bit to asterisk in title bar.
Also unifies PCB Editor and Schematic Editor names with other
locations in the GUI (which were still Pcbnew and Eeschema).

Fixes https://gitlab.com/kicad/code/kicad/issues/7587

Fixes https://gitlab.com/kicad/code/kicad/issues/7594
2021-02-18 16:05:42 +00:00
Jeff Young b2a4cbedda Add conditions for rotate/group/lock items in toolbar.
Also fixes cut/copy/delete conditions to allow use in immediate mode.
2021-02-18 00:10:41 +00:00
Jeff Young 05ff0fb658 Add flip board view to footprint editor menu.
Fixes https://gitlab.com/kicad/code/kicad/issues/7484
2021-02-10 21:55:14 +00:00
Seth Hillbrand 505844f68c Generalize the Ctrl-Q to all frames
Rather than adding our handler to each frame separately, we initialize
the Ctrl-Q quit action at the base frame to be consistent
2021-02-09 11:43:42 -08:00
Jeff Young c2dbd28101 Simplify and harmonize symbol editor and footprint editor menus.
Some differences are due to difference between libraries being files
in symbol editor and directories in footprint editor, but this unifies
most of the rest.

It also dispenses with the save-to-library vs save-to-document distinction
in the GUI because it makes for too much variability in the GUI, was
implemented differently between the two editors, and isn't needed as much
anymore now that we have the highly visible infobar.

There was also an issue that the save-to-board icon occupies the same
location and has the same size/shape/colours as the Board Setup icon in
PCBNew.

Fixes https://gitlab.com/kicad/code/kicad/issues/7215
2021-02-06 14:33:16 +00:00
Jeff Young a868fb97b6 Preserve Uuids when editing board footprints.
One way to do this would have been to keep the Uuids in the editor
copy.  However, this opens us up to errors if we forget a Save As or
export path and end up writing the Uuids out somewhere else.

In the end, it felt safer to store a map of the original Uuids and
restore them if we happen to save the editor footprint back to the
board.

Fixes https://gitlab.com/kicad/code/kicad/issues/7312
2021-01-31 14:09:59 +00:00
Michael Kavanagh ef2aa8a730 FP Editor: remember to update appearance manager
Fixes https://gitlab.com/kicad/code/kicad/issues/6926
2021-01-19 20:24:16 +00:00
Jeff Young 68efdb2fff Push shared parts of GRID_HELPERs into common. 2021-01-16 23:18:10 +00:00
Jeff Young 3467e643e5 Move pad locking from footprint to pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/6997
2021-01-08 20:43:02 +00:00
Jeff Young 7a081b7c04 Naming consistency. 2020-12-25 16:59:41 +00:00
Jeff Young 6b420b191a Use color theme backgrounds in page previews.
Also includes a *lot* of const fixing to make it happen.

Fixes https://gitlab.com/kicad/code/kicad/issues/6811
2020-12-23 23:18:38 +00:00
Seth Hillbrand 61ac9c8d90 Add multiple size icons for programs
In theory, the WM should now choose the closest size icon for its
purpose, making it easier to distinguish in space-constrained settings

Fixes https://gitlab.com/kicad/code/kicad/issues/6798
2020-12-22 15:37:26 -08:00
Jeff Young 47ea51ec34 Allow both aui-manager-based infobars and window overlay infobars. 2020-12-22 21:36:39 +00:00
Marek Roszko fc272f407a Write the fp-info-cache if we close the footprint editor 2020-12-18 22:56:01 -05:00
qu1ck 4788f3ae6b Read fp-info-cache on first start of fp editor
if fp info list is not initialized
2020-12-18 18:56:36 -08:00
Jeff Young 06d4476d7a Fix graphics snapping in Footprint Editor.
Also improves the help text for the various selection modifier
options.

Fixes https://gitlab.com/kicad/code/kicad/issues/6538

Fixes https://gitlab.com/kicad/code/kicad/issues/4745
2020-12-19 00:21:28 +00:00
Jon Evans 3d68aa4b86 Make sure footprint editor uses the right config object
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6115
2020-12-16 22:07:35 -05:00
Jeff Young acfbcb4beb Make distinction between PCBNew-wide tools and Board-specific tools.
The old names were really hard to keep straight (even for me, who named
many of them).
2020-12-16 13:32:46 +00:00
Jeff Young 73b7b104cd Fix some issues with Infobar sizing.
This also commits to the new strategy as it wasn't really compatible
with if-def-ing anymore.
2020-12-11 12:39:40 +00:00
Jeff Young 602476cdf2 Update SELECTION_TOOL when loading footprint editor settings.
Fixes https://gitlab.com/kicad/code/kicad/issues/6641
2020-12-06 12:13:16 +00:00
Jeff Young 0c2cd1abb2 File left out of last commit.
Fixes https://gitlab.com/kicad/code/kicad/issues/6478
2020-11-29 21:21:20 +00:00
Jeff Young a207bd97bb Naming conventions. 2020-11-17 16:05:49 +00:00
Jeff Young dff5173baf Exorcise some instances of "modedit". 2020-11-17 16:05:48 +00:00
Marek Roszko b996c0d2f5 Fix typo in last commit 2020-11-13 22:16:23 -05:00
Marek Roszko 7fc19b7592 Turn off live resize in pcbnew on Windows
The performance of live resizing isn't great. Windows can send mouse moves at 1000 Hz which is faster than the complex appearance panel + canvas can paint properly.
2020-11-13 22:15:32 -05:00
Jeff Young bdbb68f813 MODULE -> FOOTPRINT. 2020-11-13 16:04:03 +00:00
Jeff Young 52a46341db More module -> footprint. 2020-11-13 15:16:24 +00:00
Jeff Young 84dd5108ba Remove some "class_" prefixes from files. 2020-11-13 15:16:23 +00:00
Jeff Young 812b714ccd More Module -> Footprint and a bit of formatting cleanup. 2020-11-10 20:53:12 +00:00
Jeff Young 6e0a40e32e Cleanup. Push more editing functions to toolset.
Also cleans up some more Module -> Footprint items.
2020-11-10 20:14:26 +00:00
Jeff Young 4dc877d0e9 Module -> Footprint. 2020-11-08 21:43:19 +00:00
Jeff Young 0ebea4be53 Cleanup and naming conventions. 2020-11-07 18:50:30 +00:00
Jeff Young 2b5f7d594b Auto-zoom means auto-zoom. Other zoom settings do not.
Fixes https://gitlab.com/kicad/code/kicad/issues/6257
2020-11-05 20:21:06 +00:00
Jeff Young d7ee5fe97f Apply wxWidgets hack to get saved component tree widths restored.
Fixes https://gitlab.com/kicad/code/kicad/issues/6036
2020-10-26 15:36:07 +00:00
Seth Hillbrand 4085757aeb Remove beginning/ending spaces in translations
Adding space padding makes translations more difficult by increasing
string counts
2020-10-20 12:08:04 -07:00
Jeff Young 92d84b0d67 Naming updates. 2020-10-15 01:35:16 +01:00
Michael Kavanagh c40483d18a Cleanup: Move KiCad files into plugins folder 2020-10-12 16:36:08 +00:00
Jon Evans c1a724377f Fix AUI pane caption colors for dark mode 2020-10-10 14:55:32 -04:00
Ian McInerney 43c14face0 Switch to showing metric/imperial units in comboboxes and menus
This will always show 1 unit from each system, with the primary unit
being the current frame unit and the secondary unit being the
most recent unit used from the other system. These are saved in
the settings, so they are saved between runs.
2020-10-05 20:26:33 +01:00
Ian McInerney b1bd1f2a97 Introduce new action to switch to mils as a unit 2020-10-04 17:53:55 +01:00
Jeff Young 7a4900b8dc PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T
Also updated footprint text and zone types for consistencey.
2020-10-04 16:49:04 +01:00
Jeff Young ba26e056ec Implement groups for modedit.
This uncovered a memory corruption bug in MODULE's move operator,
several bugs in MODULE's move and copy constructors, and a bug in
BOARD's GetItem() call.

It also bumps the file format for saving/restoring groups inside
footprints.
2020-10-03 12:19:50 +01:00
Jon Evans a25d091b6c Add Convert Shapes tool to footprint editor 2020-10-02 18:42:41 -04:00
jean-pierre charras 87a220b8e2 more cleanup about removing useless include 2020-10-02 14:51:11 +02:00
Ian McInerney 78c43158f4 Annotate the board class with if it is for a footprint edit/view 2020-09-30 23:34:04 +01:00
Jeff Young 6abe68fff0 Cleanup. No changes to execution. 2020-09-30 23:07:12 +01:00
Jon Evans 7c003f98d5 ADDED: Appearance panel for footprint editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5643
2020-09-30 17:46:58 -04:00
PJM d1322e7d1d Refactor GetDocumentExtents()
CHANGED: GetDocumentExtents() in 'eda_draw_frame.h' now has a bool
parameter "aIncludeAllVisible" with a default value "true" which makes
it behave as it did before adding parameter.  If "aIncludeAllVisible"
is false, the returned bbox ignores some items depending on which
program it is running in.

CHANGED: Made "Zoom to Objects" use only PCB edge in Pcbnew.  This
allows text, notes, etc outside the PCB edge to be excluded in the
zoom calculation.

CHANGED: Added "Zoom to Objects" to Pcbnew main menu, and to RMB context
menus for Eeschema and Pcbnew.

Fixes https://gitlab.com/kicad/code/kicad/issues/5787
2020-09-25 00:31:56 -07:00
Jon Evans ff652d5375 Fix saving colors modified outside of preferences 2020-09-24 17:29:40 -04:00
Jon Evans 18e17abd6a Rename "Keepout" to "Rule Area"
These objects can now be used in advanced DRC rules and
not just for keeping things out.  Also remove the restriction
that at least one of the "basic" keepout rules must be set,
so that these areas can be used for more advanced rules.
2020-09-21 23:55:02 -04:00
Jeff Young 865249c227 Handle two panels both referencing same colour theme.
Fixes https://gitlab.com/kicad/code/kicad/issues/5185
2020-09-21 11:59:27 +01:00
Jeff Young 5ec18aaf2a Fix board initialization error which left FPEdit without inner layers. 2020-09-07 21:01:42 +01:00
Seth Hillbrand 8751a55651 Tightening up the title bar display
Eeschema was the only application showing the file path.  This is of
limited use and prevented other information from showing in the
shortened menubar display.  Also combined strings for better translation
2020-09-03 06:59:37 -07:00
Michael Kavanagh de03d3d427 Application title bar: app name after filename
Fixes https://gitlab.com/kicad/code/kicad/issues/2096
2020-09-03 06:35:48 -07:00
Mark Roszko 9f128f942c Move shutdown blocker to kiplatform 2020-09-01 10:14:51 +00:00
Jeff Young cc64709407 Reimplement skip-parent-page to work with MacHack.
This prevents the "leaking" pages where the layers panel is shown
in the background of all other panels.

Fixes https://gitlab.com/kicad/code/kicad/issues/5182
2020-08-29 20:53:53 +01:00
Seth Hillbrand 0dc0536cbf pcbnew: Fix Select All copy-pasta
Adds condition to footprint editor and corrects condition for both
modedit and pcbnew
2020-08-26 17:19:32 -07:00
Mark Roszko 89e74140eb Save file / window states for kicad project locally 2020-08-24 02:01:14 +00:00
Jeff Young d71d127c1a Put up infobar when editing board footprint.
Fixes https://gitlab.com/kicad/code/kicad/issues/5294
2020-08-21 23:53:40 +01:00
Ian McInerney e8b11c911e Migrate Pcbnew/footprint viewer/footprint editor to the new UI update system 2020-08-16 19:10:26 +00:00
Jon Evans 2f604b4494 Add selection filter to footprint editor 2020-08-15 16:42:19 -04:00
Jeff Young 3b280e4886 Keep properties across an Exchange_Module call.
This is also used when saving a footprint from the Footprint Editor
back to the board.

Fixes https://gitlab.com/kicad/code/kicad/issues/5114

Fixes https://gitlab.com/kicad/code/kicad/issues/5114
2020-08-09 15:39:51 +01:00
Mark Roszko 3b727b5d16 Make preference groups not selectable 2020-07-20 13:45:46 +00:00
Jeff Young 3fd0a3f842 Update text variables even when they're changed from other binary.
For instance, you might have PCBNew open but change the variable
value through EEschema > Schematic Setup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4918
2020-07-17 21:05:11 +01:00
Jeff Young 7340c97ef9 Undo for schematic-wide operations.
Editing value/footprint fields of multi-unit components.
Find/Change.
Annotation.
Back annotation.

Fixes https://gitlab.com/kicad/code/kicad/issues/2122

Fixes https://gitlab.com/kicad/code/kicad/issues/4869

Fixes https://gitlab.com/kicad/code/kicad/issues/3933

Fixes https://gitlab.com/kicad/code/kicad/issues/4871

Fixes https://gitlab.com/kicad/code/kicad/issues/3899
2020-07-13 12:32:17 +01:00
Jon Evans a9e97848dd Fix use after free on BOARD_DESIGN_SETTINGS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4792
2020-07-03 19:13:06 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
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
2020-07-02 22:08:54 -04:00
Jeff Young cae493fe65 More infrastructure work for shape editor. 2020-06-18 15:38:01 +01:00
Jeff Young ee9d8fcd15 Collapse Pcbnew & ModEdit display and edit settings.
(Prep work for reusing them with a custom shape editor.)
2020-06-18 15:38:01 +01:00
Jeff Young c48f4272f3 Collapse a level out of the zoom settings.
The APP_SETTINGS_BASE now holds the list of zoom factors, and
the old legacy (screen-based) code has been removed.
2020-06-13 22:44:16 +01:00
Jeff Young f84406009b Push a couple of layers of indirection out of grid settings. 2020-06-13 11:35:56 +01:00
Ian McInerney 6692935808 Consolidate common viewer actions across cvpcb and pcbnew frames
* Consolidate the measure tool into one tool (this gives cvpcb
  unit changing and snapping capabilities in its measure tool)
* Transition cvpcb to use actions for the sketch modes
* Replumb how magnetic items settings are stored and used
2020-05-24 11:58:33 +01:00
Ian McInerney fca7ade81f Move to the AUI version of the infobar
The sizer-based version had issues with the event processing
inside the GAL panel on Windows systems.

Fixes https://gitlab.com/kicad/code/kicad/issues/4501
2020-05-21 18:22:56 +01:00
Ian McInerney 73a1ce3e84 Move eeschema find notification to the infobar and improve the infobar widget
* Move it to a panel along with the canvas to have a better UI
* Allow the infobar to automatically close after a set time

CHANGED: The eeschema find notifications now use the infobar instead of
a popup window
2020-05-20 02:31:47 +01:00
Jon Evans f2e003147e ADDED: Enable color themes for PcbNew printing 2020-05-16 13:19:43 -04:00
Jeff Young dea05336fc Don't zoom all the way in on a new footprint.
Fixes https://gitlab.com/kicad/code/kicad/issues/2220
2020-05-11 00:19:26 +01:00
Jeff Young 3c3984a6fc Generalize default footprint fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/2289
2020-05-08 23:30:33 +01:00
Jon Evans 9916f24fab Split out footprint editor color settings
Migrate COLOR_SETTINGS 0->1 to remove fpedit section
Migrate FOOTPRINT_EDITOR_SETTINGS 0->1 to use new theme if created
Remove COLOR_CONTEXT that is no longer needed
2020-05-05 21:46:00 -04:00
Jeff Young 889b6cb1b1 Clean up some commenting and rename MODULE_EDITOR_TOOLs to match filename. 2020-05-03 20:56:32 +01:00
Ian McInerney d006acecf4 More window sizing fixes
* Push all sizing operations into EDA_BASE_FRAME
* Save the unmaximized window size when maximizing
  so that we can then save it in the config if the
  window is maximized. Otherwise the config ends up
  with the maximized size saved, and weird behavior
  occurs when unmaximizing on the next opening.
2020-04-27 00:14:12 +01:00
Ian McInerney 3b67e3d0a4 Rewrite window positioning logic
Now only reposition a window if it is completely on a
disconnected display or if only one corner is on screen
and it is within a region close to the screen border.

CHANGED: Window position on startup should be preserved more
2020-04-18 00:47:38 +01:00
jean-pierre charras 74957bc7e3 Footprint editor: re-enable a internal copper layer to add/edit keep-out zones
on internal layers in footprints.

Fixes #4096
https://gitlab.com/kicad/code/kicad/issues/4096
2020-03-26 16:53:46 +01:00
jean-pierre charras 1e40753d33 FOOTPRINT_EDIT_FRAME: fix missing saving/loading a few config params. 2020-03-15 19:51:41 +01:00
Seth Hillbrand 842d680b5e Set Module Editor flag for tools
The commit takes the module edit flag when resetting the tool.  All
tools should reset this flag when we setup the Module editor.

Fixes #3973 | https://gitlab.com/kicad/code/kicad/issues/3973
2020-03-02 12:45:34 -08:00
Jeff Young 129042f8a6 Convert timestamps to UUIDs. 2020-02-20 21:29:52 +00:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
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.
2020-02-19 23:44:56 -05:00
Jeff Young 2017389f2d Pinning for library trees in FPEditor and SymbolEditor.
Fixes https://gitlab.com/kicad/code/kicad/issues/2288
2020-02-14 00:10:40 +00:00
Ian McInerney b1240b5b1e Gracefully shutdown tools when frames are closed
If the tools are not gracefully exited, then the stack variables are
never destroyed, so variable lifetime issues can occur.

Fixes https://gitlab.com/kicad/code/kicad/issues/1753
2020-02-05 22:23:24 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Ian McInerney b9d8849b28 Unify unsaved changes detection logic in all frames
Create an IsContentModified() function in each frame
that provides if the content has been modified, and
use that instead of always copying the checks.
2019-12-19 15:34:01 +00:00
Mark Roszko 686b768a3d Add shutdown blocking on Windows for pcbnew, eeschema and pleditor
ADDED: Block shutdown/logoff on Windows when contents have been modified
2019-12-19 14:11:11 +00:00
Jeff Young 102b530162 Fix library tree updating bug present at least on OSX. 2019-11-29 17:55:01 +00:00
Ian McInerney e82795ba58 Fix grid settings in pcbnew/modedit/cvpcb
* Make the grid display settings separate from the board object
* Ensure that the grid is initialized on creation in all the frames

Fixes: lp:1843169
* https://bugs.launchpad.net/kicad/+bug/1843169
2019-11-23 23:35:21 +00:00