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

keep provider selection on re-open #169

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

koebi
Copy link
Collaborator

@koebi koebi commented Mar 3, 2022

Fixes #168

the provider choice is now persisted in the config.yml file
and automatically selected in the ORStoolsDialog window.

The configmanager was extended and can now set and get the active provider
small refactor moving the ors_client and provider logic
to the base processing algorithm class.

processAlgorithm methods now use the complete signature
to use the active provider in processing algorithms by default,
it is read from the storage.
However, the defaultValue for QgsProcessingParameterEnum is not working,
which is why the options of the enum are reordered to show the active
provider on top.
As the index of the provider selected in the Enum does not refer to the
same provider in the config anymore, it has to be resolved properly again,
when using the provider to generate the ors_client.

This can lead to problems (using the wrong provider) when the active provider
is changed, after a processing algorithm window was opened, due to how
the algorithm parameters are initialized.
@TheGreatRefrigerator
Copy link
Collaborator

the config.yml file is now used to store the active provider.

81d65de sucks due to multiple reasons also documented in code and commit,
which is why we probably don't want that after all:

  • the defaultValue property of the Enum in the processing algorithm is not working, which is why the options have to be reordered if we want to show the currently active provider. This means indices differe between enum options and the provider list in the config, which has to be resolved when running the algorithm.
  • if there are changes to the active provider between opening the algorithm window and running it (e.g. open dialog window, switching provider) it might not resolve to the correct provider.
  • the selected provider can't be saved if the algorithm window is just closed and not run

our options:

  • read and save active provider in processing algorithms (might resolve wrong)
  • only read active provider in processing algorithms (might resolve wrong)
  • don't use active provider in algorithms at all (provider has to be selected each time)

@TheGreatRefrigerator
Copy link
Collaborator

@koebi could you also have another look at this an give your opinion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keep the selected provider when closing/reopening
3 participants