1453 Commits

Author SHA1 Message Date
github-actions[bot]
3d661da669 auto-fix pre-commit issues 2025-06-04 10:04:35 +10:00
Harrissou Sant-anna
0960be13b6 Add one more translatable string 2025-06-04 10:04:35 +10:00
Harrissou Sant-anna
74dd0a0052 Make button label translatable 2025-06-04 10:04:35 +10:00
Nyall Dawson
4cf15e496c [processing] Allow creating tests with dynamic expression params 2025-05-30 14:17:49 +10:00
Nyall Dawson
6bd91f8381 [processing][api] Add API for an algorithm to auto-set parameter values
Adds an API which an algorithm can implement to support auto-setting
parameter values. This is designed to handle the case
of eg an algorithm which does a file format translation, where
it's desirable to default the output parameter value to an input
parameter value with a different extension.

This can now be done by implementing autogenerateParameterValues
in the algorithm, eg:

    def autogenerateParameterValues(self, existingParameters, changedParameter, mode):
        if changedParameter == self.INPUT:
            input_file = existingParameters.get(self.INPUT)
            if input_file:
                input_path = Path(input_file)
                if input_path.exists():
                    # auto set output parameter to same as input but with 'qgs' extension
                    return {self.OUTPUT: input_path.with_suffix('.qgs').as_posix()}

        return {}

Works for both toolbox and batch modes for algorithms
2025-04-30 13:56:09 +10:00
Nyall Dawson
4220d9f227 Add flag to skip validation of processing parameters 2025-04-30 13:56:09 +10:00
Andrea Giudiceandrea
c4a2e9c6d2 [gui][processing] Fix "Check validity" algorithm ID in menu 2025-04-27 09:53:27 +10:00
Alexander Bruy
b5019cbfb0
Merge pull request #60945 from alexbruy/processing-export-geometry-info-cpp
port Add geometry attributes algorithm to C++
2025-04-14 20:04:33 +01:00
Juergen E. Fischer
d9b5d8c9c5 update_ts.sh: alternatively use pylupdate6 + python translation string fixes 2025-03-23 23:23:02 +01:00
Jan Caha
d981659ecb add types 2025-03-20 10:12:37 +10:00
pre-commit-ci[bot]
117ef4c7d5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-03-20 10:12:37 +10:00
Jan Caha
b546ba43e4 update strings
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2025-03-20 10:12:37 +10:00
Jan Caha
ea9ee4088e handle temporary output 2025-03-20 10:12:37 +10:00
Jan Caha
cb3ebba533 all temporary output on selection panel 2025-03-20 10:12:37 +10:00
Alexander Bruy
5577990fdc port Export geometry attributes algorithm to C++ 2025-03-13 07:41:31 +00:00
Mathieu Pellerin
1aeb8bbdd4 [processing] Fix alg. postprocessing regression failing to add all but one output to the project 2025-02-17 08:35:48 +10:00
Alexander Bruy
e5d1543a65
fix typo 2025-02-12 06:33:13 +00:00
Nyall Dawson
0180380076
[processing] Fix exception when algorithm has no output layers
Fixes regression caused by https://github.com/qgis/QGIS/pull/59850
2025-02-12 14:56:48 +10:00
Jean Felder
a46f3e9752 postprocessing: Use QgsLayerTreeRegistryBridge to add layers
When a profile tool is already opened, the output of a procssing is
not added to its layer tree. This is because it relies on a
`QgsLayerTreeRegistryBridge`. Indeed, `QgsLayerTreeRegistryBridge`
listens to the `QgsProject::legendLayersAdded()` signal in order to
update the elevation profile tree view. However this signal is not
triggered by the current logic in `Postprocessing.py`because
`QgsProject::addMaplayer` is called with `addToLegend` set to
False. Then, the layer is added to the tree by calling
`QgsLayerTreeGroup::insertChildNode`.

This issue is fixed by creating a
`QgsLayerTreeRegistryBridge::InsertionPoint` to set the insertion
point and then calling `QgsProject::addMaplayer` with `addToLegend`
set to True.
2025-02-07 10:22:53 +10:00
Mathieu Pellerin
f2289c83f1 [processing] Fix feature iteration against a model (fixes #60131) 2025-01-28 12:06:36 +10:00
Denis Rouzaud
0f032e5f2d run pre-commit on all files 2024-11-29 15:38:02 +01:00
Nyall Dawson
578aa207d0 Show warning when loading batch params for algs with security risk
If the algorithm has the security risk flag, warn the user before
they can open stored batch parameter files
2024-10-02 10:36:00 +10:00
Nyall Dawson
0d55518c24 [processing] Fix translation of elapsed strings
Fixes #58635
2024-10-01 20:30:39 +10:00
Nyall Dawson
6c1de7f70a [processing] Replace format for saving batch processing parameters
The older approach of storing parameters was insecure, and required
eval()ing the unchecked contents of the batch parameter file. This
is a security risk, as a malicious file could leak user information
or damage the system.

So,

- Switch to a newer ".batch" format which uses safe JSON objects
only for serializing parameter values.
- Allow loading the older .json files, but first show a warning
that they are a security risk and require to user to explicitly
agree to open the file
2024-10-01 19:35:51 +10:00
Nyall Dawson
95c9bb56b2 Remove unused code 2024-10-01 19:35:51 +10:00
Andrea Giudiceandrea
016a33f43f [processing] Fix warning in postprocessing 2024-09-16 09:31:55 +10:00
Alexander Bruy
7bd8c071f3 port Basic statistics for fields algorithm to C++
Also add new optional output a table containing calculated statistics
similar to the Statistics by categories algorithm (fix #46241)
2024-07-05 05:18:25 +10:00
Alexander Bruy
f0db0f247b address review 2024-07-04 07:30:51 +10:00
Alexander Bruy
40f85dd8e7 allow user to add/remove Processing algorithms to/from Favorites 2024-07-04 07:30:51 +10:00
Nyall Dawson
c685a9aa77 Replace processing default extension setting with string based setting
Change the setting key to force a reset for all users, and move to
a stable string based setting instead of a fragile int index key

Fixes #57676
2024-06-07 18:44:57 +10:00
Even Rouault
07067d37b5 python/plugins: turn on GDAL exceptions to avoid deprecation warning
Fixes #57344
2024-05-22 13:34:35 +10:00
Nyall Dawson
834167018e Add algorithmAboutToRun signal to QgsProcessingAlgorithmDialogBase
This signal can be used to tweak the algorithm's context prior to
the algorithm execution.
2024-05-04 06:30:43 +10:00
Nyall Dawson
fc1922ae43 [processing] When no specific layer group is required for an output,
place it above the current selected layer

Fixes #56129
2024-04-20 08:49:45 +10:00
Nyall Dawson
51378f9827 [processing] Set the active layer to one of the generated outputs
Fixes #57003
2024-04-20 08:49:45 +10:00
Nyall Dawson
f1d762eba7 Update python/plugins/processing/gui/BatchPanel.py
Co-authored-by: Nicolas Godet <39594821+nicogodet@users.noreply.github.com>
2024-02-21 08:11:58 +10:00
Nyall Dawson
ece5d30a0b Ensure correct context is used when determining parameters for row
Fixes #56132
2024-02-21 08:11:58 +10:00
Nyall Dawson
496fd18e55 Add typehints 2024-02-21 08:11:58 +10:00
Nyall Dawson
def984cd4f Cleanup code, only run checks when warnOnInvalid is True
Refs #56132
2024-02-21 08:11:58 +10:00
Nyall Dawson
de0afb14db Don't call QFontMetrics.width() 2024-02-12 14:22:37 +10:00
Nyall Dawson
58695f7c83 Apply suggestions from code review 2024-02-01 17:22:29 +10:00
Alister Hood
05ac633ca9 Don't report that html output has been generated if it hasn't 2024-02-01 17:22:29 +10:00
Nyall Dawson
e42abf7dc5 Update python files 2024-01-22 05:46:15 +10:00
Nyall Dawson
c16a1e2b3d Update enums 2024-01-19 19:44:48 +10:00
Julien Cabieces
9d12ae8e6d [PyQt6] Add scope for enums and get rid of PyQt5.XXX import
this has been done automatically with the following comand line

./scripts/3to4/3to4.py --only-qgis3-compatible-changes ./python/plugins/
./scripts/3to4/3to4.py --only-qgis3-compatible-changes ./tests/src/python/
2024-01-10 21:15:27 +10:00
Nyall Dawson
3c179214fc Use nicely formatted results in processing logs 2024-01-09 17:02:21 +10:00
Blottiere Paul
9df62b90f3 Raise error in case if invalid parameter in batch mode 2023-10-17 15:32:54 +02:00
Alexander Bruy
edaa3dda96 update vector menu links to processing algorithms (fix #54937) 2023-10-16 05:04:34 +10:00
Denis Rouzaud
c76b86e26b
move enum QgsMapLayerProxyModel::Filter to Qgis (#54891) 2023-10-11 13:57:01 +02:00
Juergen E. Fischer
a0c3d67911 Don't install CMakeLists.txt 2023-10-02 11:44:34 +02:00
Alexander Bruy
81dbdd8bae
Merge pull request #53874 from alexbruy/processing-port-align-raster-tool
Port Align rasters tool to Processing
2023-09-14 16:29:49 +03:00