Bug 422885 - Filters, generators, and other dialogs lose their state when switching between them
Summary: Filters, generators, and other dialogs lose their state when switching betwee...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources All
: NOR wishlist
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-12 17:11 UTC by amyspark
Modified: 2020-06-23 12:55 UTC (History)
1 user (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 amyspark 2020-06-12 17:11:40 UTC
SUMMARY

Currently, no widget except for dlg_layersplit uses the KisDialogStateSaver facility. This makes them lose their state when switching between them.

Rakurri on KA noticed it first: https://krita-artists.org/t/first-alpha-of-my-gsoc-project-procedural-texture-generator/8127/6

There is a MR that needs some love here: https://invent.kde.org/graphics/krita/-/merge_requests/44

STEPS TO REPRODUCE
1. Try adding a new Fill Layer.
2. Configure a type.
3. Change to a different type and back.

OBSERVED RESULT
The widgets are reset.

EXPECTED RESULT
The initial configuration (2) should be preserved.

SOFTWARE/OS VERSIONS
Windows: 10 1903
macOS: 10.15.6
Linux/KDE Plasma: Manjaro Linux (rolling release)
(available in About System)
KDE Plasma Version: N/A
KDE Frameworks Version: 5.64.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION
Comment 1 amyspark 2020-06-17 14:36:08 UTC
For Fill Layers, KisDialogStateSaver is only a solution for the first time they are opened.
When switching between types, this configuration is overridden by kis_wdg_generator.cpp line 165, which resets everything to defaultConfiguration(). Replacing this with configuration() hardcodes it to the last known preset, which is not the intended behaviour either.
Comment 2 Halla Rempt 2020-06-23 12:10:05 UTC
Fun fact, that dialog was meant to be "temporary" when I created it 12 years ago...
Comment 3 Halla Rempt 2020-06-23 12:24:06 UTC
Git commit 1789e06f81489d98838a4587dafe2cf123c7097d by Boudewijn Rempt.
Committed on 23/06/2020 at 12:23.
Pushed by rempt into branch 'krita/4.3'.

Fill layers: Keep the config around when switching generators

Ideally, though, we'd replace this dialog that meant to be
temporary, in 2008, with something more solid...

M  +7    -5    libs/ui/dialogs/kis_dlg_generator_layer.cpp
M  +30   -18   libs/ui/widgets/kis_wdg_generator.cpp

https://invent.kde.org/graphics/krita/commit/1789e06f81489d98838a4587dafe2cf123c7097d
Comment 4 Halla Rempt 2020-06-23 12:26:14 UTC
Git commit f08c1fd15e636f17dab0cbc399c9f83cee4913c4 by Boudewijn Rempt.
Committed on 23/06/2020 at 12:26.
Pushed by rempt into branch 'amyspark/T13097-gsoc2020-seexpr'.

Fill layers: Keep the config around when switching generators

Ideally, though, we'd replace this dialog that meant to be
temporary, in 2008, with something more solid...
(cherry picked from commit 1789e06f81489d98838a4587dafe2cf123c7097d)

M  +7    -5    libs/ui/dialogs/kis_dlg_generator_layer.cpp
M  +30   -18   libs/ui/widgets/kis_wdg_generator.cpp

https://invent.kde.org/graphics/krita/commit/f08c1fd15e636f17dab0cbc399c9f83cee4913c4
Comment 5 Halla Rempt 2020-06-23 12:55:55 UTC
Git commit 5a6fbdd61e6293658140dcb8ee27993f88f67787 by Boudewijn Rempt.
Committed on 23/06/2020 at 12:37.
Pushed by rempt into branch 'master'.

Fill layers: Keep the config around when switching generators

Ideally, though, we'd replace this dialog that meant to be
temporary, in 2008, with something more solid...
(cherry picked from commit 1789e06f81489d98838a4587dafe2cf123c7097d)

M  +7    -5    libs/ui/dialogs/kis_dlg_generator_layer.cpp
M  +30   -18   libs/ui/widgets/kis_wdg_generator.cpp

https://invent.kde.org/graphics/krita/commit/5a6fbdd61e6293658140dcb8ee27993f88f67787