Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boil Time not saved when you edit a copied recipe #688

Closed
jeroen79 opened this issue Nov 27, 2022 · 6 comments
Closed

Boil Time not saved when you edit a copied recipe #688

jeroen79 opened this issue Nov 27, 2022 · 6 comments

Comments

@jeroen79
Copy link

I am using V3.0.3 and if i change the boil time and switch recipes the change is lost.

@matty0ung
Copy link
Contributor

Sorry to hear you're having problems. I'm not able to reproduce this on my local install. Could you upload the log files in case that might give us a clue? (If you're running on Linux, it's usually ~/.config/brewtarget/brewtarget.log by default.) If you were also able to turn on debug logging from the GUI (Tools > Options > Logging > Logging Level = Detailed) before reproducing, that would be great.

@jeroen79
Copy link
Author

I turened on the log but wasn't able to reproduce it at first, but after some testing and recalling steps, it seems to happen only when you copy a recepie and edit the copy.

@matty0ung
Copy link
Contributor

OK, thanks, I can see it now. I will take a look, though it might be next weekend before I really have any time.

I think your workaround in the meantime is to close and re-run the program after creating the copy. Then the changes to the copy will stick. At least, that's how it seems to behave on my install.

@matty0ung
Copy link
Contributor

From what I can tell, the issue is to do with slots and signals. When you update the boil time in the user interface, it sends a signal to the MainWindow class, which then either updates the recipe (if it doesn't have any equipment) or the recipe's equipment (if it does). In the latter case the equipment then sends an "I have changed" signal to the recipe so the recipe knows to update its boil time. For some reason this last signal is not getting received. I'm guessing that when we create a copy of the recipe we're doing something in the wrong order.

TLDR: I think I've narrowed down where to look in the code. Will update when I have more info.

@matty0ung
Copy link
Contributor

OK, pretty sure I found the problem. We're not doing all the same signal connecting in Recipe::Recipe(Recipe const & other) that we are in Recipe::connectSignals(). The former is used when we make a copy of a Recipe; the latter connects all the signals for all the Recipes at start-up. I'm going to refactor the code so that we have exactly one place that connects signals for a recipe and then have these two functions call it. Patch coming.

matty0ung pushed a commit to matty0ung/brewken that referenced this issue Dec 10, 2022
@matty0ung matty0ung changed the title Boil Time not saved Boil Time not saved when you edit a copied recipe Dec 10, 2022
matty0ung pushed a commit to matty0ung/brewtarget that referenced this issue Dec 10, 2022
mattiasmaahl added a commit that referenced this issue Dec 10, 2022
@matty0ung
Copy link
Contributor

Closing now that https://github.com/Brewtarget/brewtarget/releases/tag/v3.0.5 is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants