Skip to content

#Bug, No check on open file option to save changes. - #27

Closed
laiqujan wants to merge 4 commits into
pH-7:masterfrom
laiqujan:master
Closed

#Bug, No check on open file option to save changes.#27
laiqujan wants to merge 4 commits into
pH-7:masterfrom
laiqujan:master

Conversation

@laiqujan

@laiqujan laiqujan commented Oct 13, 2018

Copy link
Copy Markdown

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

@pH-7

pH-7 commented Oct 19, 2018

Copy link
Copy Markdown
Owner

Hey @laiqujan Thanks very much for your PR. I really appreciate it!
I see that there is a conflict there with some newer changes done in src/simplejavatexteditor/UI.java Can you fix it?

Comment thread .gitignore Outdated
# Mac OS System
.DS_Store*
._*
/bin/

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/simplejavatexteditor/UI.java Outdated
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",

@pH-7 pH-7 Oct 19, 2018

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I again @laiqujan I think you didn't read my comment or forgot it :)

}
}
}
private void openFile(){

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition. I like it 😃

@laiqujan

Copy link
Copy Markdown
Author

Thank-you @pH-7 for your kind response i resolved the conflict, let me know if any thing else creates problem.

@pH-7

pH-7 commented Oct 20, 2018

Copy link
Copy Markdown
Owner

Great! Yes, there are also my above comments #27 (review) (check it directly on Github, it will be easier)

Comment thread .gitignore Outdated
# Mac OS System
.DS_Store*
._*
/bin/

@pH-7 pH-7 Oct 22, 2018

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was only speaking about the one you added (/bin/). Not the ones above.

@pH-7

pH-7 commented Nov 14, 2018

Copy link
Copy Markdown
Owner

@laiqujan Closing it until you fixed the mentioned issues. Please reopen it once done.

@pH-7 pH-7 closed this Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants