← Back to team overview

kicad-developers team mailing list archive

Re: Discuss: Save/Load Preferences

 

Le 17/01/2016 19:02, Chris Pavlina a écrit :
> Hi,
> 
> I'd like to discuss the Save/Load Preferences feature a bit. I've never 
> quite exactly understood what it's supposed to be used for. Here's what 
> I gathered from the code:
> 
> - Save Preferences calls SaveProjectSettings(true), asking the user if 
>   he wants to save the settings. This isn't the only place it happens, 
>   though - it is also called implicitly when plotting and when certain 
>   settings have been changed in preferences.
> 
> - The "Save" dialog displayed by Save Preferences is broken. It asks for 
>   a file name, but disregards it and always writes to the active project 
>   file.
> 
> - Load Preferences reloads GROUP_SCH and GROUP_SCH_EDITOR, and _also_ 
>   seems to disregard the selected file.
> 
> - GROUP_SCH is loaded when libraries are loaded. GROUP_SCH_EDITOR is 
>   only loaded when "Load Preferences" is selected.
> 
> I find this all very confusing, and partially broken. I at least insist 
> that we fix the broken save/load dialogs - it shouldn't ask for a file 
> and then ignore the selection. However:
> 
> Uh... what do people use this for? I'm having a hard time figuring out 
> the use case, and I think most users aren't really going to understand 
> what it does.
> 
> Keeping in mind that I don't know the use case, what about this:
> 
> - Stop calling SaveProjectSettings in places that are NOT the "Save
>   Preferences" menu item. This is just confusing, most users are going 
>   to assume that if it's something they can trigger with the menu, it's 
>   not something that'll just "happen" when certain operations are 
>   performed. Perhaps rethink those bits a bit so there's either no need 
>   to save anything, or doing it silently would become sensible.
> 
> - Replace Save/Load Preferences with something like Import/Export 
>   Hotkeys. Instead of saving to the project file, save to a separate 
>   settings file. This would resolve *my* first major misunderstanding, 
>   which is why even though "Save Preferences" saves to the project file, 
>   "Load Preferences" doesn't execute at project load.
> 
> I *think* this is more what it's used for, anyway - just having a place 
> to import and export preferences to.
> 
> Can someone comment or help dispel my misunderstandings?
> 
> -- Chris

Over the years, Save/Load Preferences has changed, and is now very
confusing.

The initial purpose was to save all preferences and project settings in
a file in a file associated to a project.
Default settings (used when starting a new board or schematic in a new
project) are also stored in a project file (which is the copy of a
template file).

It means paths, libraries to load, default values or last values used
for pads type and sizes, text sizes ...

Kicad was at the beginning designed to be used in a school at
University, and students used it on different PCs in different class
rooms, different OS, and the "home directory" was therefore not usable
to store this info.

Over the years, user config (stored in the "home directory" of a given
user on his own PC) was used to store "preferences" info (for instance
some paths).

The footprint library table is no more stored as "Preferences".
I am thinking the components library list (which are still in the
project config file) will be soon stored in something like a component
library table (Wayne ?).

Therefore the purpose of the project file (the .pro file) have to be
redefined.
However, we need to wait the new Eeschema version, to change the .pro file.

Here is what I am thinking:
* the .pro file should store info shared between eeschema / pcbnew /
Gerbview (for instance like paths used to store plot files : the path
for Gerber and drill file could be used by Gerbview) and a few options
specific to the project )

* Note also the library tables which were saved in the .pro files are
(of will be) saved in separate files, and the .pro file should not
contains a lot of info.

To avoid misunderstandings:
* Save/Load Preferences is (or should be) actually Save/Load only
project settings, and called Save/Load Project Settings.

* I am not sure the Save/Load is very useful (only saving project
settings as template to build a new template kicad.pro is useful)
It could be removed
(perhaps just have option "Make a template .pro file from this project")

* Preferences should be only the user preferences (like colors, size and
position of windows, autosave delay...)
(hotkeys import/export is currently an other topic, and has nothing to
do with Preferences and Project Settings config files in kicad code)

-- 
Jean-Pierre CHARRAS


Follow ups

References