Skip to content
Permalink
Browse files

[Geometry checker] Show feedback in the UI when the user presses Cancel

  • Loading branch information
manisandro committed Oct 15, 2015
1 parent 8835658 commit 772ded8c38bcbefcc08b82cd909b20cdcc6551b6
@@ -312,6 +312,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
connect( checker, SIGNAL( progressValue( int ) ), ui.progressBar, SLOT( setValue( int ) ) );
connect( &futureWatcher, SIGNAL( finished() ), &evLoop, SLOT( quit() ) );
connect( mAbortButton, SIGNAL( clicked() ), &futureWatcher, SLOT( cancel() ) );
connect( mAbortButton, SIGNAL( clicked() ), this, SLOT( showCancelFeedback() ) );

int maxSteps = 0;
futureWatcher.setFuture( checker->execute( &maxSteps ) );
@@ -320,12 +321,22 @@ void QgsGeometryCheckerSetupTab::runChecks()

/** Restore window **/
unsetCursor();
mAbortButton->setEnabled( true );
ui.buttonBox->removeButton( mAbortButton );
mRunButton->setEnabled( true );
mRunButton->show();
ui.progressBar->hide();
ui.labelStatus->hide();
ui.widgetInputs->setEnabled( true );

/** Show result **/
emit checkerFinished( !futureWatcher.isCanceled() );
}

void QgsGeometryCheckerSetupTab::showCancelFeedback()
{
mAbortButton->setEnabled( false );
ui.labelStatus->setText( tr( "<b>Waiting for running checks to finish...</b>" ) );
ui.labelStatus->show();
ui.progressBar->hide();
}
@@ -53,6 +53,7 @@ class QgsGeometryCheckerSetupTab : public QWidget
void updateLayers();
void validateInput();
void selectOutputFile();
void showCancelFeedback();
};

#endif // QGS_GEOMETRY_CHECKER_SETUP_TAB_H

0 comments on commit 772ded8

Please sign in to comment.
You can’t perform that action at this time.