Skip to content

Commit 772ded8

Browse files
committed
[Geometry checker] Show feedback in the UI when the user presses Cancel
1 parent 8835658 commit 772ded8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
312312
connect( checker, SIGNAL( progressValue( int ) ), ui.progressBar, SLOT( setValue( int ) ) );
313313
connect( &futureWatcher, SIGNAL( finished() ), &evLoop, SLOT( quit() ) );
314314
connect( mAbortButton, SIGNAL( clicked() ), &futureWatcher, SLOT( cancel() ) );
315+
connect( mAbortButton, SIGNAL( clicked() ), this, SLOT( showCancelFeedback() ) );
315316

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

321322
/** Restore window **/
322323
unsetCursor();
324+
mAbortButton->setEnabled( true );
323325
ui.buttonBox->removeButton( mAbortButton );
324326
mRunButton->setEnabled( true );
325327
mRunButton->show();
326328
ui.progressBar->hide();
329+
ui.labelStatus->hide();
327330
ui.widgetInputs->setEnabled( true );
328331

329332
/** Show result **/
330333
emit checkerFinished( !futureWatcher.isCanceled() );
331334
}
335+
336+
void QgsGeometryCheckerSetupTab::showCancelFeedback()
337+
{
338+
mAbortButton->setEnabled( false );
339+
ui.labelStatus->setText( tr( "<b>Waiting for running checks to finish...</b>" ) );
340+
ui.labelStatus->show();
341+
ui.progressBar->hide();
342+
}

src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.h

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class QgsGeometryCheckerSetupTab : public QWidget
5353
void updateLayers();
5454
void validateInput();
5555
void selectOutputFile();
56+
void showCancelFeedback();
5657
};
5758

5859
#endif // QGS_GEOMETRY_CHECKER_SETUP_TAB_H

0 commit comments

Comments
 (0)