Closed PatrickBruso closed 2 years ago
@PatrickBruso This one is quite a complex issue due to the number of different cases and will require some stuff done also in other fields. Logically I'm thinking of 2 prompts appearing on different occasions:
@SamReiCooper I agree, and see my response to your comment in the CustomPrompt issue thread. I think the trigger would be whether a file was opened. Basically, if a file was opened, you will want to save the new/updated text to that same file location. Otherwise, if a file was not opened (meaning the text was added to the initial "new" text box or the user created a "new" text box using the "new" command) then we will want to prompt with the "save as" function to create the file location.
I was going to add a global variable that is referenced by the "Open" function that would save the file location of a file that is opened. That way, whenever we check to save or save as, the program would see if a file location is already available. If so, it would use the save function. If not, it would use save as.
@PatrickBruso I will await the custom prompt acknowledge and after that implement this issue, using an empty save function (later can be changed), i.e.: def save(self): pass
@SamReiCooper I think this issue can now be completed using the CustomPrompt class and will act as an example of how to use that class that can then be replicated with the "New", "Open", "Save", etc. functions.
Provided that the PR was approved and merged I think this issue can be closed
We need to update the application so that it will prompt the user to save if there is unsaved work when the user quits the program. If the user does want to save, then the text should be saved (either via "Save" or "Save as"). Otherwise, the text should be deleted and the program ended.