Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BoardAutoCreator should not prompt for save if there is no need to #1461 #1462

Merged
merged 14 commits into from
Apr 5, 2016

Conversation

xinan
Copy link
Contributor

@xinan xinan commented Apr 3, 2016

Fixes #1461

Now it will only prompt for save if current board is dirty, or current board has not been saved before.

If current board is a dirty saved board, it will trigger Save.

If current board has not been saved before, it will trigger Save as.

@ndt93 ndt93 self-assigned this Apr 4, 2016
@ndt93
Copy link
Contributor

ndt93 commented Apr 4, 2016

@xinan Hey xinan, can you resolve the conflicts with mater branch?

@xinan xinan changed the title BoardAutoCreator should not prompt for save if there is no need to BoardAutoCreator should not prompt for save if there is no need to #1461 Apr 4, 2016
if (isSaveBoardDialogResponsePositive(boardName)) ui.getMenuControl().saveBoardAs();
private void saveBoardAfterUserConfirmationIfNeeded(String boardName) {
boolean isNeeded = !prefs.getLastOpenBoardPanelInfos().isPresent()
|| !prefs.getLastOpenBoardPanelInfos().get().equals(panelControl.getCurrentPanelInfos());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a more accurate name is isOpenBoardDifferentFromSavedBoard or something like that, because that's what the condition seems to be checking.

@@ -1,5 +1,7 @@
package prefs;

import java.util.Objects;

public class PanelInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a change in this PR, but can you help adding the header comment for this class?

@@ -126,11 +132,20 @@ private boolean isNewBoardCreationDialogConfirmed() {
response.get().getButtonData() == ButtonData.OK_DONE;
}

/**
* Called upon the Boards > Save being clicked
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

import java.util.Objects;

/**
* Represents the information about a Panel. Contains two String attributes {@code name} and {@code filter}.
Copy link
Contributor

Choose a reason for hiding this comment

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

2nd sentence is unnecessary and easily outdated.

@damithc
Copy link
Contributor

damithc commented Apr 5, 2016

Can merge after removing the comment text mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants