240 Commits

Author SHA1 Message Date
Nyall Dawson
dd89f3779a [processing] Always use the same method to launder names
Ultimately avoids forced removal of _ characters in model
parameter names
2022-03-30 15:41:23 +10:00
Nyall Dawson
d62d0b82e3 Port model help editor dialog to c++ 2022-02-28 17:33:49 +10:00
Nyall Dawson
fffc3a768b Don't show 'model was correctly saved' notification when saving models
We don't do this elsewhere (e.g. saving QGIS projects), and it makes
it sound like it's suprising that the save worked correctly..!
2022-02-28 17:33:36 +10:00
Nyall Dawson
8f34557037 [processing] When closing a model with unsaved changes, if the user
accepts the prompt to save the changes BUT then cancels the file dialog
asking for the destination file name, don't treat this as though the
user has opted to discard the model
2022-02-07 12:01:07 +10:00
Nyall Dawson
91ca892c34 Fix translation string 2022-02-05 11:05:51 +10:00
Nyall Dawson
7b9b486096 [processing] When "saving as" a model, if the model name originally
was a complete match for the old file name, then update the model
name for the saved as model to also match the NEW file name

E.g.

Scenario 1
- user has a model stored as "Save features.model3", named "Save
  features"
- user 'saves as' this model as "Delete features.model3"
- the model name is automatically updated to match the new file
name, i.e. "Delete features"

Scenario 2
- user has a model stored as "Save features.model3", named "Process
incoming features from API"
- user 'saves as' this model as "Save features v2.model3"
- the model name is NOT changed, and is left at the original
"Process incoming features from API" name
2022-02-05 11:05:51 +10:00
Nyall Dawson
a169055277 [processing] Improve UX when saving models
- When saving a model to a file, don't require that the model already
has a name entered. Instead, if no model name has been entered then
set the model name automatically to match the selected save filename.
E.g. if the user saves the model as "Process incoming features.model3",
then the model name will be set to "Process incoming features".
- When first saving a model, IF the user HAS already entered a model
name then make the default file name suggested by the dialog match
this model name
2022-02-05 11:05:51 +10:00
Nyall Dawson
e748877a59 [processing] Fix initial directory shown in model open file dialogs
should be the users home file, or the last used model directory
2022-02-04 16:34:53 +10:00
Nyall Dawson
86794dabdc Fix interface for QgsProcessingParametersGenerator was modified for
the python subclasses only and no longer correctly overrides the
base class method
2021-12-16 11:15:34 +10:00
Antoine
030bfd96b5 change the var with another 2021-09-27 16:13:20 +10:00
Nyall Dawson
c8d61499ff [processing] Instead of a hidden parameter for verbose model logging,
add an explicit log level getter/setter to QgsProcessingContext which
algorithms can use to determine an appropriate level of feedback
to push to users.

Initially the verbose log only triggers the full verbose output
of model executions (which is also used when running models through
the model designer), but the intention is that more algorithms
will fine tune their output based on the logging level.

qgis_process also gains a new --verbose switch to enable verbose
log output.
2021-02-20 05:04:00 +10:00
Luigi Pirelli
2f7d6defee Added sanity check of links between graphicitems showing error in dialog. Fixes #40724 #39260 2021-02-11 11:47:28 +10:00
Nyall Dawson
814b65ba1c Cleaner approach -- create expression contexts in modeler parameter
definition dialogs using expression context and processing context
generators
2021-01-14 16:15:06 +10:00
roya0045
5920ded609 invert logic 2021-01-05 18:24:06 +10:00
roya0045
d45b6144e4 add skip kwarg 2021-01-05 18:24:06 +10:00
Juergen E. Fischer
067e9254e7 translation string fixes 2020-04-24 16:30:45 +02:00
Nyall Dawson
acc68447c3 Validate models before running from designer, showing a summary of issues 2020-04-14 20:27:21 +10:00
Nyall Dawson
2dc07ee8f7 [processing] Show warnings in model designer message bar if algorithm
definition is incomplete/invalid after editing a child algorithm
2020-04-14 20:27:21 +10:00
Nyall Dawson
a80bdc47e5 [processing] Add API and interfaces so that widget wrappers can retrieve the
current set of parameters for other parameters when required
2020-04-04 17:58:55 +10:00
Nyall Dawson
3976e14ae8 Refine arrow API to allow control over whether arrows join to incoming or outgoing sides 2020-04-02 02:29:54 +10:00
Nyall Dawson
90a0a2d6a6 Fix exception when hiding comments 2020-04-01 18:20:09 +10:00
Nyall Dawson
f268b09d1b Also show child input values 2020-03-31 19:35:51 +10:00
Nyall Dawson
cb990c69c2 Setup framework for receiving model child results after running through model designer 2020-03-31 19:35:51 +10:00
Nyall Dawson
ef4344b674 Default to current layer when appropriate 2020-03-29 05:56:23 +10:00
Nyall Dawson
5149f0b6c7 Rebase fixes 2020-03-12 13:14:33 +10:00
Nyall Dawson
e3f1c576a9 Snapping api work 2020-03-12 13:14:33 +10:00
Nyall Dawson
4dd598fbb5 Also warn for unsaved changes when opening a model through the model designer 2020-03-11 08:39:54 +10:00
Nyall Dawson
e9c594d388 Make Model Designer window title follow app conventions
Show unsaved changes via * prefix, show model name in title

Also less Python, more c++
2020-03-11 08:39:54 +10:00
Nyall Dawson
e7b5c26696 [FEATURE][processing] Add undo/redo support to model designer
Makes QGIS more forgiving for users!

Sponsored by NRCan
2020-03-11 08:39:54 +10:00
Nyall Dawson
56610002e3 Identation 2020-03-06 18:22:49 +10:00
Nyall Dawson
0b3f7a58c1 Hookup toggle to hide comments from model designer 2020-03-06 18:22:49 +10:00
Nyall Dawson
08b47a496b Fix missing icon, less Python 2020-03-06 18:22:49 +10:00
Nyall Dawson
b84bf68dab Bit less Python 2020-03-06 18:22:49 +10:00
Nyall Dawson
8845b535c5 More c++ ports 2020-03-06 18:22:49 +10:00
Nyall Dawson
df7dd5ba90 More model dialog Python -> c++ ports 2020-03-06 18:22:49 +10:00
Nyall Dawson
a0e6a374eb Port some more model designer Python code to c++ 2020-03-06 18:22:49 +10:00
Nyall Dawson
eefd04cbc1 Start creation of a c++ base class for modeler dialog 2020-03-06 18:22:49 +10:00
Nyall Dawson
93355082a2 Add a menu bar to model designer 2020-03-06 18:22:49 +10:00
Nyall Dawson
2a1bf56493 [FEATURE][processing] Remember parameter values between model designer runs
When designing a model, users typically will need to run the model
many times as they tweak its structure.

This change causes the parameters used when running the model from
the designer to be remembered and saved into the model, so that
each time you run the model from the designer you don't have to
re-set all the input parameter values to the desired test ones.

Makes iterative model design SO much easier!

Sponsored by Alta Ehf
2020-03-06 18:22:49 +10:00
Nyall Dawson
961557dacd UX improvements for comment editing 2020-03-06 03:49:16 +10:00
Nyall Dawson
70731d82d5 Port most of the remaining ModelerScene code to c++
ModelerScene is now a shell class, implementing the bare minimum
required for older Python API compatibility
2020-03-05 18:55:20 +10:00
Nyall Dawson
5c44441cd3 Move some modeler scene code to c++, avoid hard link between scene
and dialog
2020-03-05 18:55:20 +10:00
Nyall Dawson
7d0b476fa7 Move almost all the remaining Python code for model graphic items to c++
Only minimal shells of objects are left in Python now, the bare minimum
required because they call objects which depend on Python compatibility
for deprecated API calls...
2020-03-04 07:19:00 +10:00
Nyall Dawson
8f6a6111d2 Use actual component sizes when drawing model instead of hardcoded values
(still not user-setable!)
2020-03-02 18:53:31 +10:00
Nyall Dawson
1d25155d15 Rework hiding of model controls to use a flag on the scene 2020-03-02 18:53:31 +10:00
Andrea Giudiceandrea
7903889f54 Modeler: Set default action to Export as Script Algorithm
otherwise the button tooltip is not shown
2019-09-30 09:48:30 +10:00
Nyall Dawson
10d6a8a122 [processing][API] Add API to QgsProcessingGuiRegistry and QgsProcessingParameterWidgetFactoryInterface
to handle creation of parameter definition widgets

Previously, these configuration widgets were all hardcoded into the Python modeler
dialog. This prevented 3rd party, plugin provided, parameters from ever being full
first class citizens in QGIS, as there was no way to allow their use as inputs to
user created models to be customised.

Now, the registry is responsible for creating the configuration widget, allowing
for 3rd party parameter types to provide their own customised configuration
widgets.

Refs #26493
2019-07-01 17:01:34 +10:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
Nyall Dawson
63d648738d [processing][needs-docs] By default, hide algorithms with known issues from toolbox
And add a Processing setting to allow these to be shown. When shown, they
are highlighted in red with a tooltip explaining that the algorithm
has known issues
2019-03-06 06:33:06 +10:00
Nyall Dawson
c1cc2b53d9 Fix qt warning on opening modeler dialog 2019-03-05 14:44:02 +10:00