Project

General

Profile

Bug #11586

Clone a module go to favorite modules

Added by Christian iuga 4 months ago. Updated 2 months ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
Start date:
04/21/2017
Due date:
% Done:

100%

Affected Version:
2.2.3
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

to reproduce the issue :
- Add a module into favorite (like shadow & higlight)
- Go into basic group
- Enable & tune the shadow & higligh module

Then when i duplicate this modules, the group change from basic to favorite

it's not a critical bug but it's strange & unexpected and it's also create a side effect :

if in favorite module, a module was expended before create the duplicate, i can see 2 modules expanded even with the option "expand a single darkroom module at a time" enable...

Associated revisions

Revision 98ab06a7
Added by Peter Budai 2 months ago

Duplicating a favorite module won't go to favorite module group automatically.
Fixes #11586

History

#1 Updated by Tobias Ellinghaus 4 months ago

  • Status changed from New to Triaged
  • % Done changed from 0 to 20

I won't have time to fix this myself. If anyone wants to give it a try, here is what's happening:

dt_dev_module_duplicate() calls dt_iop_load_module() which eventually calls dt_iop_load_module_by_so(). That function then calls dt_iop_gui_set_state() which is responsible for the tab changing. The quick hack would be to pass a flag down that call chain to not switch the module group. The better solution would be to think about why tab changing is part of module loading at all and maybe move that out of there – at the cost of making sure it's correctly called in all places where it's needed and not forgotten in the future.

#2 Updated by Peter Budai 2 months ago

I have looked into this, and found the following:
If in the modules list you click on a module the following happens:
  • 1st click: it will find the module for you, shows the appropriate module group and expands the module's setting
  • 2nd click: the module will get the favourite tag and the star will be displayed next to it, and the module group will switch to favourites
  • 3rd click: the favourite tag will be removed, and module group stays in the favourite
  • 4th click: the same as 1st click, cycle repeats

The line which always switches the modulegroup to favourites when a favoruite module is being added is here:
https://github.com/darktable-org/darktable/blob/master/src/develop/imageop.c#L2131

if you remove that line the following changes will happen:
  • on the 2nd click above, the module group won't change to favoutites. Actually I find it OK not to change module group to favourite when I mark a module as favourite.
  • duplicating a favourite module won't change module group, so that fixes this error

Any thoughts?

#3 Updated by Tobias Ellinghaus 2 months ago

In order to keep the old behaviour we could do the switch to the favourites group in the calling code so that it only happens when marking a module as favourite.

#4 Updated by Peter Budai 2 months ago

OK, I'll make a PR

#5 Updated by Peter Budai 2 months ago

  • Status changed from Triaged to Fixed
  • % Done changed from 20 to 100

#6 Updated by Roman Lebedev 2 months ago

  • Target version set to 2.4.0

Also available in: Atom PDF