Modify Std_* commands to delegate to current origin #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Modify the existing standard FreeCAD file commands (
Std_New,Std_Open,Std_Save,Std_SaveAs, etc.) to delegate to the current origin instead of directly performing local file operations.Parent Issue
Epic: #8 Unified File Origin System
Goals
Std_*commands inCommandDoc.cppto useOriginManagerDetailed Design
Modified Command Pattern
Before:
After:
Commands to Modify
Std_NewcurrentOrigin()->newDocument()Std_OpencurrentOrigin()->openDocument()Std_SaveoriginForDocument(doc)->saveDocument(doc)Std_SaveAscurrentOrigin()->saveDocumentAs(doc)Std_ImportcurrentOrigin()->importFile(doc)Std_ExportcurrentOrigin()->exportSelection(doc)Std_RevertStd_CloseSpecial Cases
Std_Save Behavior
Save should use the document's origin, not the current origin:
Std_SaveAs Behavior
SaveAs should offer choice of origin (handled in #17 Mixed Origin Workflows), but initially just use current origin:
Error Handling
Menu and Toolbar
No changes needed - commands keep their existing:
The behavior changes dynamically based on current origin.
Implementation Tasks
#include "OriginManager.h"toCommandDoc.cppStdCmdNew::activated()StdCmdOpen::activated()StdCmdSave::activated()with document origin logicStdCmdSaveAs::activated()StdCmdImport::activated()StdCmdExport::activated()StdCmdRevertfor origin-aware behaviorFiles to Modify
src/Gui/CommandDoc.cppAcceptance Criteria
Dependencies
Blocking