Footprint Editor Save As should be enabled at all times

Bug #1840997 reported by Seth Hillbrand
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Low
Jeff Young

Bug Description

When editing a footprint from a board, the "Save As" menu option should be enabled to allow saving the footprint into a library

Application: ModEdit
Version: (5.1.0-1574-g22fdc7f51-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF

Tags: pcbnew starter
Revision history for this message
eelik (eelik) wrote :

Actually it *is* enabled, but only if nothing in the tree is selected. When you select a library, the Save As in File menu is disabled. However, the RMB menu Save As is enabled and naturally saves the library. And the RMB menu on a footprint name has Save As enabled, too. If you select a footprint name in the tree it will be the one which is saved by the File->Save As menu item.

I think there's a larger usability problem here which is caused by combining several things in one window and menu structure. Maybe the File menu could be replaced by two menus, Library and Footprint which would have their own Save As etc. items. Then they would be easier to manage. Or at least add more words to the menu items so that it would be unambigous which item is affected, for example "Save Footprint As" and "Save Library As". But there would still be the problem of having two footprints which can be meant, namely the highlighted one in the tree and the current one in the editor area.

Revision history for this message
Seth Hillbrand (sethh) wrote :

On my system, the menu option is always disabled for all board items. It is also disabled for library items when a library is selected in the tree (as you note)

If you open a library footprint, Save As is enabled from the File menu and allows you to save the footprint into a different library.

I'm fine with disambiguating this entry by re-naming the menu option "Save Footprint As"

I think the "Save Library As" is correctly placed in the context menu of the library tree and should not go in the main menu because we do not open "Libraries" but rather footprints only. Adding a "current library Save As" will be confusing.

Revision history for this message
Jeff Young (jeyjey) wrote :

Hmmmm... I'm seeing the same as eelik. Furthermore, even if you do select something in the tree, if you then move your mouse over the editing canvas (with the board footprint on it), the selection in the tree is killed and the Save As is enabled again.

@Seth, does the list highlighting go away when you move your mouse over the canvas?

Revision history for this message
Seth Hillbrand (sethh) wrote :

Here's what I see.

From a UX perspective, I would expect Save As from the file menu to be performed on the footprint currently loaded, not the footprint selected in the tree.

In the context menu for the tree items, Save As makes sense to save the selected footprint rather than the loaded footprint.

Revision history for this message
Seth Hillbrand (sethh) wrote :

One more note here, the "File->Export->Export Footprint" does act on the opened footprint and not the selected footprint.

Revision history for this message
Jeff Young (jeyjey) wrote :

@Seth, could you put a breakpoint in FOOTPRINT_EDIT_FRAME::GetTargetFPID() and then click on the file menu?

GetTreeFPID() should return an empty LIB_ID, after which GetLoadedFPID() will be called (which should return the LIB_ID of the loaded board footprint).

Hmm... I wonder if m_footprintNameWhenLoaded isn't getting set for some reason?

Revision history for this message
Seth Hillbrand (sethh) wrote :

It looks like module->GetFPID().GetLibNickname() is empty, so footprintTargettedCondition is always false.

Revision history for this message
Jeff Young (jeyjey) wrote :

Yeah, that's the difference. Note also in your video that when you select the footprint on the board (ie: before opening it in the Footprint Editor) that you don't have a library shown in the status bar under "Footprint".

How do you get that, anyway? Is it from a rescue or something?

Revision history for this message
Seth Hillbrand (sethh) wrote :

Yes. It's an ancient board that I'm updating for a new project.

Revision history for this message
Jeff Young (jeyjey) wrote :

Cool. I'll update the check to only look for a footprint name.

Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: New → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 32aa26517553d54f24b3c4e61e37c4e8b6eaf2c9
https://git.launchpad.net/kicad/patch/?id=32aa26517553d54f24b3c4e61e37c4e8b6eaf2c9

Changed in kicad:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.