Bug 391757 - Allow to keep crop settings
Summary: Allow to keep crop settings
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-12 14:53 UTC by Tsokar
Modified: 2018-03-26 01:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tsokar 2018-03-12 14:53:06 UTC
Hi !
When cropping multiple images with the same layout, one has to write down on a paper crop settings en re-enter them for every image.

It would be very convenient to be able to keep crop settings for the next image as long as we need it.

Thanks a lot for your work !
Comment 1 Huon 2018-03-22 11:32:49 UTC
Git commit c1e227f13af149155e3ac943a883b901be14c6f5 by Huon Imberger.
Committed on 22/03/2018 at 11:32.
Pushed by huoni into branch 'Applications/18.04'.

Save last used crop ratio settings

Summary:
The crop tool currently remembers if you have Advanced settings enabled.
This patch similarly remembers the Restrict to image ratio option
(Basic view) and the chosen Ratio (Advanced view).

Given how we store the ratios, and allow custom ratios using the same
combobox, we need to store both the current index of the combobox and
the ratio values.

I have removed `CropTool::onWidgetSlidedIn` because all it did was
ensure the crop rect was set, and we now always load a crop ratio
triggering the rect to update. If we leave it in, it actually resets
the rect after the saved ratio is loaded.

Note that if you enable the crop tool, then go to next image, any
changes will not be saved, including Advanced settings. This is
because the config is only saved when the tool is deactivated,
which is not triggered in this case.

Depends on D11202

Reimplement function now needed again, fix bug, add const

Save blank ratio combobox instead of last chosen ratio (if it's blank)

Crop ratio combobox is now saved properly

Test Plan:
Change ratio constraint with checkbox in {nav Basic} or the combobox
in {nav Advanced}. Ensure changes are saved after closing the crop tool
and closing Gwenview entirely.

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

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

M  +15   -5    lib/crop/croptool.cpp
M  +0    -3    lib/crop/croptool.h
M  +114  -26   lib/crop/cropwidget.cpp
M  +7    -0    lib/crop/cropwidget.h
M  +16   -0    lib/gwenviewconfig.kcfg

https://commits.kde.org/gwenview/c1e227f13af149155e3ac943a883b901be14c6f5
Comment 2 Tsokar 2018-03-23 12:15:57 UTC
You rock :-)
Thanks a lot !
T.
Comment 3 Huon 2018-03-26 01:58:33 UTC
(In reply to Tsokar from comment #2)
> You rock :-)
> Thanks a lot !
> T.

Thanks for the appreciation!