Confirm before tool exit
Summary:
Introducing confirm before a segmentation tool exit feature. The feature is implemented in Totalsegmentator.
As discussed in D912, the ConfirmExit method is kept generic and moved to mitk::Tool class.
The method is overrided in the TotalSegmentator tool class where it checks if a Preview was generated or not using a class variable.
A generic confirmation dialogbox is introduced in the QmitkToolSelectionBox::toolButtonClicked method to reduce redundancy.
Test Plan:
- Load an image on Workbench and goto Segmentation View > 3D tool > TotalSegmentator
- Click "Run TotalSegmentator" -> wait until segmentation mask preview is rendered.
- Click on any other tool icon eg. GrowCut -> A pop up window asks to confirm the action
- (1) Click "Yes" -> GrowCut tool UI is launched as usual.
- (2) Click "No" -> GrowCut tool is not launched. We stay in TotalSegmentator as before.
Reviewers: floca, kislinsk, O1 MITK Reviewer Group I
Reviewed By: floca, kislinsk, O1 MITK Reviewer Group I
Differential Revision: https://phabricator.mitk.org/D917