Skip to content

Commit

Permalink
Only write starting profile if it has changed from last start.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhwood committed Jun 16, 2017
1 parent 64b3269 commit d708c1d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions java/src/jmri/profile/ProfileManagerDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,19 @@ private void formWindowOpened(WindowEvent evt) {//GEN-FIRST:event_formWindowOpen
* @see ProfileManager#getStartingProfile()
*/
public static Profile getStartingProfile(Frame f) throws IOException {
ProfileManager manager = ProfileManager.getDefault();
if (ProfileManager.getStartingProfile() == null
|| (System.getProperty(ProfileManager.SYSTEM_PROPERTY) == null
&& !ProfileManager.getDefault().isAutoStartActiveProfile())) {
&& !manager.isAutoStartActiveProfile())) {
Profile last = manager.getActiveProfile();
ProfileManagerDialog pmd = new ProfileManagerDialog(f, true);
pmd.setLocationRelativeTo(f);
pmd.setVisible(true);
ProfileManager.getDefault().saveActiveProfile();
if (last == null || !last.equals(manager.getActiveProfile())) {
manager.saveActiveProfile();
}
}
return ProfileManager.getDefault().getActiveProfile();
return manager.getActiveProfile();
}

private void profileNameChanged(Profile p) {
Expand Down

0 comments on commit d708c1d

Please sign in to comment.