Add save and reset state functionality to the crop tool

Authored by aichingm on Apr 19 2020, 10:25 PM.

Description

Add save and reset state functionality to the crop tool

Summary:
The state is saved after the crop tool emits CropTool::done and gets
recalled if a new CropTool is created. The state also gets reset by
hitting the newly added reset button in the QDialogButtonBox of the
CropTool. The state also gets reset if the saved crop rectangle is
not within the image which is about to be cropped.

The use case for this is cropping the multiple images to the same
area. Like removing boarders of a series of pictures taken in a
photo both.

Test Plan:
Select the first image. Use the crop tool to crop it to region.
Click "Crop".
Select an image with the same or a larger size.
Select the crop tool.
The selection area should now be the same as used on the first image.
Hitting the reset button should reset all parameters to the defaults.

Alternatively: instead of the second (equal or larger) image select a image smaller than the crop area.
Again use the crop tool.
The selection should now cover the whole image.

Reviewers: Gwenview, ngraham

Reviewed By: Gwenview, ngraham

Subscribers: ngraham

Tags: Gwenview

Differential Revision: https://phabricator.kde.org/D28480

Details

Committed
ngrahamApr 19 2020, 10:33 PM
Reviewer
Gwenview
Differential Revision
D28480: Add save and reset state functionality to the crop tool
Parents
R260:4f7d35d17532: Fix leaking ThumbnailGenerators
Branches
Unknown
Tags
Unknown