Don't create a project when saving files standalone
Description
Right now, many aspects of KiCad depend on a project existing. We can open board or schematic files standalone (running eeschema or pcbnew outside of the kicad project manager), edit them, and save them. If a project happens to exist for the file (i.e. a kicad_pro
file of the same name in the same directory), it will be loaded and everything is fine. If the project file doesn't exist, a new project with default settings will be created in memory so that all the features that depend on the project existing will work properly.
The issue comes when you click "Save". We currently write out this new project to disk. This is annoying as it clutters up the directory you are working out of, and people opening files standalone outside the context of a project usually don't want a new project created just because they edited the file.
Option 1: Completely remove this behavior
We could change the settings manager to just skip writing out a project in this situation.
The consequences of this are that no features that depend on the project file for persistence would work properly (i.e. any changes would be lost when reloading the file). We would likely need to warn the user when they are editing things that cannot be saved (for example, most of the contents of the Board Setup dialog).
Option 2: Make this behavior optional, default to on
There is one argument that "normal" KiCad users do not often open files standalone, and when they do, we might be better off assuming they would rather have their changes saved than prevent the creation of extra files.
If we take this assumption as valid, we may want to have this behavior optional so that users who tend to open lots of files standalone can disable project creation but everyone else gets the current behavior.
In this case, we could maybe get away with putting the "your changes will not be saved" warning just near this setting, instead of everywhere else where a project setting can be changed.
KiCad Version
Application: Eeschema
Version: (5.99.0-2282-ga94a81b9a), debug build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Platform: Linux 5.4.0-40-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
Date: Jul 12 2020 11:17:30
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OCE: 6.9.1
Curl: 7.68.0
ngspice: 31
Compiler: GCC 9.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_SPICE=ON
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=OFF
KICAD_SANITIZE=OFF