Commit Graph

329 Commits

Author SHA1 Message Date
Ian McInerney 0a0935e0f3 Remove ACTIONS::TranslateLegacyId and TOOL_DISPATCHER::DispatchWxCommand
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).
2021-03-30 23:20:22 +00:00
jean-pierre charras faa5ed3e37 typo 2021-03-25 11:47:13 +01:00
Jeff Young 040cdd64f2 Fix typo in Eeschema titlebar.
Fixes https://gitlab.com/kicad/code/kicad/issues/8016
2021-03-25 10:28:03 +00:00
Jeff Young e560de496c Intersheet refs don't go in the view themselves.
(Their parents draw them.)

Also simplifies a couple of loops by using OfType().

Fixes https://gitlab.com/kicad/code/kicad/issues/7805
2021-03-19 16:14:34 +00:00
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 8be3ff5a0a Perform a slightly more aggressive cleanup.
Also removes the functionality that selects the newly-added item as
we don't do that with any of the other drawing tools.

Fixes https://gitlab.com/kicad/code/kicad/issues/7833
2021-03-09 21:42:35 +00:00
Dominik Wernberger e2aa7be4b3 Added a lot of consts and refactored a few lines 2021-03-08 12:49:48 -08:00
Jeff Young 6fd247a152 Check for active tool as well as items.
Fixes https://gitlab.com/kicad/code/kicad/issues/7821
2021-03-08 14:09:43 +00:00
Jon Evans 720147d272 Remove transitive inclusion of bitmaps.h 2021-03-07 16:08:57 -05:00
Jeff Young a3b9e8ddb4 Round 2 of Worksheet -> Drawing Sheet. 2021-02-23 11:57:44 +00:00
Jeff Young cad5198ab7 Worksheet -> (industry standard) Drawing Sheet. 2021-02-22 17:35:46 +00:00
Jon Evans f1039dfb94 Disable project saving outside explicit save actions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7589
2021-02-21 21:31:45 -05: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 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 ec20121114 Make sure schematic symbol fields get transferred to symbol editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/7501
2021-02-14 18:30: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
Seth Hillbrand 8567739a7a Remove conditions from common immediate-mode keys
The conditions prevent use in immediate mode for common actions.  While
this makes enable/disable easier in menu items, this fix is a patch
until we refactor the action framework to distinguish between immediate
mode hotkeys that should start without selections and menu items that
need a selection before running.

Fixes https://gitlab.com/kicad/code/kicad/issues/5333
2021-01-31 14:45:24 -08:00
Mikolaj Wielgus 8eca23aabe Mark null project initial screen as zoom-initialized
The variable `m_Initialized` in `BASE_SCREEN` is used by
`SCH_EDIT_FRAME` to mark whether a screen had its zoom level initialized
by the "zoom to fit screen" action. When this variable is `false`, the
function `SCH_EDIT_FRAME::DisplayCurrentSheet()` performs "zoom to fit
screen", modifying the zoom level. This function is indirectly called in
the undo routines, so if `m_Initialized` is not set to `true`, a zoom
change will occur when the user undoes an operation, a behavior that is
undesired.

`m_Initialized` was not initialized to `true` for the null schematic
(the schematic that is loaded if no project is loaded), causing the
aforementioned undesired behavior.

To prevent this, I've changed the `SCH_EDIT_FRAME` constructor to set
`m_Initialized` to `true`, since it zooms to fit screen already. I've
moved `m_Initialized` from `BASE_SCREEN` to `SCH_SCREEN`, as it is used
only in Eeschema, and renamed it to `m_zoomInitialized`, a name I
believe that better describes what this variable does.

I've also introduced the function `SCH_EDIT_FRAME::initScreenZoom()` to
group the "zoom to fit screen" action with setting `m_Initialized` to
`true`, as they often should occur together.

I'd also like to say that I'm not confident whether
`SCH_EDIT_FRAME::DisplayCurrentSheet()` should perform the zoom level
initialization at this point, but I have decided to not change this
behavior for now, as the commit history suggests it's several years old.

Fixes https://gitlab.com/kicad/code/kicad/issues/7343
2021-01-31 00:49:11 +00:00
Jeff Young 41234a8373 Implement more precise annotation-required messages.
Also moves the message to an infobar so it's more noticeable.

Fixes https://gitlab.com/kicad/code/kicad/issues/7332
2021-01-30 16:31:27 +00:00
Roberto Fernandez Bautista 42cbcf7ef4 Don't allow empty page numbers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6698
2021-01-22 14:02:34 +00:00
jean-pierre charras d052524707 Eeschema: fix zoom change on undo/redo command.
It was a side effect of commit e10025 fixing another zoom issue.
Fixes #7170
https://gitlab.com/kicad/code/kicad/issues/7170
2021-01-18 16:26:30 +01:00
Dominik Wernberger bb2881a5ab Make RENDER_SETTINGS argument const 2021-01-12 20:51:31 +00:00
Jeff Young 07673d3c11 Don't access tools after they've shut down. 2020-12-29 17:29:24 +00:00
Jeff Young 8a720ef305 Update naming. 2020-12-25 23:37:01 +00:00
Jeff Young 1648dd6f0e Fix various issues with save & editing symbols from schematic.
1) Zero out selection in tree when canvas captures focus so that
save/save as actions will go to canvas, not tree item.
2) Make save do a save to schematic when the canvas symbol is from
the schematic.
3) Copy fields when doing a save to schematic (setting the lib part
doesn't update them on its own).
4) Remove no-longer-necessary calls to update schematic after
saving symbols (the schematic symbols are no longer hot-linked).

Fixes https://gitlab.com/kicad/code/kicad/issues/6763
2020-12-25 11:58:58 +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
Jeff Young 7376c25ebe Fix a crash bug trying to update the view before it was ready. 2020-12-20 18:02:16 +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 ad281f7538 Remove duplicated TestDanglingEnds routines.
Also adds a changedItemHandler so that the single remaining version
can update the view.

Fixes https://gitlab.com/kicad/code/kicad/issues/6581
2020-12-06 21:24:16 +00:00
Jeff Young e79df4a3ed Formatting. 2020-12-03 15:16:34 +00:00
Roberto Fernandez Bautista 9380d6f533 eeschema page numbers: match ordering in hierarchy navigator to sheet page number ordering
- update hierarchy navigator after any modifications to the SCH_EDIT_FRAME
- do not generate ghost selection events after updating hierarchy tree
- use Human Readable path in SCH_EDIT_TOOL::EditPageNumber
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5760
2020-11-30 16:49:33 +00:00
Jeff Young 3da0ab1a9a Fix a couple of bugs in intersheet references.
1) init reference pages before trying to draw the SCH_FIELDs when
turning intersheet references on

2) don't double redraw because we accidentally cleared the last
hover item on a non-mouse-moved event.

3) make sure the root sheet gets a name for the hypertext menu.
2020-11-29 16:53:18 +00:00
Jeff Young 9922b7b738 Redraw canvas after preferences. (Needed for grid changes, etc.)
Fixes https://gitlab.com/kicad/code/kicad/issues/6433
2020-11-29 10:57:45 +00:00
Jeff Young 826e47dde3 Hook up excluded ERC marker persistence.
Fixes https://gitlab.com/kicad/code/kicad/issues/6425
2020-11-19 18:22:52 +00:00
Jeff Young c61c7b62aa Start of impl for persisting ERC exclusions. 2020-11-18 23:34:27 +00:00
Jeff Young 8c5c902fa3 Re-write IntersheetRefs on top of SCH_FIELDs and textVars.
1) Generalize SCH_ITEM owners (SCH_COMPONENT, SCH_SHEET, and now
SCH_GLOBALLABEL)
2) Generalize hypertext items
3) Use SCH_FIELD autoplace infrastructure for placing intersheet
references
4) Use textVar infrastructure for buildin intersheet references.

As an important side-effect this also fixes the undo issues with
intersheet refs.
2020-11-17 16:05:49 +00:00
Jeff Young a207bd97bb Naming conventions. 2020-11-17 16:05:49 +00:00
Jeff Young b227d2b910 More component -> symbol. 2020-11-15 20:23:15 +00:00
Wayne Stambaugh 43a4cf7957 Coverity fixes.
CIDs 309391, 310711, 310712, and 313055.
2020-11-12 08:15:49 -05:00
Michael Kavanagh 20bb3b194f Eeschema: Display the root sheet name to the user
Instead of just `/` denoting the root sheet, use the filename
in preparation for non-hierarchical multi-sheet schematics
2020-11-02 17:50:13 +00:00
Marek Roszko fbcbed5543 Add acceleratedGraphics prompt for eeschema 2020-10-31 17:49:50 -04:00
Jeff Young 6cefec64ea Commit pending changes before quitting.
Fixes https://gitlab.com/kicad/code/kicad/issues/6239
2020-10-31 11:50:11 +00:00
Jeff Young bddc97df30 LibEdit -> SymbolEditor 2020-10-31 10:28:21 +00:00
Jon Evans 70c90266a8 Fix crash when loading new schematic with something selected 2020-10-27 22:05:35 -04:00
Wayne Stambaugh f7084afb72 Eeschema: fix annotation bug.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6154
2020-10-26 13:01:36 -04:00
Marek Roszko e49ac45b84 HTML_MESSAGE_BOX is a dialog 2020-10-25 20:01:12 -04: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