CSSG-Labs / PyNote

Text Editor Written in Python
GNU General Public License v3.0
3 stars 4 forks source link

Create a "Save" function #15

Closed PatrickBruso closed 2 years ago

PatrickBruso commented 2 years ago

We need to create a "Save" function that will be connected to our "Save" label in the file menu. This function should first check to see if the text was opened from a file that already exists. If not, the function should call the "Save as" function to create the file. If the text is from a file that already exists, then it should save the text to that file instead of prompting the user for the file location.

PatrickBruso commented 2 years ago

This may need to be integrated with the "Open" function to determine whether "Save" or "Save as" needs to be used. Due to that, I would recommend that this issue not be attempted until the "Open" function has been implemented.

glunkad commented 2 years ago

Hey @PatrickBruso , I'm interested in contributing to this issue, so before I start working it, would you mind sparing your time explaining what the issue is about and pointing me to some resources to get started.

PatrickBruso commented 2 years ago

Hi @9gl! I think that you may want to work on #14 as we are currently in the process of working on a separate prompt class and "Open" function that may need to be completed before the save function can be implemented. For #14, you would essentially create a new function, "new", that would exist within the Application class. For now, all it would do would be to delete the text from the text box. In the future, we will have to connect it to the prompt to see if the user wants to save the work, but we can worry about that later. I would suggest taking a look at the code as it exists right now, and you can see an example of how we connected the save_as function to the "Save As" file label command. You will need to do the same for a new function, called "new", that will be connected to the "New" file label command.

I don't have any resources right now, but if you searched Google for something like "Tkinter remove text from text box" you would probably find an answer for how to do that.

PatrickBruso commented 2 years ago

@9gl If you want to work on #14 leave a comment there and I'll assign it to you.

AdamLaine commented 2 years ago

@PatrickBruso I'll take this issue as it is strongly connected to the #17 #18 and, though bugged, I have enough material from the #16 to implement it. In my opinion this issue will also be required for the #16 and #14, so I think this one should temporarily have a higher priority

PatrickBruso commented 2 years ago

Closed by #27