Register .kc as a recognized file type alongside .FCStd:
C++ changes:
- Document.cpp: checkFileName() accepts .kc extension
- Gui/Document.cpp: Save As and Save Copy dialogs include *.kc
- CommandDoc.cpp: Merge document dialog includes *.kc
- DlgProjectUtility.cpp: Project utility dialog includes *.kc
Python changes:
- FreeCADInit.py: register *.kc in import type system
- kc_format.py: DocumentObserver that preserves silo/ ZIP entries
across saves (caches before save, re-injects after save)
- InitGui.py: register kc_format observer on startup
Silo integration:
- get_cad_file_path() generates .kc paths for new files
- find_file_by_part_number() finds both .kc and .FCStd, preferring .kc
- search_local_files() lists both .kc and .FCStd files
The .kc format is a superset of .FCStd with a silo/ directory
containing Kindred platform metadata. See docs/KC_SPECIFICATION.md.
viewDefaultOrientation is a method on View3DInventorPy (Python wrapper),
not on View3DInventorViewer (C++ viewer). Use doCommand with the Python
API, matching the pattern used in StdCmdViewHome.
- Detect document's origin vs current (target) origin
- Route to appropriate workflow:
- Same origin: standard SaveAs
- Local → PLM: migration (handled by PLM origin)
- PLM → Local: export (handled by local origin)
- PLM → PLM: transfer (handled by target PLM origin)
This provides the infrastructure for Issue #17: Mixed origin workflows.
The actual migration/export dialogs will be implemented in the
respective origin adapters (SiloOrigin, LocalFileOrigin).
Issue #10: Local filesystem origin implementation
- Add openDocumentInteractive() method to FileOrigin interface for UI-based
file opening (shows file dialog)
- Add saveDocumentAsInteractive() method for UI-based save as
- Implement LocalFileOrigin::openDocumentInteractive() with full file dialog
support, filter list building, and module handler integration
- Implement LocalFileOrigin::saveDocumentAsInteractive() delegating to
Gui::Document::saveAs()
Issue #12: Modify Std_* commands to delegate to current origin
- StdCmdNew::activated() now delegates to origin->newDocument() and sets
up view orientation for the new document
- StdCmdOpen::activated() delegates to origin->openDocumentInteractive()
with connection state checking for authenticated origins
- StdCmdSave::activated() uses document's owning origin (via findOwningOrigin)
for save, falling back to saveDocumentAsInteractive if no filename
- StdCmdSaveAs::activated() delegates to origin->saveDocumentAsInteractive()
- Updated isActive() methods to check for active document
The Std_* commands now work seamlessly with both LocalFileOrigin and
SiloOrigin. When Local origin is selected, standard file dialogs appear.
When Silo origin is selected, Silo's search/creation dialogs appear.
Import and Export commands are left unchanged as they operate on document
content rather than document lifecycle.
Closes#10, Closes#12
"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
* Sketcher: Introduce Select All (Ctrl + A)
As the title says, this allows selecting all geometries on the sketch
with CTRL + A shortcut, plus also allows to select "Select All" option
from Edit menu.
* Sketcher: Use fmt instead of std::stringstream in selectAll
* Sketcher: Fix typo in selectAll
Co-authored-by: João Matos <joao@tritao.eu>
---------
Co-authored-by: João Matos <joao@tritao.eu>
The command is only able to show the property view in case it's
invisible. But it fails to raise the widget. And if in the preferences
'Combined' mode is set it fails completely.
Solution:
The method DockWindowManager::activate already does everything what's
needed. Now the command only must be changed to access the right
docked widget.
* File export: generate a default filename if the selected object changed since the last export
* Renamed variable to be more clear as per PR review feedback
* Fix and add menu accelerators: menus common to all workbenches
I use menu accelerators fairly often, so I find it very frustrating when
they are missing, or worse, they don't work due to the same letter being
assigned to several commands.
This patch adds accelerators to lots of menu entries missing them and
fixes broken accelerators.
Wherever possible, standard accelerator keys are used:
https://doc.qt.io/qt-5/accelerators.html
This commit covers accelerator fixes that are common to all workbenches.
Accelerator fixes for specific workbenches will be done in separate
commits.
* Add missing accelerators: Spreadsheet workbench
A frozen object prevents the document to be saved
The frozen status propagates into object inheritance
A frozen sketch is no more editable
Transform and Placement can't be changed for a frozen object
The freeze icon is reduced
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.
The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).
Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".
The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
* project to document on information, merge, util
* change project to document in unit system dialog
---------
Co-authored-by: WandererFan <WandererFan@gmail.com>