A reverse cookbook program where you tell it what you want to use and it tells you what you can make
Recent PostsSee All
It’s been some time since I last posted and I have accomplished quite a bit since then. The backend of the program has been completely rewritten and tested. I changed the schemas of my database to reduce the number of repeated elements. There are now seven schemas to replace the single old one. Each ingredient type has its own table so that there are no repeated ingredients. There are tables to take care of the relationships between the recipe and the ingredients, all by ids instead of text. I changed to ids in order to reduce the amount of space used in the database, this also disallows multiplicity. I changed my search function as well. I switched from using lists of vegetables to sets, which allows me to use simple math on the sets to find a match. My strict search only give a match if the set of selected vegetables matches the set of vegetables that goes with a recipe in the database. The non-strict search gives a match if the intersection of the two sets is greater than zero. I intend to modify it slightly so that the user can change the minimum number of matches between sets if they want. I have started implementing the side dishes layer, both in the GUI and the backend. So far I have the add function implemented, and am working out the bugs. For the database I added in two new schemas to handle the ingredients and their relationships with the main recipe. I also added in a schema to handle relationships between side dishes and main dishes. I’m working on finishing up the implementation of the side dishes layer.
Yesterday afternoon I finally found some C++ source code for a non-linear Qt wizard. This example gave me enough information to make my wizard non-linear. I had the base construction of my wizard done in a way that did not allow for nonlinearity. I had to create a new class as the main QWizard which in turn calls the QWizardPage classes that I had already constructed. With that I was able to create and call nextId functions that tell the current QWizardPage which page to continue on to. After testing this on small sections, I was able to string all my small chunks of linear wizard together to make the entire non-linear wizard for the program.
The next issue I ran into, was that the wizard would continue on to other actions once it was finished with one of them. So at the last page of each action I had the page call the nextId function again, only this time returning -1 to indicate to the wizard that it should not continue on. Eventually, I would like to change it so that the user has the option of looping back to the beginning if they would like to keep using the program, instead of it just closing when it is done with an action.
For the rest of the week I will be hunting down small bugs in the wizard, and making the code a little neater in order to make it easier to tie the rest of the actions into the back end.
Last week I finished the part of the GUI that allows the user to edit the recipes that they have in their database. This week I am going to start tying all the chunks of GUI that I have together. Once I get that done, I am going to go through and clean a few things up. I have some sections that rely upon things that are in other parts of the GUI, so once it is all tied together I can remove extra buttons.