CSSG-Labs / PyNote

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

Create "Open" function #16

Closed PatrickBruso closed 2 years ago

PatrickBruso commented 2 years ago

We need to create an open function that is connected to the "Open" label in the file menu. This command should open a file via file dialog that exists on the user's system and then load that file into the text box.

Additionally, this function should also save the status of the text (i.e., that it was opened from file) and the file location so it can be used with the "Save" command.

AdamLaine commented 2 years ago

Sorry to open again this issue. I have found a bug. If you open a file while having something written in the text field it won't clear the field (it won't do anything), but add the text to previously written one. If we are going similarly to the Notepad, for example, it is needed to have a prompt which asks if the user wants to save the current text before opening a new one, for example.

PatrickBruso commented 2 years ago

@SamReiCooper Nice catch. I will review the custom prompt class when I have some time and see if linking that will fix this issue. I imagine we will want that prompt class to clear the text box after a user has picked whether to save or not save, etc.