Open recent list has only 9 recent projects

Bug #1745729 reported by Timothée Manaud
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Wishlist
José Jorge

Bug Description

The "Open recent" list is very useful but is also too limited.
As I work with at least 15 project, in multiple revision, I find it useless as the project I'm looking for is never in the list.
Why only 9 items? When most display nowaday have huge number of pixel.

Version:
Application: kicad
Version: no-vcs-found-bf44d39~61~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.13.0-26-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Revision history for this message
Timothée Manaud (timothee) wrote :

Screenshot attached

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

If we change this, please do not use a fixed number. Make it a user option so they can set the recently used menu size to what ever they want.

Changed in kicad:
status: New → Triaged
importance: Undecided → Wishlist
tags: added: starter
José Jorge (mexchip)
Changed in kicad:
assignee: nobody → José Jorge (mexchip)
José Jorge (mexchip)
Changed in kicad:
status: Triaged → In Progress
Revision history for this message
José Jorge (mexchip) wrote :

Hi, I'm working on adding this functionality, at this moment I'm adding a new option to kicad config file (~/.config/kicad/kicad in Linux), this option would look like this:

KicadHistorySize=15

at this moment there is no dialog for setting it, my main concern right now is that I've changed BIN_MOD.m_history to a pointer, dunno if it'd be acceptable.

I'm attaching a patch in case someone can give it a try/check.

What I would like to know:
* the modifications to BIN_MOD struct are acceptable?
* is it correct to use the "KicadHistorySize" option in code? (because I've not found the other options in the config file by searching the sources)
* would it be acceptable to have a config option without GUI option to edit it? (after knowing I'm on a good path I can work on adding a dialog)

Revision history for this message
José Jorge (mexchip) wrote :

Eeschema and pcbnew can be run standalone and have their own recent files list.

What do you think about:
* having the option only for full projects and not for eeschema/pcbnew (standalone)?
* a separate setting for each one (projects/eeschema/pcbnew)?
* or only one setting that applies to all of them?

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

As long as you delete the pointer (and you are), I don't see it being an issue.

"KicadFrame" is prepended to the keys automatically, so just search for (for instance) "MostRecentlyUsedPath" and you should find how they're handled. (In which case your key should probably be "FileHistorySize" which will then get expanded to "KicadFrameFileHistorySize".)

The setting should be added to PANEL_COMMON_SETTINGS. Have you used wxFormBuilder before?

PS: your code is missing spaces inside parenthesis in a lot of places. (Just don't add them when the parameter list is empty.)

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

What's wrong with the current recent file behavior other than the number of entries? The current behavior is exactly as I expect it to be. The last file opened is always at the top of the list no matter how the file was opened. Why do we need different behavior for when pcbnew and eeschema are launched in stand alone mode? I'm not sure this would be an improvement.

Revision history for this message
José Jorge (mexchip) wrote :

Jeff, thanks for the comments, it's been a long time I used wxWidgets, but I think I'll find my way with some help (just a little, I hope) .

Wayne, I was referring to the dedicated config file for each tool (in Linux ~/.config/kicad/kicad, ~/.config/kicad/eeschema and ~/.config/kicad/pcbnew), if you set 15 files only in ~/.config/kicad/kicad and open eeschema (standalone), you'll find you still have 9 max entries. I was thinking of having all the tools reading this option from the same file, so you set it once and apply to all of them, but I still need to dig a bit deeper in KiCad sources to get a better idea of how the config management works.

Revision history for this message
José Jorge (mexchip) wrote :

* Renamed the config option to FileHistorySize.
* Moved it to Kicad common settings (~/.config/kicad/kicad_common in Linux).
* Added it to PANEL_COMMON_SETTINGS, just below autosave.
* The minimum value is 1, the maximum is 100 (I know is quite big, if you have a better option please let me know).
* Fixed the missing spaces inside parenthesis.

I'm attaching a new patch, please let me know of any additional changes you may require.

Revision history for this message
José Jorge (mexchip) wrote :

Patch updated:
* adds m_history to BIN_MOD initialization list.
* fixes common/bin_mod.cpp conflict with commit c1cf7c3

Revision history for this message
José Jorge (mexchip) wrote :

Just deleted the previous patches that were not useful anymore.

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

@José, I reviewed and tested your patch.

I'm making a follow-on commit which will make it update on-the-fly, and will merge them both when I'm done with that.

Thanks for your contribution to Kicad!

Revision history for this message
José Jorge (mexchip) wrote :

That sounds great!

Thanks to you all for such a wonderful software!

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Hi all,

There is a thing I do not understand in the patch:
When clicking on a menuitem in the history list file, wxWidgets returns the id of the menuitem.
By default, it is wxID_FILE1 to wxID_FILE9 (this is the reason the default history size is 9)

Perhaps I missed something, but I do not see how the menuitems IDs are managed in this patch, for more than 9 items.

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

Forgot to mention that: I moved the IDs to the Kicad side (like we already do for Gerbers).

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

Hmmm... the original patch didn't handle Gerber drill files, zip files or job files.

Revision history for this message
José Jorge (mexchip) wrote :

Sorry about that, only tested recent eeschema/pcbnew and project files. I can check gerber, zip and job in the following days.

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

No worries; I've got it patched up.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 8d625854b8cd30626ae70062f48b04b7f4f1f981
https://git.launchpad.net/kicad/patch/?id=8d625854b8cd30626ae70062f48b04b7f4f1f981

Changed in kicad:
status: In Progress → Fix Committed
ronnie (ronnie81)
tags: removed: starter
Changed in kicad:
status: Fix Committed → Fix Released
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.