#Bug, No check on open file option to save changes. - #27
Conversation
|
Hey @laiqujan Thanks very much for your PR. I really appreciate it! |
| # Mac OS System | ||
| .DS_Store* | ||
| ._* | ||
| /bin/ |
There was a problem hiding this comment.
I think, we don't really need this. It depends on your own environment, but no need to commit it.
If you can revert it, that would be great.
| if (edit) { | ||
| Object[] options = {"Save", "No Save", "Return"}; | ||
| int n = JOptionPane.showOptionDialog(this, "Do you want to save the file at first ?", "Question", | ||
| int n = JOptionPane.showOptionDialog(this, "Do you want to save changes ?", "Question", |
There was a problem hiding this comment.
Maybe Do you want to save the changes? instead (and remove also the space before the question mark). I know that this isn't you (my bad :)), but since you modified the text, you can do this too.
| } | ||
| } | ||
|
|
||
| if (edit) { |
There was a problem hiding this comment.
I'm sure you like DRY principle. However, you duplicated the same code as above https://github.com/pH-7/Simple-Java-Text-Editor/pull/27/files#diff-444b0d2f64a93f3dbc07fc4e0eb73f6dR473
Could you avoid doing this. Same for Object[] options = {"Save", "No Save", "Return"}; array, JOptionPane.YES_NO_CANCEL_OPTION, ..., ..., etc.
This block should be refactoring instead.
There was a problem hiding this comment.
I again @laiqujan I think you didn't read my comment or forgot it :)
| } | ||
| } | ||
| } | ||
| private void openFile(){ |
|
Thank-you @pH-7 for your kind response i resolved the conflict, let me know if any thing else creates problem. |
|
Great! Yes, there are also my above comments #27 (review) (check it directly on Github, it will be easier) |
Changes requested have been done..
| # Mac OS System | ||
| .DS_Store* | ||
| ._* | ||
| /bin/ |
There was a problem hiding this comment.
Oh, I was only speaking about the one you added (/bin/). Not the ones above.
|
@laiqujan Closing it until you fixed the mentioned issues. Please reopen it once done. |
Fixed.
Hi,
First of all, I really appreciate your work towards open source community.
I really wants to contribute in this project So, I started to test Text-editor and found some bug that there is no check on open file option to save changes if there is text in notepad.
can you please merge my pull request or add fallowing lines of code in your UI.java class for open file option.
// If the source was the "open" option