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

[processing] don't show cancel button in the task manager for algorithms that can not be cancelled (refs #20441) #9026

Merged
merged 2 commits into from
Jan 29, 2019

Conversation

alexbruy
Copy link
Contributor

Description

While for these algorithms we have "Cancel" button disabled (see https://issues.qgis.org/issues/18600), in the task manager UI cancel button still present. This causes some confusion, when user clicks on this button and nothing happens.

Partially fixes https://issues.qgis.org/issues/20441.

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and contain sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

@@ -23,7 +23,7 @@
#include "qgsvectorlayer.h"

QgsProcessingAlgRunnerTask::QgsProcessingAlgRunnerTask( const QgsProcessingAlgorithm *algorithm, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
: QgsTask( tr( "Executing “%1”" ).arg( algorithm->displayName() ), QgsTask::CanCancel )
: QgsTask( tr( "Executing “%1”" ).arg( algorithm->displayName() ), algorithm->flags() & QgsProcessingAlgorithm::FlagNoThreading ? QgsTask::CanCancel : QgsTask::Flag() )
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this logic backwards?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks strange for me too. Don't know why, but backwards (and correct) condition

algorithm->flags() & QgsProcessingAlgorithm::FlagNoThreading ? QgsTask::Flag() : QgsTask::CanCancel

does not work for me, for example, with GDAL algorithms I still have a cancel button in the task manager.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually the flag tested is wrong - it should be FlagCanCancel

@nyalldawson nyalldawson merged commit b19e0bd into qgis:master Jan 29, 2019
@alexbruy alexbruy mentioned this pull request Jan 31, 2019
8 tasks
@alexbruy alexbruy deleted the processing-cancel branch February 1, 2019 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants