Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro: allow to specify extra system paths for macro #18525

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

ein-shved
Copy link
Contributor

This introduce new option -E [ --macro-path] to specify extra system paths of macros. The macro found in this paths will appear in Macros dialog at System macros tab.

Will fix #18343

@github-actions github-actions bot added the Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label Dec 15, 2024
@ein-shved ein-shved marked this pull request as ready for review December 15, 2024 13:01
@ein-shved ein-shved force-pushed the macro-path branch 2 times, most recently from 98ca010 to 3840022 Compare December 15, 2024 13:56
@chennes chennes self-requested a review December 16, 2024 17:00
@maxwxyz
Copy link
Collaborator

maxwxyz commented Dec 16, 2024

@chennes promised to look at it before this Friday

@maxwxyz
Copy link
Collaborator

maxwxyz commented Dec 20, 2024

@chennes here is a reminder 😄

src/Gui/DlgAbout.cpp Outdated Show resolved Hide resolved
@chennes
Copy link
Member

chennes commented Dec 20, 2024

Overall I think this is a great addition -- I've long wanted the ability to have multiple macro directories (right now the Addon Manager has to copy the FCMacro files out of an Addon and install them into the user's macro directory, and this can eliminate the complexity that creates). I think in the long run we'd like this to be configurable via a user-accessible preference, but that can certainly wait for a follow-up PR. So in my opinion this is basically good to go (pending my above concern about the printing code modifying a variable that isn't being passed by reference). But I would like @wwmayer to give this a brief look to ensure I'm not missing something critical about modifying these search paths (which can have unintended consequences).

@ein-shved
Copy link
Contributor Author

I think in the long run we'd like this to be configurable via a user-accessible preference, but that can certainly wait for a follow-up PR

I am actually working on the declarative configuration way from nix. For now, I implemented the configuration the list of modules, python paths, start-up user configuration file and extra flags for QT. The macros are missing for now, so I needed for this functionality to finish this.

This introduce new option `-E [ --macro-path]` to specify extra system
paths of macros. The macro found in this paths will appear in `Macros`
dialog at `System macros` tab.

Change-Id: Ic21631ec0ebe8af5c7f42b4fe95400cfb67807d5
Copy link
Contributor

@wwmayer wwmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine now.

@yorikvanhavre yorikvanhavre merged commit f48ccba into FreeCAD:main Jan 6, 2025
9 checks passed
@tarman3
Copy link

tarman3 commented Jan 8, 2025

The same config, but FreeCAD 1.1.0dev.39786 not show any macros in folder

FreeCAD 1.1.0dev.39786 (Git) Conda AppImage, Arch Linux (KDE/plasma/xcb)
Screenshot_20250108_085108_lossy


FreeCAD 1.0.0.39109 (Git) makepkg, Arch Linux (KDE/plasma/wayland)
FreeCAD 1.1.0dev.39748 (Git) Conda AppImage, Arch Linux (KDE/plasma/xcb)
Screenshot_20250108_084544_lossy

ls "/home/user/.local/share/FreeCAD/Macro"

1213.FCMacro         dxfLibrary.py                          Macro_FCSpring_Helix_Variable.FCMacro.manifest  toggle_view_2.FCMacro
deselectAll.FCMacro  dxfReader.py                           __pycache__
dxfColorMap.py       FCSpring_Helix_Variable.png            SheetMetalUnfoldUpdater.FCMacro
dxfImportObjects.py  Macro_FCSpring_Helix_Variable.FCMacro  splitPoints.FCMacro
FreeCAD 1.0.0.39109 (Git) makepkg, Arch Linux (KDE/plasma/wayland)
OS: Arch Linux (KDE/plasma/wayland)
Architecture: x86_64
Version: 1.0.0.39109 (Git)
Build type: Release
Branch: makepkg
Hash: 2fcc5317fe3aee96ca73475986a577719fc78e20
Python 3.12.7, Qt 6.8.0, Coin 4.0.3, Vtk 9.3.1, OCC 7.8.1
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/
Installed mods: lattice2 1.0.0; CurvedShapes 1.0.13; MeshRemodel 1.10.35; freecad.gears 1.3.0; fasteners 0.5.34; sheetmetal 0.6.13; Silk 0.1.5; Curves 0.6.53
FreeCAD 1.1.0dev.39786 (Git) Conda AppImage, Arch Linux (KDE/plasma/xcb)
OS: Arch Linux (KDE/plasma/xcb)
Architecture: x86_64
Version: 1.1.0dev.39786 (Git) Conda AppImage
Build type: Release
Branch: main
Hash: 013eb6e6353ab6e5077ab4696653c9b493442638
Python 3.11.9, Qt 5.15.13, Coin 4.0.3, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Fusion
Installed mods: lattice2 1.0.0; CurvedShapes 1.0.13; MeshRemodel 1.10.35; freecad.gears 1.3.0; fasteners 0.5.34; sheetmetal 0.6.13; Silk 0.1.5; Curves 0.6.53

ein-shved added a commit to ein-shved/FreeCAD that referenced this pull request Jan 8, 2025
By mistake the user macro list was cleared on each fillUpList call
withing FreeCAD#18525. This fixes FreeCAD#18933
ein-shved added a commit to ein-shved/FreeCAD that referenced this pull request Jan 8, 2025
By mistake the user macro list was cleared on each fillUpList call
withing FreeCAD#18525. This fixes FreeCAD#18933
ein-shved added a commit to ein-shved/FreeCAD that referenced this pull request Jan 8, 2025
By mistake the user macro list was cleared on each fillUpListForDir call
withing FreeCAD#18525. This fixes FreeCAD#18933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: Add flags for additional macro search paths (allows distros like Nix to augment the addon search paths to be installed system-wide without modifying predefined Mod directory)
6 participants