zoccihedron/wpi-suite — pull request #153 by yyan2 (2014-04-20 22:53:32+00:00)
Title: pull request for fix-issue151

Submit button is only enabled when changes have been made
Janeway freezing issue resolved
yyan

---
Please test throughly to see if Janeway freezes before merging. If it does, here are some clues that might help people to resolve issue in future:

Janeway freezes when the observer is calling method setCurrentEmailAndIM in panel class. And it seems that the order of setting fields is extremely important. If the line emailField.setText(currentEmail); is before the line initEmail = currentEmail;, the chance of getting freezing janeway will increase substantially; and the same for IMField and initIM. I guess setText for text field might trigger some actionlistener in text field which causes the problem due to some content inconsistency, but I'm not exactly sure.

--
Reason for changing submit button to public and set it as not enabled in observer: Observer is always the last thing finished after clicking on preference button, and if btnSubmit.setEnabled(false) is only added in constructor of panel class, it will be overwritten and button will become enabled again later. Feel free to change this part if anyone does not like it.