-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feature] Allow users to save expression functions in QGIS project file #43
Conversation
dd37bc5
to
57dbdaf
Compare
6c8a9a7
to
dc84fc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loving this function, I actually had to avoid using these exactly because they weren't portable / embedded into shared projects. A few comments here and there.
dc84fc1
to
7bc69a2
Compare
Thanks a lot for your review, all changes were applied in e9f736e |
889fbfc
to
0b73ff2
Compare
0b73ff2
to
7b24c9d
Compare
14ce964
to
154adac
Compare
…ways at the top of the list in the 'Function editor' tab) and never stored in a user profile file
…e whether to store functions in a .py file (current behavior) or in the QGIS project
…e param, tr, string literals)
… users allow it, just like we do with macros
…se and reload user expressions (from profile) to avoid any potential overwrite from unloaded project functions
… project close) and reloading user ones, specifically to restore overwritten user functions when opening a project with expressions inside
…nsFromProject to QgsProject::read and ::clear, respectively. Introduce function pythonEmbeddedInProjectAllowed to ask for permissions to load both macros and expression functions, with a parameter enum and rename existing enum for macros. Sort includes. Drop not needed file. Add python/expressions/ to gitignore, to get rid of files produced by the introduced Python test.
154adac
to
c5286e4
Compare
In the expression builder dialog, Python functions can only be saved in the user profile directory. If a user wants to share expression functions with colleagues, he/she needs to share his/her expressions directory or individual
.py
files, which is inconvenient (without mentioning the installation of those shared files won't be trivial either).This PR allows users to also store expression functions into the current QGIS project file, making it easier to share functions with other interested parties.
Some details about the implementation:
[Project Functions]
item will be listed in the left-hand side list widget (Function Editor
tab).[Project Functions]
item already exists in the list, the corresponding option in theAdd Function File
dialog will be disabled.Labels: [Needs Documentation] [Feature] [Expressions]
Funded by the QGIS user group Switzerland.