Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Geometry checker] Show feedback in the UI when the user presses Cancel
  • Loading branch information
manisandro committed Jan 19, 2016
1 parent 8835658 commit 772ded8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.cpp
Expand Up @@ -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 ) );
Expand All @@ -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();
}
Expand Up @@ -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.